I am sure there is a simple solution to this but I can't seem to get it working.
I need to change the series data for my chart开发者_开发问答:
This works (in my function):
var data = [$.gchart.series('title1', [50], '#F5B800'),
$.gchart.series('title2', [40], 'red')];
$('#chart').gchart('change', {series: data});
but I would like to set the series values dynamically from a passed value:
(ex)
value1 = '[70]';
var data = [$.gchart.series('title1', value1, '#F5B800'),
$.gchart.series('title2', [40], 'red')];
$('#chart').gchart('change', {series: data});
This causes a js error and the chart does not render.
I've tried a number of combinations without any success.
Any ideas?
Try:
value1 = "70";
var data = [$.gchart.series('title1', (value1), '#F5B800'),
$.gchart.series('title2', [40], 'red')];
$('#chart').gchart('change', {series: data});
精彩评论