Skip to content

Duplicated incorrect lines in html and svg output #6404

Closed
@ghost

Description

We noticed a big problem with svg rendering that happens on rare occasions.

Sometimes when writing a chart with many nan values to html, it will create phantom lines. They will be lines that exist in the chart but duplicated and placed in the wrong place. This doesn't happen if you .show() the chart in a jupyter notebook, only when you write to html (and I guess by extension also effects static chart export).

I have attached two charts. One shows the phantom lines in the middle of the chart (the line being a duplicate of a line that is just to the left of it). The other shows the correct chart.

image

The correct one. The only difference between this chart and the one above is that this one uses Scattergl instead of Scatter, so likely a problem with how svg rendering works.

AB Industrivärden (publ) Per Share Fundamentals

This is kind of a terrifying error because you never know when it might strike!

I am unable to give a min. reproducible example, except to say its a Scatter(mode='lines') with many np.nan values that seem to split the line into many svg line segments (which it somehow gets wrong). we 'fixed' it by using Scattergl (in case anyone else on here runs across it in the future).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions