在其文档中,它说:
toJSON()|字符串|返回JSON表示的字符串版本 图表。
假设我创建了一个DataTable,它存储在数据中:
var data = new google.visualization.DataTable();
如何以与显示图表相同的方式显示它?
使用以下行显示图表:
new google.visualization.ColumnChart(document.getElementById('visualization')).
draw(data,
{title:"S&P 500 Up/Down Performance Since 1980",
width:600, height:400,
isStacked:"true",
bar:{groupWidth: "90%"},
legend:"none" }
);
我想显示data.toJson()而不是数据。
任何帮助或指示都将不胜感激。感谢。
答案 0 :(得分:0)
试试这个:
new google.visualization.ColumnChart(document.getElementById('visualization')).
draw(data.toJson(),
{title:"S&P 500 Up/Down Performance Since 1980",
width:600, height:400,
isStacked:"true",
bar:{groupWidth: "90%"},
legend:"none" }
);
您的遗失未在toJson()
ColumnChart