News for hackers. Stuff that matters.
Re:Charts.css: CSS data visualization framework by tech-historian on Sunday October 30, 2022 @10:03AM (#33394592)
Since multiple chart libraries are on HN's first page right now, thought I'd ask a question. Working on a project that requires a very specific chart type, which almost no chart frameworks provide. Anyone know of a library that offers:

- VERTICAL 100% stacked area chart

- Images can be used as background for each series

- Dynamic - mouseover displays information when hovering over a slice of the chart

The only thing I can find is this [1] but it seems to lack key features. Currently I've resorted to building a custom chart in SVG with js but it's pretty rough.

[1] https://docs.anychart.com/Basic_Charts/Stacked/Value/Vertica...

Re:Charts.css: CSS data visualization framework by cube2222 on Sunday October 30, 2022 @10:32AM (#33394800)
I've seen the other responses already contain ready solutions, however in general, if you're in need of custom/non-standard graphs, then D3.js is a great library for constructing them, providing many common building blocks and a declarative API.
Re:Charts.css: CSS data visualization framework by beckingz on Sunday October 30, 2022 @10:41AM (#33394865)
Do note that D3.js is a lower level library, so you will end up writing a lot of code to build a chart.
Re:Charts.css: CSS data visualization framework by tech-historian on Sunday October 30, 2022 @11:08AM (#33395089)
D3 could be the right tool for this. When I first used D3 years ago, it seemed so incredibly overkill. But maybe it's just right for something like this project, with these specific requirements.
Re:Charts.css: CSS data visualization framework by da25 on Sunday October 30, 2022 @10:14AM (#33394675)
Re:Charts.css: CSS data visualization framework by owlninja on Sunday October 30, 2022 @10:16AM (#33394691)
Yep +1 - just swap xAxis and yAxis and you get really close, and echarts has lots of customization. I just don't think you'll get images for a background with it.
Re:Charts.css: CSS data visualization framework by tech-historian on Sunday October 30, 2022 @11:05AM (#33395055)
Will look into this, thanks.
Re:Charts.css: CSS data visualization framework by tech-historian on Sunday October 30, 2022 @10:18AM (#33394696)
Offhand do you know if that offers:

- 100% stacked area (also known as percentage stacked area)

- inverted axis (so it's vertical, not horizontal)

Re:Charts.css: CSS data visualization framework by cush on Sunday October 30, 2022 @10:46AM (#33394907)
Why wouldn't D3 work here?
Re:Charts.css: CSS data visualization framework by tech-historian on Sunday October 30, 2022 @11:08AM (#33395082)
When I first used D3 years ago, it seemed so incredibly overkill. But maybe it's just right for something like this project, with these specific requirements.
Re:Charts.css: CSS data visualization framework by andreykh on Monday October 31, 2022 @04:06AM (#33403154)
Looks like it's all possible that you mentioned:

1) Create a 100% stacked area chart https://www.anychart.com/blog/2020/06/10/stacked-area-chart-...

OR

https://docs.anychart.com/Basic_Charts/Area_Chart + https://docs.anychart.com/Basic_Charts/Stacked/Percent/Area_...

2) Change chart = anychart.area(); to chart = anychart.verticalArea();

3) Tune it up digging into the documentation, for example: https://docs.anychart.com/Common_Settings/ https://docs.anychart.com/Appearance_Settings/ https://docs.anychart.com/Graphics/ etc.

4) Ask Support if not sure re anything (usually pretty fast and helpful): https://www.anychart.com/support/