Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐛 BUG] Decimator does not work in candlestick charts (and should it?) #2283

Open
1 of 7 tasks
AlexandreSajus opened this issue Nov 26, 2024 · 2 comments
Open
1 of 7 tasks
Labels
🖰 GUI Related to GUI 🆘 Help wanted Open to participation from the community 💥Malfunction Addresses an identified problem. 🟧 Priority: High Must be addressed as soon

Comments

@AlexandreSajus
Copy link
Contributor

AlexandreSajus commented Nov 26, 2024

What went wrong? 🤔

One of the only reasons I would use default taipy charts instead of Plotly figures is the decimator.

BUT the decimator is not only situational but also rarely works:
1 - The doc uses decimator like this decimator={decimator} and this does not work, decimator=decimator is the only syntax that works
2 - Candlesticks charts, maybe the only use case for decimator, don't work with decimators. Try this example:

import yfinance
from taipy.gui import Gui
from taipy.gui.data import MinMaxDecimator
import taipy.gui.builder as tgb

# Extraction of a month of stock data for AAPL using the
# yfinance package (see https://pypi.org/project/yfinance/).
ticker = yfinance.Ticker("AAPL")
# The returned value is a Pandas DataFrame.
stock = ticker.history(interval="1d", start="1990-01-01", end="2024-01-01")
# Copy the DataFrame's index to a new column
stock["Date"] = stock.index

decimator = MinMaxDecimator(500)

with tgb.Page() as page:
    tgb.chart(
        "{stock}",
        type="candlestick",
        x="Date",
        open="Open",
        close="Close",
        low="Low",
        high="High",
        decimator="decimator",
    )

Gui(page).run()

This issue is part of a bigger issue of: we should not support tgb.chart anymore as it offers no benefits compared to tgb.chart(figure=plt.Figure())

Version of Taipy

4.0.1

Acceptance Criteria

  • A unit test reproducing the bug is added.
  • Any new code is covered by a unit tested.
  • Check code coverage is at least 90%.
  • The bug reporter validated the fix.
  • Related issue(s) in taipy-doc are created for documentation and Release Notes are updated.

Code of Conduct

  • I have checked the existing issues.
  • I am willing to work on this issue (optional)
@AlexandreSajus AlexandreSajus added 🖰 GUI Related to GUI 💥Malfunction Addresses an identified problem. 🟧 Priority: High Must be addressed as soon labels Nov 26, 2024
@jrobinAV jrobinAV added the 🆘 Help wanted Open to participation from the community label Nov 29, 2024
@dinhlongviolin1
Copy link
Member

dinhlongviolin1 commented Dec 19, 2024

Candlestick is a very niche type. We can calculate the whole candlestick data beforehand on the backend and send the compiled candlestick data to the frontend without losing any data points. Not sure if we should support this one specifically but if more request come we could potentially add it. @FabienLelaquais, any thoughts?

@arcanaxion
Copy link

1 - The doc uses decimator like this decimator={decimator} and this does not work, decimator=decimator is the only syntax that works

This has stumped me before. Could someone chime in if this is a taipy or documentation issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🖰 GUI Related to GUI 🆘 Help wanted Open to participation from the community 💥Malfunction Addresses an identified problem. 🟧 Priority: High Must be addressed as soon
Projects
None yet
Development

No branches or pull requests

4 participants