Abhinandan-Kushwaha / react-native-gifted-charts

The most complete library for Bar, Line, Area, Pie, Donut, Stacked Bar and Population Pyramid charts in React Native. Allows 2D, 3D, gradient, animations and live data updates.
https://www.npmjs.com/package/react-native-gifted-charts
MIT License
790 stars 152 forks source link

The first property setting of BarChart/LineChart RulesConfigArray does not take effect #893

Open xuxiaoqian1 opened 2 weeks ago

xuxiaoqian1 commented 2 weeks ago

Description

The first property setting of BarChart/LineChart RulesConfigArray does not take effect

Steps to reproduce

import React from 'react';
import { View} from 'react-native';

import { LineChart} from "react-native-gifted-charts";

export default class LineChartTest extends React.PureComponent {
    constructor(props) {
      super(props);

    }

  render() {
    const lineData = [
      {value: 0},
      {value: 10},
      {value: 8},
      {value: 58},
      {value: 56},
      {value: 78},
      {value: 74},
      {value: 98},
    ];

    return (
      <View style={{borderWidth:1}}>
        <LineChart
           height={250}
           data={lineData}
          {...{
    rulesConfigArray: [
      { rulesLength: 210, rulesColor: 'red', rulesType: 'solid', rulesThickness: 5, dashWidth: 40, dashGap: 5 },
      { rulesLength: 180, rulesColor: 'blue', rulesType: 'dotted', rulesThickness: 8, dashWidth: 40, dashGap: 8 },
      { rulesLength: 100, rulesColor: 'green', rulesType: 'dashed', rulesThickness: 10, dashWidth: 40, dashGap: 10 }]
  }}
        />
      </View>
    )
  }
}

Snack or a link to a repository

No response

version of react-native-gifted-charts

1.4.47

React Native version

0.72.5

Platforms

Android, iOS

Workflow

React Native