【问题标题】:Maximum and Minimum Y-Axis Values on Keen.io Dashboard ChartsKeen.io 仪表板图表上的最大和最小 Y 轴值
【发布时间】:2016-06-20 17:48:14
【问题描述】:

是否可以在敏锐的仪表板图表的 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'
}
}
);

【问题讨论】:

    标签: charts dashboard keen-io


    【解决方案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
     }  
    }
    );
    

    【讨论】:

      猜你喜欢
      • 2019-05-08
      • 1970-01-01
      • 2021-02-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多