score:4
This fiddle answers this: http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/series/color-zones-dashstyle-dot
Highcharts.chart('container', {
title: {
text: 'Zone with dash style'
},
subtitle: {
text: 'Dotted line typically signifies prognosis'
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
},
series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
zoneAxis: 'x',
zones: [{
value: 8
}, {
dashStyle: 'dot'
}]
}]
});
score:0
In case when you need to have i.e dashed or other colour or part serie, you need to have serpated serie for each style / color.
score:4
So the official word is I need to separate the series into actual and forecast. Here's the configuration I'm using in case anyone is interested.
$(function () {
$('#container').highcharts({
chart: {
type: 'line'
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
},
series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4]
}, {
showInLegend: false,
name: 'Series 1',
color: 'rgba(90,155,212,0.5)',
dashStyle: 'Dash',
pointStart: 8,
zIndex: -100,
linkedTo: ':previous',
marker: {
enabled: false
},
data: [216.4, 194.1, 95.6, 54.4]
}]
});
});
Notice that the first point in the forecast is the same value as the last point in the actuals. This makes the lines continuous.
In the options, 'name' is the same name as the original series so that tooltips show it correctly, 'color' is the same as the original series with 50% transparency, 'pointStart' is the index to the starting point (category name will not work here), 'zIndex' tucks the first point under the previous line marker and 'linkedTo' makes the forecast disappear when the actuals are hidden (by clicking the name in legend).
Source: stackoverflow.com
Related Query
- Highcharts: change line options mid-way through a line
- Highcharts how to change x axis options
- Highcharts - best way to handle and display zero (or negative) values in a line chart series with logarithmic Y axis
- Change Y Axis vertical line color in Highcharts
- Highcharts change the line color if its out of the area range
- Highcharts - Change line color between points
- In highcharts how do I change the color of the line above the categories?
- highcharts change rendered image source on click
- How to change space value between grid and yAxis in Highcharts line chart
- Is there a way to change the display value in series using highcharts
- Highcharts change symbol and hover text of individual points Line Chart
- Change line color in area-spline chart in Highcharts
- Highcharts - Can't change line colors
- Highcharts -- how to change line width programmatically and prevent resetting line width?
- Change SVG stroke options in Highcharts
- How to change the line color of a bubble in highcharts dynamically
- How to change colors options in Highcharts programmatically?
- Highcharts change prototype function based on options
- Highcharts series data not persisting through angular route change
- Highcharts change legend options dynamically
- Highcharts - Change value of text box when drilling down through chart
- How to change line color when loading static csv data into Highcharts Highstock graph?
- Highcharts Bubbles - how do I change bubble background and line color?
- change particular line chart series colour dynamically in highcharts
- HighCharts - Don't show line or change line style if date not reached
- How to make the regression line through the origin in highcharts
- Highcharts line style change
- How to change zone line color in highcharts
- alternative way to change hovered series and its points properties in a HighCharts chart
- How to dynamically change line color based on value being lower than previous in highcharts
More Query from same tag
- highchart Sankey chart nodes flow with image for insights
- Changing bar width with pointPadding in Highcharts
- Klipfolio data integration with Highchart Javascript
- Highcharts: displaying datetime like categories
- How can I convince Highcharts to display the right (mine) steps on yaxis?
- How to generate PDF Files based on a HTML+CSS+jQuery page containt
- Highcharts - Area fillOpacity is mixing on multiple area charts
- Display tooltip on hovering over the legend using Highcharts and jQuery-ui tooltip plugin
- Show how many elements every X time with HighCharts
- Remove padding above bar columns
- How do I change the style of the frame lines in a radar(polar) chart created with highcharts?
- how to show legend in PIE chart from chart to pie drilldown highcharts
- Access props and state of current component in React JS within an event handler
- HighCharts reading from CSV basic example
- TypeError: Cannot read property 'nodeName' of null
- Highcharts / HighStock - How to parse JSON correctly
- Highcharts won't draw line when series values are all 0
- Highcharts Chrome 71 leak
- How can I pass my sqlite data to django, and make chart?
- How to distinguish Highcharts background color for if statement
- Highcharts pre-defined x-axis labels
- Negative color with area color fill and yAxis
- Get X Axis value on bar Highchart click event
- How to get id of clicked element in highchart contextmenu
- My Highchart graphs are really slow when I choose 30 day graphs
- change startOnTick after a (High)chart has been created
- Add picture issue when exporting Highcharts to pdf - Highcharts warning: Invalid tagName
- How to pass series to plot options in highcharts
- Loading Javascript Highcharts series data issues
- How we can format the box size of timeline highchart