FormidableLabs / victory-native-xl

A charting library for React Native with a focus on performance and customization.
https://commerce.nearform.com/open-source/victory-native
640 stars 45 forks source link

Displaying Multiple Y-Values for a Single X-Value in a Scatter Chart #324

Open Shanmukhi-gandham02 opened 1 month ago

Shanmukhi-gandham02 commented 1 month ago

Question

Is it possible to display multiple y-values for the same x-value in a scatter chart?

zibs commented 4 weeks ago

I'm not totally sure off the top of my head, but have you tried using two scatter charts as siblings, something like:

....
<CartesianChart
          yKeys={["y", "y2"]} ... >
....
 <Scatter
                radius={scatterRadius}
                points={points.y}
                animate={{ type: "spring" }}
                color={colors.blue}
              />
 <Scatter
                radius={scatterRadius}
                points={points.y2}
                animate={{ type: "spring" }}
                color={colors.red}
              />
....