Reputation: 147
I'm trying to graphic some values, I have this part, then I want to add some max and min
line, I could do this creating another series and adding the min/max value that I want, the problem here is that my value series is an array of n elements
so I want to know if I could create the min/max series for example just doing data: [2]
and put the line in all the width of my chart. Something like this:
If there is no way to do this, just if is possible doing: data[2, 2, 2,.... n]
is possible to show only the first and the last point and hide the rest of them?
Upvotes: 0
Views: 2187
Reputation: 17800
You can use plotLines
for this.
Example:
yAxis: {
softMax: max,
min: 0,
plotLines: [{
value: min,
width: 1,
color: 'rgba(204,0,0,0.75)'
},{
value: max,
width: 1,
color: 'rgba(204,0,0,0.75)'
}]
}
Updated pen:
Alternatively, if you really want it to be a series, you can grab the min and max x values, and provide your data as arrays of [x,y]
pairs. Something like:
series: [{
name: 'Actual Series'
...
},{
name: 'Max',
data: [[xMin,yMax],[xMax,yMax]]
},{
name: 'Min',
data: [[xMin,yMin],[xMax,yMin]]
}]
Upvotes: 2