react-native-echarts-wrapper icon indicating copy to clipboard operation
react-native-echarts-wrapper copied to clipboard

[feature] backgroundColor 'transparent' doesn't work

Open manolobattistadev opened this issue 5 years ago • 2 comments

It's not possible to set backgroundColor as transparent or rgba(0,0,0,0.0).

In my case I need to have a linear-gradient as background of the charts, if is not possible have linear gradient, is there a way to set a transparent background to use a linear-gradient box behind the charts?

manolobattistadev avatar Jan 20 '20 08:01 manolobattistadev

@tomLadder I saw now that it is possible add a style prop on WebView to solve this feature.

<WebView
          ...
          onLoadEnd={this.onLoadEnd}
          style={{
            backgroundColor: 'transparent'
          }}
        />

Can you provide a webViewProps on main Echarts component to pass custom props on WebView?

My custom screen

import {ECharts} from "react-native-echarts-wrapper";
<ECharts ref={(ref) => ref && setChart(ref)}
        option={ProfileGrowthOptions(data, activePeriod)}
        additionalCode={additionalCode}
        onData={onChartDataEvent}
        webViewProps={{
              style: {backgroundColor:'transparent'}
        }}
/> 

index.js

<WebView
    ...
    onLoadEnd={this.onLoadEnd}
    {...this.props.webViewProps}
/>
Schermata 2020-02-25 alle 23 14 28

It will be a great feature, let me know :)

manolobattistadev avatar Feb 25 '20 22:02 manolobattistadev

@manolobattistadev I'm currently very busy. But it is definitely on my list :)

tomLadder avatar Mar 01 '20 18:03 tomLadder