Plot change when setting the visibility of elements

24 Views Asked by At

I finished the plot with a strange result. When showing one line it is currect. But if setting the visibility if multiple elements are shown the lines seems strange. Does anyone know the possible reason for this?[enter image description here](https://i.stack.imgur.com/gUfIS.png) here is how I create the plot:

import json
from plotly.utils import PlotlyJSONEncoder
import pandas as pd
import plotly.express as px

# Your dataframe 'df' should be defined above this point
all_stock_prices = px.line(data_frame = df,
                           x='TIMESTAMP', y='VALUE', color='NAME_UNIT', 
                           title="Line plot of can_result over time"
                           )

graphJSON = json.dumps(all_stock_prices, cls=PlotlyJSONEncoder)
output_file_path = 'app/plot_data_subset.csv'
df.to_csv(output_file_path, index=False)

return jsonify(json.loads(graphJSON))

I tried different combination of selection and found that when selection that line individually nothing is wrong, but when selecting multiple other elements the wrong things happens.

0

There are 0 best solutions below