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
Currently, the chart only supports initialSpacing to add empty space before the first data point. It would be great to have an option to render a custom component in that area.
For example, if an app limits historical data for non-logged-in users, we might want to show a message like:
“Login to see more historical data”
This message should appear before the first data point and scroll together with the chart.
Proposed API
renderStartComponent?: ()=>ReactNode;
Example Usage
<LineChartdata={data}renderStartComponent={()=>(<Viewstyle={{alignItems: 'center',justifyContent: 'center',width: 120}}><Textstyle={{color: 'gray'}}>Login to see more data</Text></View>)}/>
Expected Behavior
The returned component appears at the start of the chart content area.
It scrolls horizontally with the chart (like part of the timeline).
initialSpacing can still be used for fine-tuning positioning.
Why It’s Useful
Improves UX for gated or premium data views.
Avoids hacks like fake data points or absolute overlays.
Increases flexibility for building interactive chart experiences.
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
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, the chart only supports
initialSpacingto add empty space before the first data point. It would be great to have an option to render a custom component in that area.For example, if an app limits historical data for non-logged-in users, we might want to show a message like:
This message should appear before the first data point and scroll together with the chart.
Proposed API
Example Usage
Expected Behavior
initialSpacingcan still be used for fine-tuning positioning.Why It’s Useful
Beta Was this translation helpful? Give feedback.
All reactions