Billboard.js: bug(shape): incorrect rendering of bar/area

Created on 9 Apr 2020  路  2Comments  路  Source: naver/billboard.js

Description

As for now it is necessary to set axis_y/y2_min if zerobased is false, because without setting axis_y/y2_min it would render the area/gradient the way like it was before the changes in https://github.com/naver/billboard.js/commit/a47a8290b59c579610ba1ffdd4a3916a8f975a71.
This changes seem to negatively affect the rendering of the area/bar columns.

The code in the jsfiddle example below renders the chart like this:
wrong

data1 is bound to y-axis and data2 is bound to y2-axis.
axis_y/y2_min is set to -1000 and axis_y/y2_max is set to 1000.

Before the commit the chart would be rendered like this:
right

As you can see in the first picture, it doesn't really make sense to render the bars from axis_y2_min to the value of the column. It should render like in the second picture from 0 to the value of the column.
In this case, it should always start rendering area/bar from 0 to the column value.

I modified your example from https://github.com/naver/billboard.js/issues/1302#issuecomment-608390067 in [this](https://jsfiddle.net/michkami/don7bqts/) fiddle, and as you can see, it starts to draw the area from axis_y_min to the value of the column, which is wrong in my opinion.

Woultn't it make more sense to make the rendering of the area/bar independent from axis_y/y2_min?
If zerobased is true, it works properly, as long as axis_y/y2_min is not set. If zerobased is false, wouldn't it be possible to scale the column values from the rendered axis_y/y2_min and axis_y/y2_max?
Like in this example from 1900 to 3000.
example1

Steps to check or reproduce

https://jsfiddle.net/michkami/L05avd9c/

bug released

All 2 comments

Thanks for the report. Side-effect caused by #1304 and needs to be reverted.

:tada: This issue has been resolved in version 1.12.4 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

elielr01 picture elielr01  路  3Comments

imbyungjun picture imbyungjun  路  5Comments

flipcode1973 picture flipcode1973  路  5Comments

mafar picture mafar  路  4Comments

michkami picture michkami  路  5Comments