c3js / c3js/c3

Stacked Area Charts have undrawn areas when data_columns contain negative values

Open
#1,316 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
9.3k
Forks
1.4k
Avg merge
6d 16h
Merged PRs (30d)
1

Description

Hi,
the topic explains the Issue. When you change one of the values to negative in http://c3js.org/samples/chart_area_stacked.html , you will see what i mean.

columns: [
['data1', 300, 350, 300, 0, 0, 120],
['data2', 130, 100, -140, 200, 150, 50]]

This happens on chart_types 'area' and 'area-spline'. The path for the area is drawn over 'area points' genereated in 'generateGetAreaPoints()'. these points dont contain the intersection points with x-axis. adding them would let it show quite better. for chart_type 'area-spline' adding point let it look better but the path is drawn over 'Quadratic Bezier Curves' so adjusting the 'control point' should maybe one more step.
Why am explaining all this. the draw functions are confusing me. the information i gave maybe help someone else by fixing this problem.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.