It is currently Sat Oct 25, 2014 7:30 pm Advanced search

[2.0.1]How to change series's color Dynamically

Technical support, bug reports and more.

[2.0.1]How to change series's color Dynamically

Postby wocake » Thu Jul 29, 2010 3:59 am

in [2.0.1] How to change series's color Dynamically,When i set the series step= true,
I use
chart.series[0].color = newcolor;
chart.series[0].redraw;
but it don't work,and how can I change the line's shadow color,I set the shadow color Dynamically and redow the chart but it don't work ,but in 1.6 it works .
wocake
 
Posts: 18
Joined: Mon Jun 28, 2010 5:00 am

Re: [2.0.1]How to change series's color Dynamically

Postby not » Thu Jul 29, 2010 3:46 pm

Unfortunately you have to reload whole affected series. It was explained well here: viewtopic.php?f=9&t=7011
Maciej Piecha,
ex Highcharts Support Team
User avatar
not
 
Posts: 340
Joined: Mon Jun 07, 2010 4:01 pm

Re: [2.0.1]How to change series's color Dynamically

Postby fongg » Thu Jul 29, 2010 4:00 pm

Is there any plan to add the series.update() method (like the points.update) to the series any time soon?

Thanks.
fongg
 
Posts: 27
Joined: Tue Jul 20, 2010 10:51 pm

Re: [2.0.1]How to change series's color Dynamically

Postby not » Fri Jul 30, 2010 9:32 am

Only Torstein can give you answer for this question and he will be available on Monday or Tuseday .
Maciej Piecha,
ex Highcharts Support Team
User avatar
not
 
Posts: 340
Joined: Mon Jun 07, 2010 4:01 pm

Re: [2.0.1]How to change series's color Dynamically

Postby torstein.honsi » Mon Aug 02, 2010 12:55 pm

There is a slighly less expensive solution at http://jsfiddle.net/CAKQH/825/.

A series.update method is planned, but it is somewhat complicated as all config options have to be handled separately.
Torstein Hønsi
CTO, Founder
Highsoft Solutions
User avatar
torstein.honsi
Site Admin
 
Posts: 9200
Joined: Thu Nov 09, 2006 1:22 pm
Location: Vik i Sogn, Norway

Re: [2.0.1]How to change series's color Dynamically

Postby fongg » Mon Aug 02, 2010 4:40 pm

Thanks. This redraw is much faster. Is there a fast way to refresh the legend too?
fongg
 
Posts: 27
Joined: Tue Jul 20, 2010 10:51 pm

Re: [2.0.1]How to change series's color Dynamically

Postby torstein.honsi » Tue Aug 03, 2010 6:20 pm

Yes, with another line added: http://jsfiddle.net/G5Pk7/
Torstein Hønsi
CTO, Founder
Highsoft Solutions
User avatar
torstein.honsi
Site Admin
 
Posts: 9200
Joined: Thu Nov 09, 2006 1:22 pm
Location: Vik i Sogn, Norway

Re: [2.0.1]How to change series's color Dynamically

Postby wocake » Fri Aug 06, 2010 10:58 am

point.graphic.attr({
fill: '#FF00FF'
});
? Is this the Heighcharts2.0.1? I use point.graphic but the point don't have graphic prototype
wocake
 
Posts: 18
Joined: Mon Jun 28, 2010 5:00 am

Re: [2.0.1]How to change series's color Dynamically

Postby not » Sun Aug 08, 2010 5:25 pm

I use 2.0.1 and something like this below works perfectly:

Code: Select all
chart.series[0].data[0].graphic.attr({
    fill: '#FF00FF'
});
Maciej Piecha,
ex Highcharts Support Team
User avatar
not
 
Posts: 340
Joined: Mon Jun 07, 2010 4:01 pm

Re: [2.0.1]How to change series's color Dynamically

Postby Akatsukle » Thu Jul 17, 2014 1:26 pm

I know it's been a while since the last message, but I've got a related problem.
Tough the fiddle doesn't work anymore, I've tried the provided code and it works well with line charts.
However, it doesn't work completely with bar charts. When you hover the mouse on the data, it display the older colour.

Here's a fiddle : http://jsfiddle.net/pAUuD/

If anyone has an idea on how to fix it.
Akatsukle
 
Posts: 5
Joined: Thu Jul 17, 2014 1:10 pm

Re: [2.0.1]How to change series's color Dynamically

Postby Fusher » Thu Jul 17, 2014 4:12 pm

Since Highcharts 3.x you have series.update() method, which allow you to change any option you want in run time. For example colors: http://jsfiddle.net/pAUuD/1/
Paweł Fus
Highcharts support team
Fusher
 
Posts: 7388
Joined: Mon Jan 30, 2012 12:16 pm

Re: [2.0.1]How to change series's color Dynamically

Postby Akatsukle » Fri Jul 18, 2014 8:19 am

Thanks a lot, works perfectly :)
Akatsukle
 
Posts: 5
Joined: Thu Jul 17, 2014 1:10 pm


Return to Highcharts Usage

Who is online

Users browsing this forum: Google [Bot] and 8 guests