Changing the default scale in cubism.js

I use cubism.js to display some static data from a JSON object. We want to be able to display data for several years, with an indication for every day. I have a solution that works in part, but I would like to establish a scale that does not depend on today's date, i.e. I would like to display data from yesterday on the corresponding day of last year. I tried the following without success:

context.scale (d3.time.scale (). domain ([start, end]). range ([0,96]))

where the start and end comes from the JSON object. Is it possible to adjust the scale of cubism?

Thank you very much,

Michael

+2
source share
1 answer

the demo of shares from the intro conversation does almost this, using serverDelay to move the displayed time window and stop to prevent updates:

var context = cubism.context() .serverDelay(new Date(2012, 4, 2) - Date.now()) .step(864e5) .size(1280) .stop(); 

I think the API could be more conveniently handled in this particular case, but Cubism is mainly intended for real-time display.

+8
source

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


All Articles