Black Lives Matter. Please consider donating to Black Girls Code today.
Learn how to use COVID-19 data in open source Dash apps. Register for the Sept 23rd webinar with IQT!

Area chart display bug?

Hi!

I have made what should be a pretty simple area chart, but the formatting is weird:

Here’s the code: https://jsfiddle.net/ebdejxdt/

The data (including dates) are in order, so I don’t understand why it looks like it’s trying to draw points in the middle after the last points. Why is this happening?

Cheers,

Chris

Incidentally, I’m pretty sure this must be a bug, because sometimes I will refresh and it’ll work:

Then I refresh the page without changing anything, and…

This is pretty irritating… any help would be much appreciated!

Strange.

In your fiddle, you have:

var days = ['2017-06-19', '2017-06-20', '2017-06-21', '2017-06-22', '2017-06-23', '2017-06-24', '2017-06-25', '2017-06-26', '2017-06-27', '2017-06-28', '2017-06-29', '2017-06-30', '2017-07-02', '2017-07-03', '2017-07-04', '2017-07-05', '2017-07-06', '2017-07-07', '2017-07-08', '2017-07-09', '2017-07-10', '2017-07-11', '2017-07-12', '2017-07-13', '2017-07-14', '2017-07-15', '2017-07-16', '2017-07-17', '2017-07-01'];

where 2017-07-17 is followed by 2017-07-01, so looks like the graph is rendered properly.

1 Like

Ha! That’s weird, and I’ll look into why that happened (thanks!). Two quick things, though:

i) does/should Plotly not order line graphs by date anyway?
ii) what about the situation I mentioned in my second post, where every now and then (perhaps every 25th reload) it does render as expected, then, when I press refresh (without changing anything), it reverts to the weird formatting?

No. We don’t make that assumption.

I wasn’t able to replicate that one. Would you mind sharing a screencast to help us debug?

So, embarrassingly, I now can’t replicate it either. I genuinely spent about an hour with this problem yesterday, but it seems to have gone now, and I haven’t changed anything in the way mongodb was sorting the data. This makes me feel pretty stupid (which, fortunately, is something I’m used to)…

Anyway, I guess I can stop bothering you now. Thanks so much for your help, and have a great weekend! :slight_smile:

1 Like