以下是显示静态图表的示例:
google.load("visualization", "1.0", {packages:["imagechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var dataTable = new google.visualization.DataTable();
dataTable.addColumn('string');
dataTable.addColumn('number');
dataTable.addColumn('string');
// Row data is [chl, data point, point label]
dataTable.addRows([
['January',40,undefined],
['February',60,'Initial recall'],
['March',60,'Product withdrawn'],
['April',45,undefined],
['May',47,'Relaunch'],
['June',75,undefined],
['July',70,undefined],
['August',72,undefined]
]);
var options = {cht: 'lc', chds:'0,160', annotationColumns:[{column:2, size:12, type:'flag', priority:'high'},]};
var chart = new google.visualization.ImageChart(document.getElementById('line_div'));
chart.draw(dataTable, options);
}
如何替换dataTable.addRows中的静态值和变量([与真实数据一起?
如果竞争代码不可见,请参阅: http://code.google.com/apis/visualization/documentation/gallery/genericimagechart.html
当这个Javascript被复制到“描述”时它会呈现一个图表,我想知道的是如何将dataTable.addRows中的名称/值替换为来自Jenkins的名称/值