Chart.js/docs
jachstet-sea f8724b1b7d
Fix legend.md markdown syntax (#7034)
* Fix legend.md markdown syntax

Somehow the markdown of a table in the legend.md file was broken ...

* Update legend.md

forgot to add the second option
2020-01-30 19:27:53 -05:00
..
axes Scriptable tick fonts (#6939) 2020-01-13 19:33:46 -05:00
charts Allow specifying spanGaps as number (max distance) (#6993) 2020-01-21 18:33:27 -05:00
configuration Fix legend.md markdown syntax (#7034) 2020-01-30 19:27:53 -05:00
developers Move location of dataset options (#6955) 2020-01-13 19:39:30 -05:00
general Internal data by axis instead of scale id (#6912) 2020-01-06 07:22:18 -05:00
getting-started Remove unused helpers (#7039) 2020-01-30 19:23:40 -05:00
notes
README.md Convert axis options from arrays to objects (#6773) 2019-11-21 18:46:49 -05:00
style.css
SUMMARY.md Allow pre-parsed data (to scale id's) (#6768) 2019-12-06 19:47:00 -05: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: {
            y: {
                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.