Chart.js/docs
Simon Brunel e3f3b8978b Add gulp unittest --coverage argument (#4075)
Coverage data are now generated by running `gulp unittest` with the `--coverage` argument: unit tests are then executed a single time on Travis. The gulp `coverage` task has been removed and `karma.coverage.conf.ci.js` merged into `karma.conf.ci.js`.

Update documentation with gulp commands (and remove them from `README.md`) and remove unused `config.jshintrc` (oversight from #3256). Delete `thankyou.md` which has been merged into `README.md`.
2017-03-25 18:26:45 +01:00
..
axes Zero line dash options (#4019) 2017-03-21 06:38:09 -04:00
charts Update the docs structure/content to use GitBook (#3751) 2017-03-20 20:36:54 -04:00
configuration Update the docs structure/content to use GitBook (#3751) 2017-03-20 20:36:54 -04:00
developers Add gulp unittest --coverage argument (#4075) 2017-03-25 18:26:45 +01:00
general Update the docs structure/content to use GitBook (#3751) 2017-03-20 20:36:54 -04:00
getting-started Update the docs structure/content to use GitBook (#3751) 2017-03-20 20:36:54 -04:00
notes Update the docs structure/content to use GitBook (#3751) 2017-03-20 20:36:54 -04:00
README.md Update the docs structure/content to use GitBook (#3751) 2017-03-20 20:36:54 -04:00
style.css Update the docs structure/content to use GitBook (#3751) 2017-03-20 20:36:54 -04:00
SUMMARY.md Update the docs structure/content to use GitBook (#3751) 2017-03-20 20:36:54 -04:00

Chart.js

Chart.js on 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.