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

[BugFix] Set Chart Style Before Output #6367

Merged
merged 4 commits into from
May 7, 2024
Merged

Conversation

deeleeramone
Copy link
Contributor

  1. Why?:

    • The basic theme for charts was relying on the plotly.html file to set the theme as light/dark mode. For users relying on inline display, the result was a figure with an unset background.

Before:

This can be observed from, res.chart.fig

Screenshot 2024-05-06 at 9 30 35 AM

  1. What? (1-3 sentences or a bullet point list):

    • Insert a method that reads the user preference for chart_style and then sets the paper_bgcolor and font_color accordingly.
    • Add a simple class method for toggling this choice on a generated figure.
  2. Impact (1-2 sentences or a bullet point list):

    • This ensures that the inline renders display correctly.
  3. Testing Done:

data = obb.equity.price.historical("AAPL", chart=True)
data.chart.fig

After:

Screenshot 2024-05-06 at 9 25 43 AM

This will update the figure to be the reverse of the chart_style preference. It does not render the update, show() must be used after.

data.charting.toggle_chart_style()

@deeleeramone deeleeramone added bug Fix bug platform OpenBB Platform v4 PRs for v4 labels May 6, 2024
@deeleeramone deeleeramone requested a review from hjoaquim May 6, 2024 16:33
@IgorWounds IgorWounds added this pull request to the merge queue May 7, 2024
Merged via the queue into develop with commit d3b9ce6 May 7, 2024
10 checks passed
@IgorWounds IgorWounds deleted the bugfix/set-chart-style branch May 7, 2024 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fix bug platform OpenBB Platform v4 PRs for v4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants