score:8
The following thread on the highcharts forum has a solution:
http://highslide.com/forum/viewtopic.php?f=9&t=7075&p=33437 with a fiddle http://jsfiddle.net/G5Pk7/ that illustrates it.
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container'
},
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]
}]
});
$('#button').click(function() {
var series = chart.series[0];
series.color = "#FF00FF";
series.graph.attr({
stroke: '#FF00FF'
});
chart.legend.colorizeItem(series, series.visible);
$.each(series.data, function(i, point) {
point.graphic.attr({
fill: '#FF00FF'
});
});
series.redraw();
});
This is clearly a dirty solution, but seems to work.
score:5
Did you even look at the console?
ReferenceError: series is not defined
http://fiddle.jshell.net/J56hm/1/show/
Line 39
Changing into to following solved the issue
$.each(chart.series[0].data, function(i, point) {
...
}
But now the opposite happens, when you hover over the points it goes blue again
You are trying to directly manipulate the svg that is rendered by highcharts by setting color attributes. This isn't the correct way, as highchart may redraw the chart based on its rendering algorithm and all your changes may be lost.
After having said all that, I still don't know any supported method in highcharts to do this, will update the answer if I come up with something
score:40
it's simple, you can use this code
chart.series[0].options.color = "#008800";
chart.series[0].update(chart.series[0].options);
Source: stackoverflow.com
Related Query
- Changing series color in highcharts dynamically
- Changing data dynamically for a series in Highcharts
- Changing Highcharts data series type dynamically
- Changing the color of the point dynamically in highcharts
- highcharts change series color when data is dynamically inserted
- Changing Series Name and Color in Highcharts
- Highcharts getjson and changing series type dynamically
- Dynamically changing Highcharts Theme through Jquery code not working
- Highcharts area fillOpacity do not work when changing the color
- Highcharts dynamically change bar color based on value
- Change Highcharts Series color
- Adding a series dynamically with HighCharts Stock Charts
- Highcharts add series dynamically
- Changing color of spline lines based on values in HighCharts
- Highcharts Dynamically Changing Labels?
- Issue Dynamically Changing HighCharts Chart Title
- Highcharts - get visible series name dynamically
- Highcharts : Showing wrong color in data series
- Changing data in HighCharts series causes y-axis to blow up
- Dynamically add data to series in Highcharts
- Highcharts hide series without change legend color
- Setting Highcharts Series and Category data dynamically
- Dynamically load in series HighCharts
- Highcharts sankey diagram, series color
- highcharts - changing color of area depending on y-value
- How to color series legend in highcharts when colorbypoint is set to true
- HighCharts - Dynamically Change Axis Title Color
- Highcharts solidgauge legend symbol not taking series color
- Highcharts area range series change plotting area dynamically
- Change color of series onclick events across multiple highcharts
More Query from same tag
- HighChartTable.js yAxis integer Only
- HIghcharts Treemap Groupby leaf objects at Level 1(Parent) and group by child at Level1(Sub objects)with custom color coding
- Negative values in the data not showing in highcharts linechart
- trouble with highchart and .clone()
- How to show plot lines in the legend in Highcharts?
- Highcharts is rounding off the decimal values to 0. How to avoid it?
- Predictive time modeling for chart
- Highcharts - Treemap synchronisation onclick
- x-axis tickInterval not working correctly in highstock chart
- Error: Data source must be a URL for refresh | console error | javascript | Highcharts
- Highcharts - How to draw an arrow for a specific value in a polar (wind rose) chart?
- HighCharts, Json Format
- Highcharts (Highstocks) - clickable flag images
- highcharts xaxis datetime label with minor tick
- How to position labels for plotbands on y axis in Highcharts
- heroku does not load jquery on https
- How refresh title highchart
- how to import highcharts offline-exporting in typescript
- Is it possible to use jQuery in wicked_pdf to render charts?
- How to change the color of series(grouped column chart) only with json object(without js function) on Highchart?
- Highchart Y-Axis Scale Values Missing
- How to parse the data from CSV FILE to arrays so it could be used for a pre-formatted Highchart
- Configure highstock using manifest bower.json file - AngularJS
- How to center the y-axis label horizontally in Highcharts?
- GWT:creat a simple meteogram in GWTHighCharts
- Highcharts : using JSON data as label to xaxis
- Highcharts JSON load issue
- How to call a plugin in CakePHP 2.x Shell?
- chart not showing when executed in c#
- Returning JSON file with cURL to use data in a HighCharts stock chart