I am trying to make a demonstration using cubism. I have created a custom context.metric, similar to the random() function on the cubism homepage. This loads my data set and renders correctly, showing a new row each second.
What I want to do now is have the axis scale domain update as well, using the date column from my dataset. For the purposes of demonstration, I want each second that passes in wall-time to correspond to one row in my dataset, which is hourly. I can set the scale domain when I create the context, but I cannot get it to update when new data is fetched.
I have tried to listen for context events such as change, and beforechange and manually update the domain there. It does not seem to work, or I am doing something wrong. Any suggestions would be greatly appreciated.
Thanks for the awesome libraries!
The context’s time domain is fixed by the context step and size. For example, if you have a step of ten seconds and a size of 1,440, then the domain is the last four hours. If you use context.axis to display the axis, it will update automatically whenever the context fires a change event; you don’t have to do anything. Cubism is designed for realtime dashboards, so it doesn’t support advancing an hour per second.