It is currently Thu Sep 03, 2015 4:28 am 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: 9207
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: 9207
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: 7881
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

Issue while changing series's color Dynamically

Postby tarunchopra91 » Thu Jan 29, 2015 8:08 pm

Hi,
I am facing an issue while changing the series's color dynamically, i.e. the location of series are getting swapped.

Here is a demo of the issue i am facing. http://jsfiddle.net/tarunchopra91/xskfywpo/

Please suggest, if there is any possible reason why this is happening, and any solution to solve this issue.
tarunchopra91
 
Posts: 2
Joined: Thu Jan 29, 2015 7:58 pm

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

Postby KacperMadej » Fri Jan 30, 2015 3:00 pm

This is now a reported bug - https://github.com/highslide-software/h ... ssues/3768

As a workaround you could pass index option in update call.
Example: http://jsfiddle.net/m5drpdfg/1/
Kacper Madej
Highcharts support team
KacperMadej
 
Posts: 2750
Joined: Mon Sep 15, 2014 2:43 pm

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

Postby akundu » Tue Mar 10, 2015 8:37 pm

I want to change color of each column based on some conditions when the user hovers over each column.

Here is the fiddle is created : http://jsfiddle.net/anirbankundu/g5enzjqc/

Here when the user hovers over each column the color changes to '#000000'. I want to have different color for each column based on some condition which can be obtained from the data .

My question is : Can we get the data object of each individual point on hover and then change the color of each column based on some condition. I searched all over but not able to get any solution for the same. Please suggest.

Thanks,
Anirban
akundu
 
Posts: 2
Joined: Tue Feb 10, 2015 9:53 am

Next

Return to Highcharts Usage

Who is online

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