reflex icon indicating copy to clipboard operation
reflex copied to clipboard

[REF-2928] Support to change chart color

Open alisaycl96 opened this issue 2 years ago β€’ 2 comments

Describe the bug After switch to use new graphing library 'Recharts', found that Pie chart does not support color_scale parameters anymore. Currently, the fill parameter only support to change the whole graph but not color by key value of data.

Expected behavior Would like to change the chart color for different keys in data. Take below image for example, ζˆͺεœ– 2023-10-30 δΈ‹εˆ3 47 23

Specifics (please complete the following information):

  • Python Version: 3.9.9
  • Reflex Version: 0.2.9
  • OS: MacOS
  • Browser (Optional): chrome

REF-2928

alisaycl96 avatar Oct 30 '23 07:10 alisaycl96

Feels like a convenient feature to have :+1:

Lendemor avatar Oct 30 '23 11:10 Lendemor

I would like to add my support for this request. The Pie chart that is provided by ReCharts appears to be a downgrade in terms of functionality when compared to pre 0.3.0.

StephanHeijl avatar Dec 24 '23 12:12 StephanHeijl

Hello, I had the same case. In this project I saw that the color could be modified for each value, like the following:

data01 = [ {"name": "Sent", "value": 400, "fill": "rgba(2, 220, 130, 1.0)"}, {"name": "Failed", "value": 100, "fill": "rgba(241, 50, 66, 1.0)"}, ] Captura de pantalla 2024-08-20 a la(s) 1 24 01β€―p m πŸ”— https://dashboard-new.reflex.run/ πŸ”— https://github.com/reflex-dev/templates/blob/main/dashboard/dashboard/views/charts.py

serasinfin avatar Aug 20 '24 19:08 serasinfin

Added this PR improving the docs for PieChart : https://github.com/reflex-dev/reflex-web/pull/947

Lendemor avatar Sep 24 '24 19:09 Lendemor