Quick Sight High Charts - Generating Reference Line

Please look at the graph i am generating. I want to add a reference line which is the average of all the points on the graph. I want it dynamically calculated. How can i do that?

{

“xAxis”: {

"type": "datetime",

"dateTimeLabelFormats": {

  "day": "%d %b",

  "week": "%d %b",

  "month": "%d %b",

  "year": "%d %b"

},

"labels": {

  "format": "{value:%d %b}",

  "style": {

    "color": "#333",

    "fontSize": "14px"

  }

}

},

“yAxis”: {

"title": {

  "text": "Round Time in Minutes",

  "style": {

    "color": "#333",

    "fontSize": "14px",

    "fontWeight": "bold"

  }

}

},

“tooltip”: {

"shared": true,

"pointFormat": "Round Time: {point.y:.2f}<br/>"

},

“series”: [

{

  "type": "line",

  "color": "red",

  "opacity": 0.7,

  "name": "April",

  "data": \[

    "map",

    \[

      "filter",

      \["getColumn", 0, 1, 2\],

      \["==", \["get", \["item"\], 1\], 4\]

    \],

    {

      "x": \["get", \["item"\], 0\],

      "y": \["get", \["item"\], 2\]

    }

  \]

}

]

}

This is what I want instead:

@xgeexx, you can use another calculated field (with avgOver inside) to get another series with average values or you can use yAxis.plotLines and calculate average in the visual using “reduce” Array operations - Amazon QuickSight .

Hi @xgeexx

It’s been a while since we last heard from you. If you have any further questions, please let us know how we can assist you.

If we don’t hear back within the next 3 business days, we’ll proceed with close/archive this topic.

Thank you!

Hi @xgeexx

Since we have not heard back from you, I’ll go ahead and close/archive this topic. However, if you have any additional questions, feel free to create a new topic in the community and link this discussion for relevant information.

Thank you!