Skip to content
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

how to use line gradient colors #25

Open
batuhansahan opened this issue Mar 19, 2021 · 0 comments
Open

how to use line gradient colors #25

batuhansahan opened this issue Mar 19, 2021 · 0 comments

Comments

@batuhansahan
Copy link

batuhansahan commented Mar 19, 2021

I read the docs but renderHorizontalLineGradient renderVerticalLineGradient cannot figure out how to use its not working.

  verticalLineGradient = (props) => {
    return (<Defs key={'verticalLineGradient'}>
        <LinearGradient x1='50%' y1='0%' x2='50%' y2='100%' {...props}>
        <Stop stopColor="#58508d" offset="20%" stopOpacity="0.2" />
        <Stop stopColor="#bc5090" offset="40%" stopOpacity="0.2" />
        <Stop stopColor="#ff6361" offset="60%" stopOpacity="0.2" />
        <Stop stopColor="#ffa600" offset="100%" stopOpacity="0.2" />
        </LinearGradient>
      </Defs>
    );
  }


          <SlideAreaChart
            scrollable
            style={{ marginTop: 32 }}
            shouldCancelWhenOutside={false}
            data={data}

            renderFillGradient={this.fillGradient}
            renderVerticalLineGradient={this.verticalLineGradient}
            // renderFillGradient={defaultAreaChartFillGradient}
            axisWidth={this.state.axisWidth}
            axisHeight={this.state.axisHeight}
            paddingBottom={8}
            yAxisProps={{
              verticalLineWidth: 1,
              axisLabel: 'Y Units',
              axisLabelAlignment: 'middle',
              rotateAxisLabel: true,
              numberOfTicks: 2,
              hideMarkers: true,
            }}
            xAxisProps={{
              axisLabel: 'X Units',
            }}
            toolTipProps={{
              toolTipTextRenderers: [
                ({ scaleY, y }) => ({
                  text: scaleY
                    .invert(y)
                    .toFixed(1)
                    .toString(),
                }),
              ],
            }}
          />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant