chartjs / chartjs-plugin-annotation

Annotation plugin for Chart.js
MIT License
606 stars 328 forks source link

Added usage information #761

Closed DarkTrick closed 2 years ago

DarkTrick commented 2 years ago
DarkTrick commented 2 years ago

Currently it's very difficult to get things working if you're a newcomer. This change is trying to improve that. As I'm using react + typescript I could only add examples for this environment. Hopefully more examples will follow.

LeeLenaleee commented 2 years ago

It is already documented here how to integrate the annotation plugin within chart.js.

This information is for the zoom, annotation, deferred and datalabels plugin in the same place as it is within chart.js itself.

Also I don't think that different frameworks should all be documented. Since they all fall under the category of bundlers. Only when there is a tool that does it totally different should it be added in my oppinion.

And all the examples in the documentation are object based annotations instead of declaring them as an array. So for consistency if kurkle or stockinail think differently about adding this, I would think its better to change to object style annotation instead of aray style

LeeLenaleee commented 2 years ago

@stockiNail as I described in my first comment do we want this, I have the feeling that current way of documentation is better. Since if we start going this route you could argue you need at least 3 react samples (1 functional component, 1 class and 1 with create element). While all the frameworks are basically the same with importing and that is well documented on the integration page.

stockiNail commented 2 years ago

as I described in my first comment do we want this, I have the feeling that current way of documentation is better. Since if we start going this route you could argue you need at least 3 react samples (1 functional component, 1 class and 1 with create element). While all the frameworks are basically the same with importing and that is well documented on the integration page.

I have applied the review anyway! But I agree with you. The risk is to have samples for every JS frameworks.

LeeLenaleee commented 2 years ago

Closing this since the neccesarry information can be found in the integration page.

Way of importing for frameworks is at the moment to my knowledge all the same and falls under the bundler category. If there is a framework that works in a different way we can add it.

But replicating the bunder import for all the used frameworks is something I don't see as usefull and only makes the docs too full so people will skip even more through it.

DarkTrick commented 2 years ago

Thank you very much for the consideration!

It is already documented here how to integrate the annotation plugin within chart.js.

This might indeed be already enough. Perhaps I'm viewing the website in a wrong way, but I feel this information is quite hidden (the tiny link on the bottom right). I would expect that information to be within the getting started section.

What would you think about merging "getting started", "integration" and "usage" into one bigger "getting started" page.