victory
victory copied to clipboard
Create a Common component for VictoryArea chart not working
While creating a common component for VictoryArea chart not rendering in my app. and also i pass layout component to tooltip that also not working . could u explan this. why this is happend
const Area = {(width,height,...props)} =>
<VictoryArea
... // common props
width={width}
height={height}
{...props} />
// Using in VictoryChart
<Area
... // specific props
/>
I agree, creating custom subcomponents seems to be not supported at all, which is very surprising in the React ecosystem.
This issue is stale because it has been open for 90 days with no activity. If there is no activity in the next 7 days, the issue will be closed.
This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem.
sad
@ThaJay Is there anything specific you were looking for here? We do support custom React components in the tree, but I'd have to learn more about your use case in order to help.
@carbonrobot I'm sorry but I haven't been active in that project since November so I don't remember exactly and can't access the code right now.
From what I remember, Victory subcomponents contained inside other react components do not render in the viewport, even if that other React component is a direct child of a Victory wrapper component and it would render perfectly without this other React component in between.
I was planning to build a bunch of base components that I could easily compose together because the app was pretty heavy on the custom graphs with specific behaviours. For example a stacked bar chart with one bar selected that has more spacing, different colours, shows a border and some extra data. This chart alone has proven challenging to get both design and functionality right.
I could build a specific example if you can't find the issue, that would be no problem if you need it.