Keen.io仪表盘图上的最大和最小Y轴值 [英] Maximum and Minimum Y-Axis Values on Keen.io Dashboard Charts

查看:74
本文介绍了Keen.io仪表盘图上的最大和最小Y轴值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Is it possible to set maximum and minimum values on the Y-axis on keen dashboard charts?

我是从此github存储库下载仪表盘的:

I downloaded the dashboard from this github repo :

https://github.com/keen/dashboards

我有一个如下所示的垂直柱形图,我想将y轴上的最小值设置为70,将最大值设置为90,如何执行此操作?

I have a vertical column chart like below, I want to set the minimum value on the y-axis to be 70 and the maximum to be 90, how can I do this?

  <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'
}
}
);


推荐答案

我一问到这个问题,我就知道了out ...
只需在下面添加vAxis值:

As soon as I ask the question, I figure it out... Just add the vAxis values below :

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
 }  
}
);

这篇关于Keen.io仪表盘图上的最大和最小Y轴值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆