Skip to content

Better way to handle time zone (charts) #554

Open
@FlorianJacta

Description

@FlorianJacta

Description
To avoid delays in dates for chart, the user has to manually localize dataframe columns of date to 'UTC'. It is making the code heavier and less natural.

The problem comes from Plotly.
We want to make sure, from time to time, that there's nothing we can do and take this issue back to the New Issues column if there's no news...

How to replicate

Run this code:

from taipy.gui import Gui
import taipy.gui.builder as tgb
import numpy as np
import pandas as pd

# create data with Dates
data = pd.DataFrame(
    {
        "Date": pd.date_range("2020-01-01", periods=5, freq="M", tz="Europe/Paris"),
        "Value": np.random.rand(5),
    }
)

with tgb.Page() as page:
    tgb.chart("{data}", x="Date", y="Value", height="800px")
    tgb.table("{data}")

print(data)

Gui(page).run(use_reloader=True, port=5003, title="Date issue")

You will see differences in the chart between the dates if you compare the chart and the table.

Acceptance Criteria

  • Ensure new code is unit tested, and check code coverage is at least 90%
  • Propagate any change on the demos and run all of them to ensure there is no breaking change
  • Ensure any change is well documented

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions