|
1 |
| -# Chart.js |
2 |
| - |
3 |
| -[](https://chartjs-slack.herokuapp.com/) |
4 |
| - |
5 |
| -## Installation |
6 |
| - |
7 |
| -You can download the latest version of Chart.js from the [GitHub releases](https://github.com/chartjs/Chart.js/releases/latest) or use a [Chart.js CDN](https://www.jsdelivr.com/package/npm/chart.js). Detailed installation instructions can be found on the [installation](./getting-started/installation.md) page. |
8 |
| - |
9 |
| -## Creating a Chart |
10 |
| - |
11 |
| -It's easy to get started with Chart.js. All that's required is the script included in your page along with a single `<canvas>` node to render the chart. |
12 |
| - |
13 |
| -In this example, we create a bar chart for a single dataset and render that in our page. You can see all the ways to use Chart.js in the [usage documentation](./getting-started/usage.md). |
14 |
| -```html |
15 |
| -<canvas id="myChart" width="400" height="400"></canvas> |
16 |
| -<script> |
17 |
| -var ctx = document.getElementById('myChart').getContext('2d'); |
18 |
| -var myChart = new Chart(ctx, { |
19 |
| - type: 'bar', |
20 |
| - data: { |
21 |
| - labels: ['Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange'], |
22 |
| - datasets: [{ |
23 |
| - label: '# of Votes', |
24 |
| - data: [12, 19, 3, 5, 2, 3], |
25 |
| - backgroundColor: [ |
26 |
| - 'rgba(255, 99, 132, 0.2)', |
27 |
| - 'rgba(54, 162, 235, 0.2)', |
28 |
| - 'rgba(255, 206, 86, 0.2)', |
29 |
| - 'rgba(75, 192, 192, 0.2)', |
30 |
| - 'rgba(153, 102, 255, 0.2)', |
31 |
| - 'rgba(255, 159, 64, 0.2)' |
32 |
| - ], |
33 |
| - borderColor: [ |
34 |
| - 'rgba(255, 99, 132, 1)', |
35 |
| - 'rgba(54, 162, 235, 1)', |
36 |
| - 'rgba(255, 206, 86, 1)', |
37 |
| - 'rgba(75, 192, 192, 1)', |
38 |
| - 'rgba(153, 102, 255, 1)', |
39 |
| - 'rgba(255, 159, 64, 1)' |
40 |
| - ], |
41 |
| - borderWidth: 1 |
42 |
| - }] |
43 |
| - }, |
44 |
| - options: { |
45 |
| - scales: { |
46 |
| - y: { |
47 |
| - beginAtZero: true |
48 |
| - } |
49 |
| - } |
50 |
| - } |
51 |
| -}); |
52 |
| -</script> |
53 |
| -``` |
54 |
| - |
55 |
| -## Contributing |
56 |
| - |
57 |
| -Before submitting an issue or a pull request to the project, please take a moment to look over the [contributing guidelines](./developers/contributing.md) first. |
58 |
| - |
59 |
| -For support using Chart.js, please post questions with the [`chartjs` tag on Stack Overflow](https://stackoverflow.com/questions/tagged/chartjs). |
60 |
| - |
61 |
| -## License |
62 |
| - |
63 |
| -Chart.js is available under the [MIT license](https://opensource.org/licenses/MIT). |
| 1 | +# Website |
| 2 | + |
| 3 | +This website is built using [Docusaurus 2](https://v2.docusaurus.io/), a modern static website generator. |
| 4 | + |
| 5 | +### Installation |
| 6 | + |
| 7 | +``` |
| 8 | +$ npm install |
| 9 | +``` |
| 10 | + |
| 11 | +### Local Development |
| 12 | + |
| 13 | +``` |
| 14 | +$ npm run start |
| 15 | +``` |
| 16 | + |
| 17 | +This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server. |
| 18 | + |
| 19 | +### Build |
| 20 | + |
| 21 | +``` |
| 22 | +$ npm run build |
| 23 | +``` |
| 24 | + |
| 25 | +This command generates static content into the `build` directory and can be served using any static contents hosting service. |
| 26 | + |
| 27 | +### Deployment |
| 28 | + |
| 29 | +``` |
| 30 | +$ GIT_USER=<Your GitHub username> USE_SSH=true npm run deploy |
| 31 | +``` |
| 32 | + |
| 33 | +If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. |
0 commit comments