carbon-design-system / carbon-charts

:bar_chart: :chart_with_upwards_trend:⠀Robust dataviz framework implemented using D3 & typescript
https://charts.carbondesignsystem.com
Apache License 2.0
905 stars 184 forks source link

[Bug]: although there is no data, the line does not indicate it #1302

Open mrtsrdm opened 2 years ago

mrtsrdm commented 2 years ago

Contact Details

murat.suerdem@gmail.com

What happened?

When there is no data where I marked, the line(stacked-area-chart) should stick to the x-axis and indicate that it is zero, just like in bar chart. *both charts in the image were created from the same data.

image

Version

"0.41.98-d3v5-latest-0.1"

Data & options used

Date            Amount
Aug 1, 2021 1.1
Sep 1, 2021 262,07
Nov 1, 2021 600
Dec 1, 2021 1.024,17
Jan 1, 2022 2.2
Feb 1, 2022 1

---------------------------------------------------------------------------------------------

significant options that ı used =>
curve: "curveMonotoneX",
scaleType: "linear"

Relevant log output

No response

Codesandbox example

No response

SteffenBaumann commented 2 years ago

Checking the above, you should consider upgrade the version first. 0.41. is pretty old meanwhile. Though, I doubt this is going to solve your concern.

Beside that, your assumption seems incorrect. A missing entry corresponds not to a zeroed value. You would need to include Oct 1, 2021 with a value of 0 specifically. The scaling on the x-axis is just based on equal distribution of ticks. It's rather coincidence here only.

The shared code sandbox shows the behavior with the explicit definition of 0 for October. Comment out that datum and you get your current result: https://codesandbox.io/s/boring-dream-gwigf

Just my 2 cents as developer using Carbon Charts :)