Stockcharts - 添加偏移量以避免在边缘绘制点 [英] Stockcharts - Adding an offset to avoid drawing points at the edge

查看:164
本文介绍了Stockcharts - 添加偏移量以避免在边缘绘制点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

stockcharts ,它们都提供了在x轴上添加填充的选项,以避免在绘图区边缘(左侧或右侧)绘制一些值。
根据该文档,这是通过采用 minPadding maxPadding 配置对象用于构建图表......但实际上,这不适用于股票图表。所以我想知道我该如何做到这一点......我给你留下了一些例子......

  var示例





PD:使用财产 min 设置最低的x值也不起作用。 解决方案

p>在未调用setExtremes()方法时应用maxPadding。在Highstock中,我们调用setExtremes在导航器上设置范围,结果填充被忽略。为了实现您的目标,您可以定义tickLength参数并

  yAxis:{
tickWidth:1,
tickLength:50,
标签:{
x:50
}
},



<例如:




  • http:



    OP注意:请参阅更新的评论答案。


    Highcharts and stockcharts, they both provide the options to add some padding at the x axis in order to avoid drawing some values on the edge of the plot area (left or right). According to the doc this is archived by employing the minPadding and maxPadding members of the xAxis property of the configuration object used for constructing the chart... but in practice this is not working for stockcharts. So i wonder how i can achieve this... i leave you with the examples...

    var examples
    

    P.D: Using property min for setting the lowest x value also isn't working.

    解决方案

    The maxPadding is applied when you not call the setExtremes() method. In the Highstock, we call the setExtremes to set the range on the navigator, as a result padding is ignored.

    To achieve your goal, you can define the tickLength parameter and set x param per labels.

    yAxis: {
      tickWidth: 1,
      tickLength: 50,
      labels:{
        x: 50
      }
    },
    

    Example:

    OP Note: See the comments for updated answer.

    这篇关于Stockcharts - 添加偏移量以避免在边缘绘制点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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