Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bar & Pie charts are not supported in abstract chart #99

Open
xpopy opened this issue Sep 9, 2022 · 2 comments
Open

Bar & Pie charts are not supported in abstract chart #99

xpopy opened this issue Sep 9, 2022 · 2 comments

Comments

@xpopy
Copy link
Contributor

xpopy commented Sep 9, 2022

The readme says:

When drawing complex scientific charts, regular line/bar/pie chart libraries are not very useful. This aim of this library is to enable any chart to be drawn, no matter how complex

Stating that bar and pie charts would be possible with this library, however there is no clear way of creating these in abstract chart.

I managed to make this using the current functionality of abstract-chart:

bild

However, as far as I know,

  1. there's no way to set the fill colour of the pie slices
  2. there's no way to hide the axis completely
  3. the ChartPoint's label is weirdly offset
  4. the pie gets squished even though both width and height is set to 400.

I believe DIAQ has implemented coloured areas locally, so that could be used as reference.

As for bar charts, I believe they suffer the same problems as above.

It would also be quite nice to have examples of a pie chart and bar chart to ease development for other devs looking to use this library.

@jonaskello
Copy link
Member

IIRC the basic idea in abstract-chart is that you draw lines etc. onto a coordinate system that is represented as the axes of the diagram you are drawing. Also it is possible to have multiple axes and so multiple coordinate systems.

A pie chart does not really have any axes so for that reason I would say abstract-chart might not be a good fit for pie charts. Of course it would still be possible but maybe not worth the trouble.

@jonaskello
Copy link
Member

jonaskello commented Sep 9, 2022

Actually abstract-chart may not be the best name for the package. Perhaps abstract-graph would be a better fit.

What is a chart? Visual representations of data. They may take many different forms, and style data in different ways. Graphs have a narrower definition. They use data plotted on a grid with axes representing two variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants