Highcharts - 系列跳过日期 [英] Highcharts - Skip date in series

查看:160
本文介绍了Highcharts - 系列跳过日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我从数据库中提取一些数据并获取UNIX时间戳和一个数字。因此,让我们说N(数字)在D(日期)出售。



像周末一样缺少天。我需要它仍然显示一天,但不需要任何数据。

2010年4月1日,50件成交

2010年4月2日,53件成交

2010年4月7日, 10美元卖出

(我有超过1000年的记录跨越几年 - 所以我也会添加一个缩放比例)

所以图表应该仍然显示4月1日至7日,但没有3-6的数据。 (该行只会从2-7开始)。



有关如何做到这一点的任何想法?

谢谢,
Josh

解决方案

请看这里: http://highcharts.com/ref/#series 'data'属性的第二个例子。



你只需要转换mysql日期,将其转换为UNIX时间戳(UNIX_TIMESTAMP()),然后乘以1000(JS需要时间(微秒))...

So I'm pulling some data from a database and getting a UNIX Timestamp and a number. So lets say N (number) was sold on D (date).

There are days missing, like the weekend. I need it to still display the day, but not require any data. It's a line chart.

April 1 2010, 50 sold
April 2 2010, 53 sold
April 7 2010, 10 sold
(I have over a 1,000 records spanning a several years - so I will add a zoom as well)

So the chart should still show April 1-7 but have no data for 3-6. (the line would just go from 2-7).

Any ideas on how to do this?

Thanks, Josh

解决方案

take a look here: http://highcharts.com/ref/#series second example of 'data' property.

You just have to convert mysql date, convert it to UNIX timestamp (UNIX_TIMESTAMP()), and then multiply it by 1000 (JS needs time in microseconds)...

这篇关于Highcharts - 系列跳过日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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