💸 Reduce costs by consolidating proprietary analytics & reporting software to open-source & Dash.
Challenge us to replace your analytics with Dash and reduce costs.

Embedding specific range of a graph

Hi all,

I’m currently trying to embed a specific range of a graph from the python libraries (plotly.tools.get_embed()); this graph is updated often (about every 5 minutes), but I want to be able to embed a specific portion of that graph’s history. For example, in a line graph where a new point is added every 5 minutes with the x value as the current time and the y value as some arbitrary value, I want to be able to get an embed that cuts off on the right side at any arbitrary date (a part of the x-axis range).

I am not interested in generating a new graph; I have already tried this route and it led to generating about 300 graphs per day, per graph I want to generate. (I’m currently rate limited from the API from trying to delete them all, heh…)

Thanks!
Spencer

I’d also like to be able to get this data in a .png format, if that’s possible. The best I can think to do is cache the image manually myself, but that doesn’t seem ideal if the .png’s are generated on the fly by plot.ly anyways.

You can use the range attribute in the x-axis object to limit the range on the left-hand-side:

All the data will still be in the plot, but you will only see what is in the range you provide.