0

基本的なGoogleチャートがあります:-

function drawVisualization() {
  // Create and populate the data table.
  var data = google.visualization.arrayToDataTable([
    ['Year', 'Austria', 'Belgium', 'Czech Republic'],
    ['2006',  1600652,   4604684,       940478],
    ['2007',  1968113,   4013653,       1037079],
    ['2008',  1901067,   6792087,       1037327]
  ]);

// Create and draw the visualization.
      new google.visualization.ColumnChart(document.getElementById('visualization')).
          draw(data,
           {title:"Yearly Coffee Consumption by Country",
            width:600, height:400,
            hAxis: {title: "Year"}}
      );
}

境界線の色や幅などを指定できるようにしたいのですが、API コマンドの使い方を教えてください:- backgroundColor.stroke, backgroundColor.strokeWidth,

つまり、これらの API 呼び出しを追加するにはどうすればよいですか。

ありがとう

4

1 に答える 1

1

:のタイトルを指定したのと同じように、stroke色とstrokeWidth残りのオプションの両方の設定を送信できます。hAxis

backgroundColor: {
    stroke: '#000',
    strokeWidth: '2'
}

これにより、チャートに2ピクセルの黒い境界線が表示され、 jsfiddleでデモが行われます。

于 2012-06-20T15:30:20.007 に答える