两侧的Chart.js Y轴标签

时间:2015-10-13 07:53:08

标签: javascript charts

我目前正在使用Chart.js在一些非常大的显示器上,并在图表左侧读取数据,即使启用了网格线也很难找到值。 有没有办法在图形pre v2.0的两侧启用Y轴标签? 我的图表配置是在树枝模板中生成的,如下所示:

var LineData = {
 labels: [
  {% for label in labels %}
  " {{ label }} ",
  {% endfor %}
 ],
 datasets: [
  {
    fillColor: "rgba(220,220,220,0.5)",
    strokeColor: "rgba(220,220,220,1)",
    pointColor: "rgba(220,220,220,1)",
    pointStrokeColor: "#fff",

    data: [
      {% for data in dataset1 %}
      "{{ data }}",
      {% endfor %}
    ]
  }, {
    fillColor: "rgba(151,187,205,0.5)",
    strokeColor: "rgba(151,187,205,1)",
    pointColor: "rgba(151,187,205,1)",
    pointStrokeColor: "#fff",

    data: [
      {% for data in dataset2 %}
      "{{ data }}",
      {% endfor %}
    ]
  }
 ]

}
var options = {
 scaleFontColor: "#FFF",
 //String - Colour of the grid lines
 scaleGridLineColor: "rgba(155,155,155,0.3)",
 scaleOverride: true,
 scaleStepWidth: 10,
 scaleSteps: 25,
 scaleStartValue: 0,
 //Number - Width of the grid lines
 scaleGridLineWidth: 5
};

0 个答案:

没有答案