2016-01-18 73 views
0

下面是我的Google組合圖表代碼,它工作正常。我還將輸出附加爲圖像。 enter image description here 我的新要求是在第二幅圖像 enter image description hereGoogle柱形圖線點

即我想要的信心線氣泡應該發揮各自的價值觀,現在它只顯示懸停。我已經嘗試過圖表的註釋屬性,但它僅適用於欄柱,我想在上面的行中使用它,即置信線。請回復

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); 

回答

1

您可以添加註釋折線圖...
但我還沒有找到一種方法,將它們添加到一點本身,在圖像中。

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>

+1

感謝您的答覆。註釋實際上並不是我需要的。我的要求恰恰是第二個圖像。 –