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

Cannot change fillShadow on ProgressChart

Open rook218 opened this issue 2 years ago • 1 comments

I've been experimenting with this all morning. None of the fillShadow... props have any effect on ProgressChart. I'm trying to get my actual data to be brighter than the underlying line, because right now there is an issue with contrast where it's difficult for a user to see how much is filled at a quick glance.

I want the opacity of the data-filled portion of the ring to be around 0.2, while I want the opacity of the fill shadow to be about 0.9. The default is more like 0.4 vs 0.6

I'm not sure if there's something I'm not understanding about the API, but I would have expected the fillShadow... props to fix this, but they have no effect at all. If I am misunderstanding this then I will update the documentation with this info when someone corrects me.

	const chartData: ProgressChartData = {
		colors: [theme.colors.error],
		data: [percentOfMonthly]
	}
	const chartConfig: ChartConfig = {
		color: (opacity = 1) => hexToRgb(theme.colors.primary, opacity), // changing the opacity default arg also has no effect
		backgroundGradientFrom: theme.colors.background,
		backgroundGradientTo: theme.colors.background,
		// None of these properties have any effect at all
		fillShadowGradientFrom: 'rgb(255, 255, 255)',
		fillShadowGradientTo: 'rgb(255, 255, 255)',
		fillShadowGradient: 'rgb(255, 255, 255)',
		fillShadowGradientOpacity: 0.5,
		fillShadowGradientFromOpacity: 0.5,
		fillShadowGradientFromOffset: 0.5,
		fillShadowGradientToOpacity: 0.5,
		fillShadowGradientToOffset: 0.5,
	}
        ...
        ...
        ...
        <ProgressChart
	        chartConfig={chartConfig}
	        data={chartData}
	        width={50}
	        height={50}
	        radius={18}
	        strokeWidth={6}
	        hideLegend
        />

rook218 avatar Nov 21 '23 13:11 rook218

I will note that I get the same behavior with values in different color formats. There is no effect with using 'rgb(255, 255, 255)', '#FFF' or '#FFFFFF'

rook218 avatar Nov 21 '23 14:11 rook218