How to design this graph? #219
Replies: 2 comments
-
Change I'm not quite sure why you are using a Points component? Please see this guide for a similar chart as your provided screenshot: https://commerce.nearform.com/open-source/victory-native/cartesian/guides/basic-bar-chart |
Beta Was this translation helpful? Give feedback.
-
thanks @ffoton yes if i using y:0 then it will hide y axis,i am trying to set different colors and unfill color on bar for this i am checing example code.In that used Points component. Example code link: |
Beta Was this translation helpful? Give feedback.
-
Question
Thanks for this cool library.
![Screenshot 2024-03-14 at 12 34 24 AM](https://private-user-images.githubusercontent.com/39664330/312590125-b471199f-d596-49ae-9b1f-8332d87f4a6e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5NzQyMzcsIm5iZiI6MTczODk3MzkzNywicGF0aCI6Ii8zOTY2NDMzMC8zMTI1OTAxMjUtYjQ3MTE5OWYtZDU5Ni00OWFlLTliMWYtODMzMmQ4N2Y0YTZlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDAwMTg1N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY2NDdmYjNjMzc5OWU3MmY0YTM1YzA1YjJkZjU4MzUzZmJjNjEzZTA4MmNhZDU1ZDJlYWQwNzRkZjYwZDc2Y2MmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.I4bjsQ3E3ZFiUgvdQ7yj0kWSltEptM3_8vtJCRRsRQY)
I want to design barchart with different color,add unfill color and need to hide y-axis label.Please check attached image for better understanding.Please help.I am stuck in this.
Background Info/Attempts
I checked this demo example but how to set dynamic color in this?and also want to hide y-axis label
<CartesianChart
xKey="day"
padding={10}
yKeys={["stars"]}
domainPadding={20}
axisOptions={{
font,
tickCount: 5,
lineColor: isDark ? "#71717a" : "#d4d4d8",
labelColor: isDark ? appColors.text.dark : appColors.text.light,
}}
data={DATA}
>
{({ points }) => {
return (
<>
{points.stars.map(({ x, y }) => {
return (
<React.Fragment key={
point-${x}-${y}
}><Points
points={calculateStarPoints(x, y ?? 0, 5, numPoints)}
mode="polygon"
color={shapeColor}
strokeCap="round"
strokeWidth={2}
/>
</React.Fragment>
);
})}
</>
);
}}
Beta Was this translation helpful? Give feedback.
All reactions