1

是否可以在敏锐的仪表板图表的 Y 轴上设置最大值和最小值?

我从这个 github repo 下载了仪表板:

https://github.com/keen/dashboards

我有一个像下面这样的垂直柱形图,我想将 y 轴上的最小值设置为 70,最大值设置为 90,我该怎么做?

  <div class="col-sm-8">
    <div class="chart-wrapper">
      <div class="chart-title">
        Alex Weight (kg)
      </div>
      <div class="chart-stage">
        <div id="chart-01"></div>
      </div>
      <div class="chart-notes">   
      </div>
    </div>
  </div>


var query = new Keen.Query("maximum", {
    eventCollection: "weight",
    interval: "daily",
    targetProperty: "value",
    timeframe: "this_14_days",
    timezone: "Australia/Sydney"
});

client.draw(
query, document.getElementById("chart-01"), {
    height: 150,
width: '100%',
chartType: 'columnchart',

hAxis: {
    format:'d MMM'
}
}
);
4

1 回答 1

1

我一问这个问题,我就明白了……只需在下面添加 vAxis 值:

var query = new Keen.Query("maximum", {
eventCollection: "weight",
interval: "daily",
targetProperty: "value",
timeframe: "this_14_days",
timezone: "Australia/Sydney"
});

client.draw(
query, document.getElementById("chart-01"), {
height: 150,
width: '100%',
chartType: 'columnchart',

hAxis: {
    format:'d MMM'
},
vAxis: { 
    minValue: 70,
    maxValue: 80
 }  
}
);
于 2016-03-07T08:56:25.293 回答