我如何将 Google-o-Meter 或 Google Vizualization API 与 Jenkins 一起使用
这是一个显示静态图表的示例:
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 的名称/值
Here is a sample that displays a static chart:
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);
}
How can i replace the static values and variables in dataTable.addRows([ with real live data ?
In case the compete code is not visible, refer to :
http://code.google.com/apis/visualization/documentation/gallery/genericimagechart.html
When this Javascript is copied to the "Description" it renders a chart, what i want to know is how to replace the name/value in dataTable.addRows, to the name/values coming from Jenkins
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论