Re:Chartist: Simple Responsive Charts in SVG
by llimllib on Sunday October 30, 2022 @08:15AM
(#33393748)
I wish the author all the best in developing his library; at the moment it seems quite incomplete, so if you want SVG charts today, I recommend Observable Plot[1] or Vega-Lite[2]
Re:Chartist: Simple Responsive Charts in SVG
by llimllib on Sunday October 30, 2022 @09:59AM
(#33394563)
Yes I did, chart libraries have a very large surface to cover and that's not a massive list of examples, relative to what you will find for the libraries I mentioned
Re:Chartist: Simple Responsive Charts in SVG
by MilStdJunkie on Sunday October 30, 2022 @02:46PM
(#33397332)
I did, it's still a bit short of the good stuff, but I do like the cut of his jib.
I second Vega for the really hard-to-source graph types like geo graphs and stats plots, even though Vega support on Kroki has been dodgy if I use the remote API. Not really Vega's fault there, aside from it being a little (understandably!) verbose.
Re:Chartist: Simple Responsive Charts in SVG
by AdriaanvRossum on Sunday October 30, 2022 @08:30AM
(#33393869)
> It's important to understand that one of the main intentions of Chartist is to rely on standards rather than providing it's own solution to a problem which is already solved by those standards.
This is a great intention. Let the browser solve the issues that already have solutions. Well done.
Re:Chartist: Simple Responsive Charts in SVG
by IshKebab on Sunday October 30, 2022 @09:20AM
(#33394267)
A great intention all else being equal. Unfortunately all else is not equal in this case. They say other libraries use "the wrong technology" (canvas). In my opinion this uses the wrong technology. SVG is much slower than canvas as soon as you have a few thousand points.
This might be fine for very small graphs but canvas is better in general.
Re:Chartist: Simple Responsive Charts in SVG
by rikroots on Sunday October 30, 2022 @09:42AM
(#33394445)
I believe SVG and canvas both have strengths, and weaknesses, and should be used where it makes the most sense for each technology. When it comes to charts, SVG has an obvious benefit in that it comes with responsiveness built-in, and is far easier to style (and animate) via CSS. More importantly, but rarely mentioned, SVG is far more accessibility-friendly than the canvas element[1].
That said, I was also surprised by the assertion "use the wrong technologies for illustration (canvas)". It takes a lot more work, but canvas based charts can be made to be responsive, interactive and accessible[2][3].
Re:Chartist: Simple Responsive Charts in SVG
by adrianba on Sunday October 30, 2022 @10:32AM
(#33394803)
I've been using Chartist for the last couple of years for line charts. The ability to style with CSS has been a useful benefit. For example, I have dark/light mode just by setting a class on the body element of the page and this flows throughout the site including the graphs with no extra effort.
Re:Chartist: Simple Responsive Charts in SVG
by onetimeuse1234 on Sunday October 30, 2022 @08:41AM
(#33393965)
For a library producing visuals, the README.md doesn't seem to show a single chart example. Instead you have to click links which load codesandbox.io pages for which you have to wait until the code is executed and rendered. Suggestion: include pre-rendered images directly in the click-to-open sections, next to the codesandbox.io links.
Re:Chartist: Simple Responsive Charts in SVG
by extra88 on Sunday October 30, 2022 @11:36AM
(#33395347)
I'm puzzled about why each axis label is in a <span> wrapped in a <foreignobject> instead of just a <text>. For the pie and donut examples I checked, <text> elements were used for their labels.
[1]: https://github.com/observablehq/plot
[2]: https://vega.github.io/vega-lite/
There is a massive list [1].
[1] https://github.com/chartist-js/chartist#examples
I second Vega for the really hard-to-source graph types like geo graphs and stats plots, even though Vega support on Kroki has been dodgy if I use the remote API. Not really Vega's fault there, aside from it being a little (understandably!) verbose.
This is a great intention. Let the browser solve the issues that already have solutions. Well done.
This might be fine for very small graphs but canvas is better in general.
That said, I was also surprised by the assertion "use the wrong technologies for illustration (canvas)". It takes a lot more work, but canvas based charts can be made to be responsive, interactive and accessible[2][3].
[1] - CSS-tricks article on SVG and accessibility - https://css-tricks.com/accessible-svgs/
[2] - I outlined how someone could build a charting library based on my JS canvas library in a couple of lessons starting here - https://scrawl-v8.rikweb.org.uk/learn/eighth-lesson/
[3] - The final result from the above lessons can be seen here - https://codepen.io/kaliedarik/project/editor/AMVKPx - suggested improvements to the lessons, and the UX of the result, are always welcome.
https://gionkunz.github.io/chartist-js/
EDIT: but that marketing site is for the 0.11 version, you have to find the expandable >Examples inside the readme...
There's also a lot of unnecessary inline CSS.