Skip to content

How to display bar chart background like display in following image #904

Closed Answered by ak-spotter
AbhishekMuknak asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @AbhishekMuknak This can be achieved using the showVerticalLines and verticalLinesThickness props.
If the vertical lines are not aligned with the bars, you can use the verticalLinesShift prop. The color of vertical lines is gray by default which can be changed using the verticalLinesColor prop.

Here's an example-

<BarChart
  data={[{ value: 5 }, { value: 3 }, {value:8}]}
  barWidth={15}
  frontColor={'navy'}
  roundedTop
  showVerticalLines
  verticalLinesThickness={15}
  verticalLinesShift={20}
  verticalLinesStrokeLinecap="round"
/>

The output of above code is-

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Abhinandan-Kushwaha
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants