Chart.js/docs/samples/information.md
Igor Lukanin 69175847ef
Updated docs (why Chart.js + getting started + step-by-step guide) (#10816)
* Update docs

* Minor fixes

* Replace screenshots with live demos

* Replace the last screenshot with a live demo

* Bring back images

* Bring back images #2

* Remove unnecessary files

* Apply suggestions from code review

Co-authored-by: Jacco van den Berg <jaccoberg2281@gmail.com>

* Very last tiny fixes

Co-authored-by: Jacco van den Berg <jaccoberg2281@gmail.com>
2022-11-11 16:37:13 -05:00

16 lines
1.4 KiB
Markdown

# Chart.js Samples
You can navigate through the samples via the sidebar.
Alternatively, you can run them locally. To do so, clone the [Chart.js repository](https://github.com/chartjs/Chart.js) from GitHub, run `pnpm ci` to install all packages, then run `pnpm run docs:dev` to build the documentation. As soon as the build is done, you can go to [localhost:8080/samples](http://localhost:8080/samples/) to see the samples.
## Out of the box working samples
These samples are made for demonstration purposes only. They won't work out of the box if you copy paste them into your own website. This is because of how the docs are getting built. Some boilerplate code gets hidden.
For a sample that can be copied and pasted and used directly you can check the [usage page](../getting-started/usage.md).
## Autogenerated data
The data used in the samples is autogenerated using custom functions. These functions do not ship with the library, for more information about this you can check the [utils page](./utils.md).
## Actions block
The samples have an `actions` code block. These actions are not part of Chart.js. They are internally transformed to separate buttons together with `onClick` listeners by a plugin we use in the documentation. To implement such actions yourself you can make some buttons and add `onClick` event listeners to them. Then in these event listeners you can call your variable in which you made the chart and do the logic that the button is supposed to do.