score:19
You need to add in a point to you chart but disable the marker. I added a new series with scatter plot type and its value equal to the goal value:
{
name: 'Goal',
type: 'scatter',
marker: {
enabled: false
},
data: [450]
}
See updated jsFiddle: http://jsfiddle.net/wergeld/4R5HH/4/
score:0
You could simply set the max attribute to the max value you will have:
yAxis: {
max:650 //HERE
plotLines...
},
score:2
In some cases, wergeld's solution would be preferable than jank's solution, especially when you are not sure about min
and minRange
. But wergeld's solution has a minor issue. If you point your mouse over the plot line, it will show a point and tooltip on the point. To avoid this, I have modified his solution and added enableMouseTracking
to get rid of the problem.
{
name: 'Goal',
type: 'scatter',
marker: {
enabled: false
},
data: [450],
enableMouseTracking: false
}
See updated jsFiddle: http://jsfiddle.net/4R5HH/570/
score:32
One other option that does not introduce data points:
yAxis: {
minRange:450,
min:0,
plotLines:[{
value:450,
color: '#ff0000',
width:2,
zIndex:4,
label:{text:'goal'}
}]
},
This sets the minimum for the yAxis to 0 (this is unlikely to be false in this case) and the minimum Range to 450.
See updated fiddle.
Source: stackoverflow.com
Related Query
- How to always show the plotLine in HighCharts?
- How do I hide a Highcharts series from the chart, but always show it in the tooltip?
- How to show always the pop-up at the point in a cloud graph?
- how to display 2 same highcharts without duplicate the code
- How can I limit the length of a HighCharts PlotLine on the Y-Axis for a BoxPlot?
- How to show the legend in HighCharts
- How to configure highcharts so that all the curves are always displayed / highlighted?
- Highcharts - How to force dataLabels to show labels when overlapping the content
- Highstocks: "columnrange" columns are always evenly spaced. How do I make highstocks show any gaps in the data?
- How can i load external json data in highcharts to show the bar chart
- How to show only the last 100 candlesticks or hide the first 50 candlesticks in Highcharts Stock Chart?
- Stacked Bar Highcharts how to show the values
- How to show circular progress pie chart using the highcharts
- How can I get highcharts barChart bars to always fill the container?
- How to show multiple HighCharts charts in the same page?
- How to modify the code so that Highcharts graph does not cover fixed navigation bar at the top of the page?
- How to make a rendered label in Highcharts always visible and still relative to the point clicked or hovered over
- How to make highcharts tooltip show outside of the pie graph?
- how to show the little circle in tooltip of highcharts
- How to show the path that I have traversed in highcharts drilldown chart?
- how can I use rangeselector and navigation in highcharts in the given code
- HIGHCHARTS - Given a series with UNIX stamps and values pairs for the data, how do I show only the date for the first and last point on xAxis?
- Highcharts Heatmap yAxis with 2 categories. How to show both of them in the tooltip?
- How to let x axis title still show on the bottom when setting fontsize attribute in Highcharts
- HighCharts - how to show the lineborder in Area Charts
- How to get highcharts dates in the x axis?
- HighCharts - How can I turn off the points?
- How do you change the colour of each category within a highcharts column chart?
- How can I change the colors of my highcharts piechart?
- How to display the value instead of percentage in a pie chart using jquery Highcharts
More Query from same tag
- String with multiple whitespaces on javascript
- Highchart - xAxis weekly date can start any day?
- In Highcharts, how do I get consistent coordinates for points in IE,Chrome and Fixefox
- Gantt Chart Variation with Chart JS or other libraries
- Highstock error Invalid date
- calculate the difference between 2 series in tooltip for highstock
- ionic 2 Uncaught (in promise): Error: Highcharts error #17: www.highcharts.com/errors/17
- How to make Javascript output brackets for an Array of Arrays. (For Highcharts)
- Highcharts switching off animation for column chart
- One month forward in my xAxis
- How to extract the data from highstock chart
- Always show "0" value in Stacked Column Chart
- Highchart and "almost regular" time interval data
- How to add icon/svg/image on X-axis for bar graph onclick event using highcharts?
- re-rendering EJS file after an ajax request
- Is there a way to make highcharts tick lines point inwards rather than outwards
- Getting javascript undefined TypeError
- R Highcharter: Highlight/unhighlight a bar in a bar chart by clicking
- Highcharts: Align two Y-Axis with different values
- Getting JSON from Google for Highmaps
- If Array is Empty PHP - Highcharts
- tooltip text is out of block in Chrome
- Highchart - Show/hide datalabel on click
- HighCharts navigator: how to disable the expand width icon on hover
- Highcharts Maps - Displaying data on Highmaps
- Highcharts xAxis formatter export to csv
- Highcharts pie slice linear gradient
- Jquery Highcharts is not loading when using with common function?
- Highcharts: how to use setData to add series
- Motion Bubble Chart