react-native-chart-kit icon indicating copy to clipboard operation
react-native-chart-kit copied to clipboard

Bar Chart VerticalLines not rendered.

Open gokulravi2010 opened this issue 2 years ago • 1 comments

Hi. We are using Bar chart with a specific data but we are unable to display the y-axis and the verticalLines are not rendered. Is there any way to display y-axis vertical line?

We have written the following code to render the BarGraph:

`const data1 = { labels: ['January', 'February', 'March', 'April', 'May'], datasets: [ { data: [80000, 48000, 28000, 13000, 5000], colors: [ () => '#94D6E9', () => '#ABC2AD', () => '#C89297', () => '#8F90B0', () => '#F2C298', ], strokeWidth: 1, }, ], };

<BarChart style={{ alignItems: 'center', padding: 20, }} data={data1} width={300} height={300} chartConfig={{ backgroundColor: 'white', backgroundGradientFrom: 'white', backgroundGradientFromOpacity: 0, backgroundGradientTo: 'white', decimalPlaces: 0, color: opacity => rgba(124,124,124,${opacity}), strokeWidth: 1, barPercentage: 1, propsForBackgroundLines: { strokeDasharray: '', strokeWidth: 1, }, fillShadowGradientOpacity: 3, useShadowColorFromDataset: false, propsForVerticalLabels: { fontSize: 13, fontWeight: '400', marginLeft: 0, paddingLeft: 0, textAlign: 'left', }, propsForHorizontalLabels: {fontSize: 13, fontWeight: '400'}, }} withCustomBarColorFromData={true} flatColor={true} withVerticalLabels={false} showBarTops={false} fromZero={true} withHorizontalLines={true} withVerticalLines={true} withInnerLines={true} />`

Output we received:

Output1

Desired Output :

Output2

gokulravi2010 avatar Nov 02 '23 10:11 gokulravi2010

@gokulravi2010 Please Add this Props showVerticalLines={true}

bhavesh-trentium avatar Aug 23 '24 06:08 bhavesh-trentium