XYChart: Handling gaps in data #1727
-
Beta Was this translation helpful? Give feedback.
Answered by
williaster
Jul 5, 2023
Replies: 1 comment 1 reply
-
Hey @RyKilleen thanks for checking out For example [
{ x: '2023-04-30', y: 10 },
{ x: '2023-05-01', y: 10 },
{ x: '2023-05-02', y: null }, // add something like this
{ x: '2023-05-03', y: null }, // add something like this
{ x: '2023-05-04', y: 10 },
] That should accomplish something like this (link). I would note that you must set ![]() |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
RyKilleen
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @RyKilleen thanks for checking out
visx
. To create gaps in yourLineSeries
all you'll need to do is fill in the missingx
values in your dataset and set the correspondingy
values tonull
.For example
That should accomplish something like this (link). I would note that you must set
stroke-linecap=round
in order to see single points surrounded by missing data (this is the default inXYChart
, but mentioning in case anyone overrides this)