the simplest example of cubism.js

some notes

In this post, I will show the simplest example of cubism.js, hoping that someone interested in cubism.js feels familiar quickly by using this post.

Timeseries chart that cubism.js provides is acuired by the following steps.

1. create context
2. define metrics and metric accessor
3. draw graphs in a way of D3.js
4. add some components (axis, rules, …)

OK. Let’s get started.

First off, let’s create context, which contains state of cubism.js. And create horizon(chart object) from context.

you can change the values from default, such as graph size, steps, serverDelay, etc.. See here for details.

Next, we need to define metric accessor, which tells cubism.js how to get metric values
when a metric name is specified. In this post, metric values are ramdom values whatever the metric name is.
For more details see this part.

And tells cubism.js that this is a metric accessor

And, next? That’s…

View original post 41 more words

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s