Sign in to follow this  
Nivedita

paletteColors of Chart Object do not work dynamically

Recommended Posts

I am trying to set the paletteColors property dynamically on Radar chart.

 

<div id ="chart-container" style="clear:both;">FusionCharts should load here..</div>

 

var char = {};

var jSonObj = {};

 

$(document).ready(function() {

 

     chart.paletteColors = "#008ee4,#6baa01";

 

     jsonObj.chart = chart;

 

     myChart.setChartData(jsonObj, "json");

 

}

 

FusionCharts.ready(function (FusionCharts) {
 
     myChart = new FusionCharts ({
     type: 'radar',
     renderAt: 'chart-container',
     width: '650',
     height: '450',
  }
);
   myChart.render('chart-container');
 });
});
 
It's not working. Need a help here. Thanks.

 

Share this post


Link to post
Share on other sites

It's taking only first or second colour and not both. When I click on the legends as well; it doesn't highlight the area as there is a colour mismatch,

 

I tried using setChartAttribute as well but it still won't work.

Share this post


Link to post
Share on other sites

Hi,

 

It is possible to dynamically change the palette colors in Radar chart.

 

As per your code snippet, you are trying to change the palette colors during the chart loading.

 

To dynamically change the attribute, try adding a radio-button or checkbox to see the change properly.

 

If you can provide me the proper code snippet I can help you out more.

 

And using the setChartAttribute you can change the palette colors of the chart.

 

Check out this sample JSFiddle link : http://jsfiddle.net/vishalika/8tyfdqfa/

 

Hope this helps.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this