繁体   English   中英

Google柱形图折线点

[英]Google Column chart line points

以下是我的Google Combo Chart代码,它可以正常工作。 我也将输出附加为图像。 在此处输入图片说明 我的新要求在第二张图片中 在此处输入图片说明

即我希望置信线气泡应显示其各自的值,现在仅在悬停时显示。 我已经尝试过Chart的注释属性,但它仅适用于条形柱,我想在上一行即Confidence行中使用它。 请回复

var data3 = google.visualization.arrayToDataTable([['Staff','Understanding','Confidence','Hurdle'],
['Customer Planning',40,95,80],
['Passionate Selling',63,93,80],
['Negotiating Revenue & Profit Growth',60,92,80],
['Category & Shopper Execution',60,90,80],
['Value Chain Integration',76,98,80]]);

     var options = {title:"Staff Details",
              width:'100%', height:600,seriesType: "bars",series:{1: {type: "line",pointSize: 6},2: {type: "line",pointSize: 6}},
              vAxis: {title: "", 'minValue': 0, 'maxValue': 100},
              colors: ['#259edd', '#ffc000', '#ff0000'],
              hAxis: {title: "Competency",'minValue': 0, 'maxValue': 100, slantedText: true, slantedTextAngle:60 },
              chartArea: {height: '60%',top:10}
      };        

    var chart           =   new google.visualization.ComboChart(bar_chart_div);
    chart.draw(data3, options);

您可以向折线图添加注释...
但是我还没有找到一种将它们添加到该点本身的方法,如图中所示。

 google.load('visualization', '1.0', {'packages':['corechart']}); google.setOnLoadCallback(drawDashboard); function drawDashboard() { var data = google.visualization.arrayToDataTable([ ['Name', 'Donuts eaten'], ['Michael' , 5], ['Elisa', 7], ['Robert', 3], ['John', 2], ['Jessica', 6], ['Aaron', 1], ['Margareth', 8] ]); var options = { title: 'Company Performance', curveType: 'function', legend: { position: 'bottom' }, pointSize: 10 }; var view = new google.visualization.DataView(data); view.setColumns([0, 1, { calc: "stringify", sourceColumn: 1, type: "string", role: "annotation" }]); var chart = new google.visualization.LineChart(document.getElementById('chart')); chart.draw(view, options); } 
 <script src="https://www.google.com/jsapi"></script> <div id="chart"></div> 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM