0

我正在尝试从谷歌 api 获取类似于下面的雷达图。除了平均分布的 0,0.5,1,1.5,2,2.5,3 之外,我可以获得所有内容

采样雷达

在我的图表中,目前它从给定的数据和最大值中取出最小值,并在 .its 之间进行除法,所以如果 6 是我的最大值,最小值是 3。在圆的中心它是 3,然后下一个 cud 是 3.4,最后一个极端边缘是 6。我应该在下面的代码中进行什么更改。以获得均匀分布(比如 0 到 6)。

         function drawVisualization() {
      var options = {};
      // Chart API chart type 'rs' is radar chart
      options.cht = 'r';
      // set the line colors
      options.colors = ['#00FF00'];

      // fill the area under the lines
      //options.fill = true;

      // create a grid for the chart
     // options.chg = '25.0,25.0,4.0,4.0';
      //  options.chxl: '0:|1|2|3|4|5|6';
var arr = [["165q",1.3333333333333],["160q",6],["161q",6.6666666666667],["162q",7],["163q",8],["164q",5]];
      //var pi = '\u03C0';

      dataTable = google.visualization.arrayToDataTable(arr, true);
      // Treat first row as data as well.

      var chart = new google.visualization.ImageChart(document.getElementById('visualization'));
      chart.draw(dataTable, options);
}
</script>
4

1 回答 1

0

尝试将axis-range: chxr参数与参数一起使用custom axis labels: chxl

https://developers.google.com/chart/image/docs/chart_params#axis_range

https://developers.google.com/chart/image/docs/chart_params#axis_labels

于 2012-10-26T06:59:10.147 回答