2017-09-22 8 views
1

Google Pieチャートでは、凡例のインジケータの色を変更して次の結果に移動したいと考えています。これは今青色で、私はそれを変更するように見えることはできませんが、私はパイのスライス(完了)またはテキスト(必要ではない)の色を変更することはできます。スクリーンショット:Google pie chartです。Google Pie Chartsの次のページインジケータの色を変更する

var options1 = { 
      legend: 'none', 
      pieSliceText: 'label', 
      width: '85%', 
      height: '85%', 
      chartArea: {'width': '80%', 'height': '80%'}, 
      legend: {'position': 'bottom'}, 
      backgroundColor: {fill:'transparent'}, 
      pieSliceBorderColor: 'transparent', 
      colors: ['#41ac89', '#2b9b38', '#b3b300', '#D9C022', '#bab673'] 
     }; 

答えて

0

次のオプションを使用することができます...

テキスト:legend.pagingTextStyle
矢印:legend.scrollArrows

例えばここ コードです

legend: { 
    position: 'bottom', 

    // style paging text and arrows 
    pagingTextStyle: { 
    color: '#616161' 
    }, 
    scrollArrows:{ 
    activeColor: '#616161', 
    inactiveColor:'#e0e0e0' 
    } 
}, 

google.charts.load('current', { 
 
    packages: ['corechart'] 
 
}).then(function() { 
 
    var data = google.visualization.arrayToDataTable([ 
 
    ['', 'Views'], 
 
    ['dat', 40], 
 
    ['nom', 10], 
 
    ['gen', 10], 
 
    ['hid1', 2], 
 
    ['hid2', 3] 
 
    ]); 
 

 
    var options = { 
 
    legend: 'none', 
 
    pieSliceText: 'label', 
 
    width: 200, 
 
    height: 200, 
 
    chartArea: {'width': '80%', 'height': '80%'}, 
 
    legend: { 
 
     position: 'bottom', 
 

 
     // style paging text and arrows 
 
     pagingTextStyle: { 
 
     color: '#616161' 
 
     }, 
 
     scrollArrows:{ 
 
     activeColor: '#616161', 
 
     inactiveColor:'#e0e0e0' 
 
     } 
 
    }, 
 
    backgroundColor: {fill: 'transparent'}, 
 
    pieSliceBorderColor: 'transparent', 
 
    colors: ['#41ac89', '#2b9b38', '#b3b300', '#D9C022', '#bab673'] 
 
    }; 
 

 
    var chart = new google.visualization.PieChart(document.getElementById('chart_div')); 
 
    chart.draw(data, options); 
 
});
<script src="https://www.gstatic.com/charts/loader.js"></script> 
 
<div id="chart_div"></div>

+0

は完璧に動作...次の作業スニペットを参照してください、ありがとう! – MarkD

+0

ありがとう、私はそれを知らなかった。将来を覚えています! – MarkD

関連する問題