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

Samples are hard to use #210

Open
jaysridhar opened this issue Dec 31, 2020 · 2 comments
Open

Samples are hard to use #210

jaysridhar opened this issue Dec 31, 2020 · 2 comments

Comments

@jaysridhar
Copy link

jaysridhar commented Dec 31, 2020

The samples are hard to use and hard to understand because of complexity.

  • First off, I could not find what "Utils" is and where it is defined.
  • You should absolutely provide a jsfiddle or codepen for each sample.
  • For instance, I tried to get round labels as demonstrated in the samples, but could not find how to do it. I was only able to get elliptical labels which is not what I want.
@benwinding
Copy link

Here's a good jsfiddle to use:
https://jsfiddle.net/simonbrunel/nqkzo4cp/

@simonbrunel
Copy link
Member

@jaysridhar Thank you for your feedback.

The samples are hard to use and hard to understand because of complexity.

Only the chart generation logic is a bit complex but the docs are about using the plugin, not Chart.js. And there is samples for different use cases and some can be a bit complex.

First off, I could not find what "Utils" is and where it is defined.

Utils are internal helpers shared between samples to setup the chart. They are not part of the plugin, neither the core library and you should probably not try to understand how these helpers work. If I'm not wrong, these methods are only used for the chart data and other core options, thus it should not complexify the understanding of the plugin options. Maybe I should find a better name.

Anyway, these methods are in /docs/samples/utils.js

You should absolutely provide a jsfiddle or codepen for each sample.

The plugin options used for each sample are available in the editor under the chart. You can edit these values to see how they impact the rendering. I will look how to generate a codepen from the sample snippets but I don't want to maintain them in 2 locations.

... I tried to get round labels as demonstrated in the samples ...

Unfortunately, this is not possible yet (see #166). In the samples, I used a good padding and font size to have nice looking labels.

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