任何方式与谷歌图表创建一个简单的时间表? [英] Any way to create a simple timeline with Google Charts?

查看:68
本文介绍了任何方式与谷歌图表创建一个简单的时间表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以用Google Charts创建简单的事件时间表? (我不是指一个带注释的时间线。)



在我的例子中,我想以毫秒为单位显示一系列事件时间(不是时间间隔),标签,有点像这样:

  | eventFoo 
| eventBar
| eventFooBar

'''
0 500 1000

我认为想办法破解这个,例如:

http://www.designinginteractive.com/code/how-to-build-a-gantt-chart-with-the-google -charts-api /



...但是能够像'原生'这样编码是很好的。

解决方案

好的--FWIW,我自己创建了一个JavaScript时间轴实现。



你可以在我撰写的关于Navigation Timing API的文章中看到它在行动中(位于页面底部) )。

在这种情况下,x轴显示毫秒,但时间轴可以很容易地适应日期。在x轴上添加刻度标记在算法上会有点复杂,但不难编码。


Is there any way to create a simple timeline of events with Google Charts? (I don't mean an annotated timeline.)

In my case, I'd like to display a series of event times (not time intervals) in milliseconds, with labels, a bit like this:

| eventFoo
  | eventBar
        | eventFooBar

'            '            '
0           500         1000

I think think of ways to hack this, for example:

http://www.designinginteractive.com/code/how-to-build-a-gantt-chart-with-the-google-charts-api/

...but it would be nice to be able to code something like this 'natively'.

解决方案

OK -- FWIW, I wound up building a JavaScript timeline implementation myself.

You can see it in action in an article I wrote about the Navigation Timing API (at the bottom of the page).

The x-axis in this case displays milliseconds, but the timeline could easily be adapted for dates. Adding tick marks to the x-axis would be somewhat complex algorithmically, but not difficult to code.

这篇关于任何方式与谷歌图表创建一个简单的时间表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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