简体   繁体   English

格式Highcharts xAxis用于库存数据

[英]Format Highcharts xAxis for stock data

I have gone through Highcharts options needed to be set for xAxis properties to format time label but with no luck understanding how exactly this works for this scenario. 我已经完成了需要为xAxis属性设置的Highcharts选项来格式化时间标签,但没有运气了解这对于这种情况究竟是如何工作的。

I have dynamic data retrieved for a stock during the day (intraday) which I need to display as data is retrieved starting at 9:30 and ending at 17:00 every day, I need to display labels showing 30 minutes interval as in the following: 9:30..10:00..10:30..etc but I can't seem to get this working with data blocks (pointers) received every 5 minutes. 我在白天(盘中)检索了库存的动态数据,我需要显示当从9:30开始检索数据并在每天17:00结束时,我需要显示标签显示30分钟的间隔,如下所示:9:30..10:00..10:30 ..但是我似乎无法使用每5分钟收到的数据块(指针)。

The other problem is that I need to display data without spanning to the full width of the chart, for example at 10:00 all I have is 6 bars (5 minutes each) but what it does is that it fills the chart with large 6 bars instead of locking them to their time frame: 另一个问题是我需要显示数据而不跨越到图表的整个宽度,例如在10点我只有6个柱(每个5分钟),但它的作用是用大6填充图表而不是将它们锁定到它们的时间范围: 不必要的行为

What I need to do is to display these bars within the 9:30-10:00 area and leave the rest to be filled as I receive more data just like this: 我需要做的是在9:30-10:00区域内显示这些条形图,并留下其余部分,因为我收到更多数据,如下所示: 想要行为 I would appreciate any help on how to get this done. 如果能完成任务,我将不胜感激。 I know a Stock chart type is in the work, but I need to use the OHLC type for now urgently. 我知道股票图表类型正在进行中,但我现在急需使用OHLC类型。

Many thanks. 非常感谢。

Not sure if this is the type of thing your thinking of. 不确定这是否是你想到的事情。

But with highcharts (If this is the thing your using) can do steps. 但是使用highcharts(如果这是你使用的东西)可以做的步骤。 Which in turn, only show the label every x intervals. 反过来,每x个间隔只显示标签。

I have created a demo of how you may approach your project. 我已经创建了一个关于如何处理项目的演示。

//

http://jsfiddle.net/BAV4X/69/ http://jsfiddle.net/BAV4X/69/

//

Couple issues with it, but somthing to start with, This isnt traditional "start / end" day values, rather "high/low" , high is calculated by the difference , you can see when the tooltip is created and the corresponding values. 夫妻问题,但开始的事情,这不是传统的“开始/结束”日值,而是“高/低”,高是由差异计算,你可以看到什么时候创建工具提示和相应的值。

Keep in mind you dont need to use "categories" but instead [x,y] co-ordinates in the data series. 请记住,您不需要使用“类别”,而是使用数据系列中的[x,y]坐标。

EDIT : 编辑

Apparently you can set the x-axis property "MAX" to allow full view of the chart, rather than it scaling. 显然,您可以将x轴属性设置为“MAX”以允许全图查看图表,而不是缩放。

This is fairly confusing as they have a "pointStart" to indicate the beginning x-axis, but no "pointEnd". 这是相当令人困惑的,因为它们有一个“pointStart”来表示开始的x轴,但没有“pointEnd”。

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

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