I'd like to create kind of a baseline in my chart, where there a multiple columns, and a horizontal line of value "1", which starts at the y-axis and goes beyond the last column. See this example:
Now, I have created something similar, but it's not yet succeeded:
The series code is simple:
series:
[{
type: 'column',
data: [4.05,2.81,2.1,1.20,0.37]
},
{
type: 'line',
name: 'Globale Biokapazität',
data: [1,1,1,1,1]
}]
Is there any parameter I can set to extend the line? Or is there any other way to highlight a line?
Thanks for any hints!
The plotOptions is a wrapper object for config objects for each series type. The config objects for each series can also be overridden for each series item as given in the series array. Configuration options for the series are given in three levels. Options for all series in a chart are given in the plotOptions.
Highcharts supports a long list of different chart types, among others line , spline , area , areaspline , column , bar , pie , scatter , gauge , arearange , areasplinerange and columnrange .
The legend is a box containing a symbol and name for each series item or point item in the chart. Each series (or points in case of pie charts) is represented by a symbol and its name in the legend. It is possible to override the symbol creator function and create custom legend symbols.
We will start off by creating a simple bar chart. Add a div in your webpage. Give it an id and set a specific width and height which will be the width and height of your chart. A chart is initialized by adding the JavaScript tag, <script> </script> , anywhere in a webpage, containing the following code.
There are a lot of example about plotLines
Just use something like this:
yAxis: {
plotLines:[{
value:450,
color: '#ff0000',
width:2,
zIndex:4,
label:{text:'goal'}
}]
},
one of them: DEMO
You have two options:
use plotLine instead: http://api.highcharts.com/highcharts#xAxis.plotLines
change data format, with fixed min and max:
xAxis: {
min: 0,
max: 5
},
series:
[{
type: 'column',
data: [4.05,2.81,2.1,1.20,0.37]
},
{
type: 'line',
name: 'Globale Biokapazität',
data: [[-0.5, 1] , [5.5, 1]]
}]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With