Chart.js/docs
2019-03-03 10:26:40 +01:00
..
axes Fix document errors related to ticks (#6099) 2019-03-01 18:03:20 -05:00
charts New weight option for pie and doughnut charts (#5951) 2019-02-27 23:06:54 +01:00
configuration Add onLeave to legend config docs (#6088) 2019-02-25 08:59:48 +01:00
developers Add a note about how to include an example against master (#6107) 2019-03-03 10:26:40 +01:00
general Omit inconsistent note about scriptable options (#6026) 2019-01-30 09:24:26 +01:00
getting-started Initialize date adapter with chart options (#6016) 2019-02-21 08:11:32 +01:00
notes Revamp the README.md and add link to the awesome list (#6096) 2019-03-01 09:13:21 +01:00
README.md Fix typos and make the docs consistent (#6020) 2019-01-29 13:34:16 +01:00
style.css Document the new filling modes and options (#4251) 2017-05-13 14:13:05 +02:00
SUMMARY.md Revamp the README.md and add link to the awesome list (#6096) 2019-03-01 09:13:21 +01:00

Chart.js

slack

Installation

You can download the latest version of Chart.js from the GitHub releases or use a Chart.js CDN. Detailed installation instructions can be found on the installation page.

Creating a Chart

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.

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.

<canvas id="myChart" width="400" height="400"></canvas>
<script>
var ctx = document.getElementById('myChart').getContext('2d');
var myChart = new Chart(ctx, {
    type: 'bar',
    data: {
        labels: ['Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange'],
        datasets: [{
            label: '# of Votes',
            data: [12, 19, 3, 5, 2, 3],
            backgroundColor: [
                'rgba(255, 99, 132, 0.2)',
                'rgba(54, 162, 235, 0.2)',
                'rgba(255, 206, 86, 0.2)',
                'rgba(75, 192, 192, 0.2)',
                'rgba(153, 102, 255, 0.2)',
                'rgba(255, 159, 64, 0.2)'
            ],
            borderColor: [
                'rgba(255, 99, 132, 1)',
                'rgba(54, 162, 235, 1)',
                'rgba(255, 206, 86, 1)',
                'rgba(75, 192, 192, 1)',
                'rgba(153, 102, 255, 1)',
                'rgba(255, 159, 64, 1)'
            ],
            borderWidth: 1
        }]
    },
    options: {
        scales: {
            yAxes: [{
                ticks: {
                    beginAtZero: true
                }
            }]
        }
    }
});
</script>

Contributing

Before submitting an issue or a pull request to the project, please take a moment to look over the contributing guidelines first.

For support using Chart.js, please post questions with the chartjs tag on Stack Overflow.

License

Chart.js is available under the MIT license.