You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment, we're allowing to pass children to the Chart components, so to allow to add extra components, like extra axis or any other child component supported by Recharts.
However, we faced two main issues:
Children are always appended after the other children (e.g. Lines/Bars), and this may be a problem in some cases. For example, a CartesianGrid, will be rendered in front of Bars / Lines and not behind them. To allow a correct usage of CartesianGrid, we should allow to add it before the Bars/Lines (see https://codesandbox.io/s/great-goldstine-njvysy?file=/src/App.js)
It's not possible to configure the rendering of the single lines/bars, to change the params, or add specific children to them, e.g. ErrorBar
A possible interface to improve the current state could be the following one:
allow passing a render method as prop, which receives all the components used internally as input, so that the user can rearrange them / add new children in any position:
Add a barRender/lineRender/... method to customize the single bar/line/...
The method will receive the default rendering props as input, so that the user can alter them or add any new prop / children.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
At the moment, we're allowing to pass children to the Chart components, so to allow to add extra components, like extra axis or any other child component supported by Recharts.
However, we faced two main issues:
CartesianGrid,
will be rendered in front of Bars / Lines and not behind them. To allow a correct usage ofCartesianGrid,
we should allow to add it before the Bars/Lines (see https://codesandbox.io/s/great-goldstine-njvysy?file=/src/App.js)A possible interface to improve the current state could be the following one:
The method will receive the default rendering props as input, so that the user can alter them or add any new prop / children.
cc @gabro
Beta Was this translation helpful? Give feedback.
All reactions