Skip to content

[xy-chart] How to make AreaSeries filled with a color to transparent gradient? #1001

Answered by RIP21
RIP21 asked this question in Q&A
Discussion options

You must be logged in to vote

And here is the answer.

Full example:

import React, { useEffect, useMemo } from 'react'
import {
  lightTheme as lt,
  darkTheme as dt,
  Grid,
  AreaSeries,
  Axis,
  XYChart,
  Tooltip,
  buildChartTheme,
} from '@visx/xychart'
import { ThemeConfig } from '@visx/xychart/lib/theme/buildChartTheme'
import { curveMonotoneX } from '@visx/curve'
import { LinearGradient } from '@visx/gradient'
import { ParentSize } from '@visx/responsive'
import { Box, useColorMode, Stack } from '@chakra-ui/react'
import { css } from '@emotion/css'
import { MetricHistoryPoint } from '__generated__/graphql-types.generated'

const dateScaleConfig = { type: 'band', paddingInner: 1 } as const
const moneyScaleConfig 

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@williaster
Comment options

@RIP21
Comment options

@williaster
Comment options

@williaster
Comment options

@RIP21
Comment options

Answer selected by RIP21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants