score:2
Unfortunately it is not supported. The issue is that the line is drawn as a single path and can only have one color per path (except a gradient).
A few attempts resulted in changing color of individual points Fiddle1 and another based upon a threshold apply a gradient to the stroke of the path
function applyGraphGradient() {
// Options
var threshold = 19,
colorAbove = '#F00',
colorBelow = '#000';
// internal
var series = this.series[0],
i,
point;
if (this.renderer.box.tagName === 'svg') {
var translatedThreshold = series.yAxis.translate(threshold),
y1 = Math.round(series.yAxis.len - translatedThreshold),
y2 = y1 + 2; // 0.01 would be fine, but IE9 requires 2
// Apply gradient to the path
series.graph.attr({
stroke: {
linearGradient: [0, y1, 0, y2],
stops: [
[0, colorAbove],
[1, colorBelow]
]
}
});
}
// Apply colors to the markers
for (i = 0; i < series.data.length; i++) {
point = series.data[i];
point.color = point.y < threshold ? colorBelow : colorAbove;
if (point.graphic) {
point.graphic.attr({
fill: point.color
});
}
}
// prevent the old color from coming back after hover
delete series.pointAttr.hover.fill;
delete series.pointAttr[''].fill;
}
fiddle2, kudos to this question
One other possible solution is to programmatically split your data into 2 series one that is in range and one that is not. by colouring the not as red it may appear to be one line
var inRange = Array();
var outRange = Array();
for(var i = 0; i < values.length; i++) {
var range = limits[i];
var value = values[i];
if(value[1] > range[1] && value[1] < range[2]) {
inRange.push(value);
outRange.push([value[0],null]);
}
else {
outRange.push(value);
inRange.push([value[0],null]);
}
}
Example, although as you can see they don't join together
UPDATE
Managed to make it appear correctly
var inRange = Array();
var outRange = Array();
var prev = 0; //1 = was valid, 2 = werent
for(var i = 0; i < values.length; i++) {
var range = limits[i];
var value = values[i];
if(value[1] > range[1] && value[1] < range[2]) {
inRange.push(value);
if(prev == 2) {
outRange.push(value);
}
else {
outRange.push([value[0],null]);
}
prev = 1;
}
else {
outRange.push(value);
inRange.push([value[0],null]);
if(prev == 1) {
outRange[i-1][5] = values[i-1][6];
}
prev = 2;
}
console.log(prev);
}
Source: stackoverflow.com
Related Query
- Html5 line chart with a different color when out of area range
- High chart area range graph with different border color
- Highchart Area Range chart with gradient that follows the line
- Highcharts change the line color if its out of the area range
- Highcharts with range out of bound value highlight with different color
- Highlight a line with different color in Parallel coordinate chart with Highcharts
- Highcharts to display area range and line chart with data from a CSV file
- combining an area chart with a line chart in highcharts.js
- Highcharts column chart color by single color but with different brightness level as per respective column value
- Highcharts line chart all points disappear when have more than one points with same X Axis
- How to change color of bar in column chart with different level of percentage in highcharts
- Multiple different chart types stacked, column type with y value as color
- Sync an html5 video with an highchart.js line chart
- Cannot read property 'cum' of undefined -- when creating a stacked area chart with xAxis.type=datetime
- highchart's line chart with constant series not plotting when using linear gradient colour
- Highchart Combination Chart Area Range not displaying on chart but line chart works
- Highcharts Line Chart with multicolor area
- Highchart how to create lollipop type chart with circle and line top/bottom at different positions
- Highcharts cloud issue with data source when duplicating chart
- Highcharts - Add Point to chart with different color based on some condition dynamically
- How to create area range with line highchart
- column chart color range for negative numbers and different color range for positive
- pointInterval not working with date range within line chart
- How to color places with single dots in area chart - highcharts?
- HIGHCHARTS: Filling area above line with color area representing contribution to line values
- On common x-axis how to draw a chart with different unit of dataset array (multi line chart)
- Highcharts showing points on hovering over the line which are outside the chart area when the chart is zoomed in
- JavaScript line and area chart with similar interface as shown
- Highcharts => Getting the id of a point when clicking on a line chart
- Highcharts area fillOpacity do not work when changing the color
More Query from same tag
- How to hide only the columns of this group when hovering over a group column in highcharts?
- How do I add dynamic labels in highcharts while using motion plugin?
- Show stackLabels at both top and bottom in highchart
- Vaadin Charts (Highcharts) - Range Selector - Monthly Data
- How disable the 'k' dislay in Highcharts ordinate?
- Highchart, Combined Two Chart in One with different data from Meteor Collection
- Multiple y-axes causing range to have too much padding
- Converting svg from Highcharts data into data points
- Reducing spacing in between columns in highcharts
- Handling null value when casting to float
- How to change the font properties in a pie highchart?
- How to fix values from an array on the y-axis in Highcharts
- Show Fraction values in highchart
- Plotbands in Highcharter - When x axis is date
- Highchart Polar chart - 4 nested circle with different series
- highcharts on IE9
- How to set column colors, title colors , font size , font family in external css file for highcharts?
- Creating array from javascript object
- Highcharts : cross symbol with fillColor
- Capturing touch events (touchstart and touchmove) in addition to mousemove for synchronising highcharts
- handle click event in bar chart
- highcharts xAxis pointStart issue
- chart does not plot line(s) from google sheet data
- display legends for Grouped-Stacked column charts- highhcarts
- HighCharts legend.value and legend.percent items to 2 decimal points Math.Round()
- Issues Rendering Highcharts - Populating through PHP/MySQL
- Table appearing in front of my dropdown menu
- Highcharts pie with a single value in %
- One month forward in my xAxis
- Highcharts not displaying data at some zoom levels