Skip to content

Crashes on android when using strokeDasharray property #743

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

Open
Dannark opened this issue Apr 3, 2025 · 1 comment
Open

Crashes on android when using strokeDasharray property #743

Dannark opened this issue Apr 3, 2025 · 1 comment

Comments

@Dannark
Copy link

Dannark commented Apr 3, 2025

Hi guys, today I noticed that if we use the strokeDasharray property from propsForBackgroundLines on Android, it crashes without giving any error hints. (There is an error in Logcat, though, but it doesn’t help much.)

To replicate it:

const chartConfig = {
    backgroundGradientFromOpacity: 0,
    backgroundGradientToOpacity: 0,
    color: () => colors.absolut.green,
    labelColor: () => colors.button.dismiss.disabled,
    decimalPlaces: 2,
    strokeWidth: 2,
    propsForDots: {
      r: '0',
    },
    propsForBackgroundLines: {
      // strokeDasharray: [], //this line causes the crash
      stroke: colors.menu.tertiary,
      strokeWidth: 1,
    },
  };

return (
     ...
     <LineChart
          data={{
            labels: chartData.labels,
            datasets: [{ data: chartData.data }],
          }}
          width={CHART_WIDTH}
          height={220}
          chartConfig={chartConfig}
          withVerticalLines={false}
          withHorizontalLines={true}
          withInnerLines={true}
          withOuterLines={false}
          withShadow={false}
          // fromZero
          withVerticalLabels={true}
          withHorizontalLabels={true}
          style={styles.chart}
     />
     ...
)
@Dannark
Copy link
Author

Dannark commented Apr 3, 2025

And this is the error on logcat:

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant