我如何将 Google-o-Meter 或 Google Vizualization API 与 Jenkins 一起使用

发布于 2024-10-22 05:51:10 字数 1419 浏览 0 评论 0原文

这是一个显示静态图表的示例:



  
    
    
    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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文