使用立体主义的历史数据 [英] Historical data using Cubism

查看:124
本文介绍了使用立体主义的历史数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经玩Cubism几天了。成功显示实时数据后,现在我想要显示历史数据。

I have been playing with Cubism for a few days now. After successfully visualizing real time data, now I'm trying to visualize historical data.

这里是我的场景:
我想为每个用户,每个水平条显示一周的每一天。因为我有每10分钟的数据, .size 将是144.所以轴应该也显示上午12点到下午11:59。

Here is my scenario: I want to make a history page for each user with each horizon bar showing for each day of the week. Since I have data for every 10 mins the .size would be 144. So the axis should also show 12 AM to 11:59 PM. This would show data for the last week, a day at a time.

我遇到的一些问题:

我不能得到轴只显示时间,它显示日期和日期以及。即使是其他日子,也没关系,因为我可以在度量定义中更改开始和停止。如何更改轴以仅在144px中显示时间?

I couldn't get the axis to show only time, it shows day and date as well. Even if it is some other day it won't matter much since I can change the start and stop within the metric definition. How can I change the axis to only show time of day in 144px?

是否可以使用立体主义?

Is it possible to do this using Cubism?

推荐答案

更改.step实际上应该帮助您创建轴,您也可以使用.serverDelay来创建轴本身:

Changing the .step should actually help you to author the axis, you can also play with the .serverDelay which will also author the axis itself:

var context = cubism.context() // set the cubism context
//.serverDelay(0) // No server delay
//.clientDelay(0) // No client delay
.step((1 * (1000*60*60))) // step once ever second
.size(1440) // and make the horizon div 1440 px wide.
.stop(); //to stop the cubism from flowing like a real time cubism

    //1e3 or 1 seconds
    //1e4 or 10 seconds
    //6e4 or 1 minute 
    //3e5 or 5 minutes
    //36e5 or 1 hour 
    //864e5 or 1 day


b $ b

您也可以查看这篇文章,了解更多关于.serverDelay()的细节。
更改cubism.js中的缩放默认值

这篇关于使用立体主义的历史数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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