Historical Data Using Cubism

I have been playing with cubism for several days now. After successfully real-time data visualization, I am now trying to visualize historical data.

Here is my scenario: I want to make a history page for each user with every horizon showing every day of the week. Since I have data for every 10 minutes, .size will be 144. Thus, the axis should also show from 12:00 to 23:59. This will show data for the last week, per day.

Some issues that I encountered:

I could not make the axis show only time, it shows the day and date. Even if it is the next day, it does not really matter, since I can change the start and stop in the definition of the metric. How to change the axis to show only the time of day in 144px?

Can this be done using cubism?

+4
source share
2 answers

Changing .step should actually help you create an axis, you can also play with .serverDelay, which will also be the author of 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 

You can also check this post for more details on .serverDelay (). Change default scale in cubism.js

+2
source

Change cubism_axisFormatDays on line 1061 to cubism.js like this and tell me if it works:

 cubism_axisFormatDays = d3.time.format("%I:%M %p"); 
+1
source

Source: https://habr.com/ru/post/1491173/


All Articles