LineChart: Fixed/static reference lines position on dynamic YAxis config? #1001
Unanswered
kpatel0170
asked this question in
Q&A
Replies: 1 comment
-
Any updates?? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,

I have been trying to add filters (based on dates) to the graph data, it works fine as long as maxValue (yAxisMax) stays the same (i.e. until 3D filter), see screenshot below:
As I apply 7D or All filters, maxValue (yAxisMax) changes, the referenceLine position data should stay the same (as the (setpoints) values are still same).

but at runtime, it's changing the position and misplacing the reference lines, see below screenshot:
As per documentation:

Link: https://github.com/Abhinandan-Kushwaha/react-native-gifted-charts/blob/master/docs/LineChart/LineChartProps.md
Question
Thanks for the help :)
Here is my config:
calculations:
var maxChartValue = Math.max(...chartData.map((d) => d.value));
var yAxisMax = highSetpoint ? Math.max(maxChartValue, highSetpoint) : maxChartValue;
component:
sample data:
setpoint1 = 2
setpoint2 = 35
chartData = [ {"label": "2025-02-14 | 12:11 PM", "name": "Pump Status", "value": 29.6}, ....]
Beta Was this translation helpful? Give feedback.
All reactions