简体   繁体   English

高库存-力X轴显示范围,与数据无关

[英]Highstock - force x-axis displayed range regardless of data

I am creating a candlestick chart with grouped data and would like to be able to show a specific range based on a defined pixel width of each candle regardless of missing data. 我正在创建带有分组数据的烛台图,并且希望能够根据每个蜡烛的定义像素宽度显示特定范围,而不管丢失数据如何。

plotOptions: {
    candlestick: {
        pointWidth: 10,
        pointPadding:5
    }
 },

So if the total plotWidth is 700px and each candle is approx 15px and the dataGrouping is 1 minute there would be approx 47 mins in the xAxis. 因此,如果总plotWidth为700px,每根蜡烛大约为15px,并且dataGrouping为1分钟,则xAxis大约为47分钟。

I would imagine i could caculate and add the missing data/points but is there some way to force the xAxis to display a range and plot whatever data i have automatically? 我可以想象我可以计算并添加缺少的数据/点,但是有什么方法可以强制xAxis显示范围并自动绘制任何数据?

First of all: you can use or pointPadding or pointWidth , where width has higher priority. 首先:可以使用或pointPaddingpointWidth ,其中width具有更高的优先级。

Anyway, you can user ordinal axis (which is default behavior) to remove missing data between points. 无论如何,您可以使用序数轴(这是默认行为)来删除点之间的丢失数据。 It means that points will be evenly spaced on a chart. 这意味着点将在图表上均匀分布。 You have only 10 points? 您只有10分? Each will take the same amount of space, x-value will have lower priority. 每个值将占用相同的空间,x值将具有较低的优先级。

This is example: http://jsfiddle.net/WbynW/ 例如: http : //jsfiddle.net/WbynW/

You can observe only 5 points, but each is 10px width, and each has the same distance between next one. 您只能观察5个点,但每个点的宽度均为10px,并且每个点之间的距离相同。 Note xAxis labels (1. Jan, 11. Jan etc.) 注意xAxis标签(1. Jan,11。Jan等)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM