-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Display Multiple Y-Values for a Single X-Value in a Scatter Chart without overlapping #484
Comments
Hey @MrShakes, is this image what you want the chart to look like? Or is this what happens with the current implementation? |
Hi @zibs it's what I want it to look like |
Hey @MrShakes I think this should be already possible: ![]() You can achieve that by doing something along the lines of <Scatter
points={points.listenCount}
animate={{ type: "spring" }}
radius={radius}
shape={shape}
>
<LinearGradient
start={vec(0, 0)}
end={vec(0, 400)}
colors={["#a78bfa", "#a78bfa50"]}
/>
</Scatter>
<Scatter
points={points.listenCount}
animate={{ type: "spring" }}
radius={radius}
shape={shape}
style="stroke"
strokeWidth={1}
color="black"
/>
<Group transform={[{ translateX: 14 }]}>
<Scatter
points={points.listenCount}
animate={{ type: "spring" }}
radius={radius}
shape={shape}
>
<LinearGradient
start={vec(0, 0)}
end={vec(0, 400)}
colors={["green", "#c78f50"]}
/>
</Scatter>
<Scatter
points={points.listenCount}
animate={{ type: "spring" }}
radius={radius}
shape={shape}
style="stroke"
strokeWidth={1}
color="black"
/>
</Group>
<Group transform={[{ translateX: 24 }]}>
<Scatter
points={points.listenCount}
animate={{ type: "spring" }}
radius={radius}
shape={shape}
>
<LinearGradient
start={vec(0, 0)}
end={vec(0, 400)}
colors={["red", "#c78f50"]}
/>
</Scatter>
<Scatter
points={points.listenCount}
animate={{ type: "spring" }}
radius={radius}
shape={shape}
style="stroke"
strokeWidth={1}
color="black"
/>
</Group> Where you use You'll most likely have to do some massaging of your data to get it just right, but it should be possible. |
Thanks @zibs please can you add just purple to point 80-April and red to point 40-April so I see how it's done? |
I'll leave that up to you! |
Question
According to the attached image below I'm trying to display multiple y-values for a single x-value in a scatter chart without overlapping, we'll assume 3 different y points for now i.e. y1, y2 and y3. 3 main things to note:
I know I can format the x and y axis to display text, I've researched and tried with no luck yet.
Is it possible with this library thanks?
The text was updated successfully, but these errors were encountered: