Is any way to pass Options
to google.visualization.events.addListener(chartEditor, 'ok', redrawChart);
to indicate the options I want?
I have the function below. By default when the Chart Editor pulls up, the
default chart which is a Pie Chart as I indicated in the CharType: PieChart
has the colors I passed through the options: 'colors': ['#094FA4',
'#006EC1', '#009EE5', '#52BCEC', '#89D1F3','#B5E5F9']
However, If I select a different type of chart the colors for the chart
change to the Default one and I was wondering If I can pass the colors to
google.visualization.events.addListener(chartEditor, 'ok', redrawChart);
so no matter what Chart I pick, it will have the same colors.
Thank you very much
function loadEditor(querySelector) {
// Create the chart to edit.
var wrapper = new google.visualization.ChartWrapper({
//Set up the default Chart Selected
'chartType':'PieChart',
'dataSourceUrl':dataSourceUrl + magicIncantation,
'query':querySelector,
'options': {'title':'Title of Pie Chart', 'legend':'none',
'colors': ['#094FA4', '#006EC1', '#009EE5', '#52BCEC', '#89D1F3','#B5E5F9']}
});
chartEditor = new google.visualization.ChartEditor();
google.visualization.events.addListener(chartEditor, 'ok',
redrawChart);
chartEditor.openDialog(wrapper, {});
}
// On "OK" save the chart to a <div> on the page.
function redrawChart(){
chartEditor.getChartWrapper().draw(document.getElementById('Piechart_div'));
}
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-visualization-api/674f62f0-9033-4be5-ad1c-f206fcdf21e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.