You need to sign in to do that
Don't have an account?
Charts on Visualforce
I have created a visualforce page with two charts on the same page. What I would like to do is be able to use the "var options" on each chart. The representation options would be different for each. I would like to have a different green area. for each. I have also included my code here as well to try to figure this out.

var data = google.visualization.arrayToDataTable([
['Label', 'Value'],
['Open Rate', {!campaign.Avg_Open_Rate__c}],
['Click Rate', {!campaign.Avg_Click_Rate__c}],
]);
var options = {
width: 400, height: 300,
greenFrom: -6, greenTo: 6,
min: -50,
max: 50,
majorTicks: [-40, -30, -20, -10, 0, 10, 20, 30, 40]
};
var chart = new google.visualization.Gauge(document.getElementById('chart_div'));
chart.draw(data, options);
setInterval(function() {
data.setValue({!campaign.Avg_Open_Rate__c});
chart.draw(data, options);
}, 13000);
var data = google.visualization.arrayToDataTable([
['Label', 'Value'],
['Open Rate', {!campaign.Avg_Open_Rate__c}],
['Click Rate', {!campaign.Avg_Click_Rate__c}],
]);
var options = {
width: 400, height: 300,
greenFrom: -6, greenTo: 6,
min: -50,
max: 50,
majorTicks: [-40, -30, -20, -10, 0, 10, 20, 30, 40]
};
var chart = new google.visualization.Gauge(document.getElementById('chart_div'));
chart.draw(data, options);
setInterval(function() {
data.setValue({!campaign.Avg_Open_Rate__c});
chart.draw(data, options);
}, 13000);
You can try creating two chart instances for each chart displayed. Try the below code to create two instances for the chart.
Have a look to it, and let me know if this works.
Regards
Rahul