JesperLekland / react-native-svg-charts

📈 One library to rule all charts for React Native 📊
MIT License
2.36k stars 409 forks source link

Unable to render shadow graph in Android #233

Open edo1493 opened 6 years ago

edo1493 commented 6 years ago

What is the problem?

Hello, I am trying to render a shadow for a line chart, which is basically another line chart as child of the parent line chart. It seems nothing gets rendered on Android, while iOS works like a charm.

When does it happen?

Android only.

What platform?

React Native version: 0.57

Code to reproduce

      <LineChart
          animate={true}
          animationDuration={200}
          style={{ flex: 1}}
          data={ lineGraph }
          yAccessor={this.props.yAccessor}
          xAccessor={this.props.xAccessor}
          xScale={scale.scaleTime}
          curve={ shape.curveNatural }
          numberOfTicks={ 6 }
          svg={{ stroke: 'rgb(255, 255, 255)', strokeWidth:3,}}
          contentInset={ contentInset }>
          <LineChart
            animate={true}
            animationDuration={200}
            style={{ flex: 1}}
            data={ lineGraph }
            xScale={scale.scaleTime}
            yAccessor={this.props.yAccessor}
            xAccessor={this.props.xAccessor}
            type="shadow"
            curve={ shape.curveNatural }
            svg={{ stroke: 'rgba(255, 255, 255, 0.2)', strokeWidth: 10 }}
            contentInset={ contentInset } />
          <Grid
            svg={{ stroke: 'rgb(255, 255, 255)', strokeWidth: 0.1 }}
            belowChart={true}/>
        </LineChart>

screen shot 2018-09-26 at 18 55 53

This is what I see on iOS.

screen shot 2018-09-26 at 18 57 28

This is Android.

pistonsky commented 6 years ago

It seems like you can't render anything inside a LineChart. But did you try to render them side-by-side?

juanzone commented 5 years ago

same issue. Can't render another graph as a decorator on Android.. Works well on IOS

TriinK commented 5 years ago

Is this problem somehow resolved? I have the same issue on Android (can't render anything as LineChart children).