pepstock-org / Charba

J2CL and GWT Charts library based on CHART.JS
https://pepstock-org.github.io/Charba-Wiki/docs
Apache License 2.0
62 stars 6 forks source link

StackedAreaChart has no color anymore #69

Closed stockiNail closed 2 years ago

stockiNail commented 2 years ago

Thanks for your work.

I'm bumping Charba from version 3.3-gwt to 5.1-gwt. After resolving the breaking changes, the app works fine but the area in the StackedAreaChart has no color anymore even if I call setBackgroundColor() on the dataset. Is it because it's not anymore the correct way to set the area color, or is it a bug? (I can open an issue in that case if you prefer).

Thank you.

Originally posted by @salmonb in https://github.com/pepstock-org/Charba/discussions/68#discussioncomment-2237122

stockiNail commented 2 years ago

@salmonb I have tested locally (and also in showcase) and it sounds working.

Could you provide me the GWT code in order to reproduce locally?

EDIT: Showcase: https://pepstock-org.github.io/Charba-Showcase/index.html?gallery=area

stockiNail commented 2 years ago

@salmonb I think I found the issue. CHARBA 3.3 is leveraging on CHART.JS 2.94 where the default value of fill option was true therefore you didn't have to set it. But in CHARBA 5.1 CHART.JS 3.7.1 is embedded and as of CHART.JS version 3, the fill option changed the default to false.

I think this is the reason why your stack area is not filled. Anyway it could be better that StackedAreaDataset class will set fill option to true by default. I'll add it in next days.

In the meanwhile, you could set the fill, as following: dataset.setFill(true); or dataset.setFill(Fill.ORIGIN);.

Let me know if it works.

salmonb commented 2 years ago

I was about to provide you the code but you found the problem even before!

The background color is back indeed when I call dataset.setFill(true);

Well spotted, thank you!

stockiNail commented 2 years ago

Fine! I want to add the fill option to true in the StackAreaDataset in order to avoid to set the fill option, being an area chart. After that, I'll close the issue. Thank you

stockiNail commented 2 years ago

@salmonb Pushed the setting of initial value to true of fill option in the StackAreaChart in order to avoid to set separately. Available in the master and then in next release.