Skip to content

Commit

Permalink
Use Chart.min.js in samples (chartjs#5958)
Browse files Browse the repository at this point in the history
Samples are supposed to show good practices and in most cases we don't use the time scale but require `Chart.bundle.js`, which is not correct. Instead, we should require the non-bundled version in its minified version (`Chart.min.js`). Paradoxically, time based examples don't use `Chart.bundle.js` but require moment manually side to `Chart.min.js`, which IMO is also the correct way since it allows users to configure and use moment globally (TZ, locales, etc.) and doesn't enforce a specific moment version.

Also remove the `data-labelling.html` example because we now have an [official plugin](https://github.com/chartjs/chartjs-plugin-datalabels) that implements this feature and don't want to deal with user custom code anymore.
  • Loading branch information
simonbrunel authored and etimberg committed Jan 6, 2019
1 parent 60799aa commit e3f233f
Show file tree
Hide file tree
Showing 55 changed files with 54 additions and 188 deletions.
131 changes: 0 additions & 131 deletions samples/advanced/data-labelling.html

This file was deleted.

2 changes: 1 addition & 1 deletion samples/advanced/progress-bar.html
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<title> Animation Callbacks </title>
<script src="../../dist/Chart.bundle.js"></script>
<script src="../../dist/Chart.min.js"></script>
<script src="../utils.js"></script>
<style>
canvas {
Expand Down
2 changes: 1 addition & 1 deletion samples/charts/area/line-boundaries.html
Expand Up @@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>area > boundaries | Chart.js sample</title>
<link rel="stylesheet" type="text/css" href="../../style.css">
<script src="../../../dist/Chart.bundle.js"></script>
<script src="../../../dist/Chart.min.js"></script>
<script src="../../utils.js"></script>
<script src="analyser.js"></script>
</head>
Expand Down
2 changes: 1 addition & 1 deletion samples/charts/area/line-datasets.html
Expand Up @@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>area > datasets | Chart.js sample</title>
<link rel="stylesheet" type="text/css" href="../../style.css">
<script src="../../../dist/Chart.bundle.js"></script>
<script src="../../../dist/Chart.min.js"></script>
<script src="../../utils.js"></script>
<script src="analyser.js"></script>
</head>
Expand Down
2 changes: 1 addition & 1 deletion samples/charts/area/line-stacked.html
Expand Up @@ -3,7 +3,7 @@

<head>
<title>Line Chart</title>
<script src="../../../dist/Chart.bundle.js"></script>
<script src="../../../dist/Chart.min.js"></script>
<script src="../../utils.js"></script>
<style>
canvas {
Expand Down
2 changes: 1 addition & 1 deletion samples/charts/area/radar.html
Expand Up @@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>area > radar | Chart.js sample</title>
<link rel="stylesheet" type="text/css" href="../../style.css">
<script src="../../../dist/Chart.bundle.js"></script>
<script src="../../../dist/Chart.min.js"></script>
<script src="../../utils.js"></script>
<script src="analyser.js"></script>
</head>
Expand Down
2 changes: 1 addition & 1 deletion samples/charts/bar/horizontal.html
Expand Up @@ -3,7 +3,7 @@

<head>
<title>Horizontal Bar Chart</title>
<script src="../../../dist/Chart.bundle.js"></script>
<script src="../../../dist/Chart.min.js"></script>
<script src="../../utils.js"></script>
<style>
canvas {
Expand Down
2 changes: 1 addition & 1 deletion samples/charts/bar/multi-axis.html
Expand Up @@ -3,7 +3,7 @@

<head>
<title>Bar Chart Multi Axis</title>
<script src="../../../dist/Chart.bundle.js"></script>
<script src="../../../dist/Chart.min.js"></script>
<script src="../../utils.js"></script>
<style>
canvas {
Expand Down
2 changes: 1 addition & 1 deletion samples/charts/bar/stacked-group.html
Expand Up @@ -3,7 +3,7 @@

<head>
<title>Stacked Bar Chart with Groups</title>
<script src="../../../dist/Chart.bundle.js"></script>
<script src="../../../dist/Chart.min.js"></script>
<script src="../../utils.js"></script>
<style>
canvas {
Expand Down
2 changes: 1 addition & 1 deletion samples/charts/bar/stacked.html
Expand Up @@ -3,7 +3,7 @@

<head>
<title>Stacked Bar Chart</title>
<script src="../../../dist/Chart.bundle.js"></script>
<script src="../../../dist/Chart.min.js"></script>
<script src="../../utils.js"></script>
<style>
canvas {
Expand Down
2 changes: 1 addition & 1 deletion samples/charts/bar/vertical.html
Expand Up @@ -3,7 +3,7 @@

<head>
<title>Bar Chart</title>
<script src="../../../dist/Chart.bundle.js"></script>
<script src="../../../dist/Chart.min.js"></script>
<script src="../../utils.js"></script>
<style>
canvas {
Expand Down
2 changes: 1 addition & 1 deletion samples/charts/bubble.html
Expand Up @@ -3,7 +3,7 @@

<head>
<title>Bubble Chart</title>
<script src="../../dist/Chart.bundle.js"></script>
<script src="../../dist/Chart.min.js"></script>
<script src="../utils.js"></script>
<style type="text/css">
canvas{
Expand Down
2 changes: 1 addition & 1 deletion samples/charts/combo-bar-line.html
Expand Up @@ -3,7 +3,7 @@

<head>
<title>Combo Bar-Line Chart</title>
<script src="../../dist/Chart.bundle.js"></script>
<script src="../../dist/Chart.min.js"></script>
<script src="../utils.js"></script>
<style>
canvas {
Expand Down
2 changes: 1 addition & 1 deletion samples/charts/doughnut.html
Expand Up @@ -3,7 +3,7 @@

<head>
<title>Doughnut Chart</title>
<script src="../../dist/Chart.bundle.js"></script>
<script src="../../dist/Chart.min.js"></script>
<script src="../utils.js"></script>
<style>
canvas {
Expand Down
2 changes: 1 addition & 1 deletion samples/charts/line/basic.html
Expand Up @@ -3,7 +3,7 @@

<head>
<title>Line Chart</title>
<script src="../../../dist/Chart.bundle.js"></script>
<script src="../../../dist/Chart.min.js"></script>
<script src="../../utils.js"></script>
<style>
canvas{
Expand Down
2 changes: 1 addition & 1 deletion samples/charts/line/interpolation-modes.html
Expand Up @@ -3,7 +3,7 @@

<head>
<title>Line Chart - Cubic interpolation mode</title>
<script src="../../../dist/Chart.bundle.js"></script>
<script src="../../../dist/Chart.min.js"></script>
<script src="../../utils.js"></script>
<style>
canvas{
Expand Down
2 changes: 1 addition & 1 deletion samples/charts/line/line-styles.html
Expand Up @@ -3,7 +3,7 @@

<head>
<title>Line Styles</title>
<script src="../../../dist/Chart.bundle.js"></script>
<script src="../../../dist/Chart.min.js"></script>
<script src="../../utils.js"></script>
<style>
canvas{
Expand Down
2 changes: 1 addition & 1 deletion samples/charts/line/multi-axis.html
Expand Up @@ -3,7 +3,7 @@

<head>
<title>Line Chart Multiple Axes</title>
<script src="../../../dist/Chart.bundle.js"></script>
<script src="../../../dist/Chart.min.js"></script>
<script src="../../utils.js"></script>
<style>
canvas {
Expand Down
2 changes: 1 addition & 1 deletion samples/charts/line/point-sizes.html
Expand Up @@ -3,7 +3,7 @@

<head>
<title>Different Point Sizes</title>
<script src="../../../dist/Chart.bundle.js"></script>
<script src="../../../dist/Chart.min.js"></script>
<script src="../../utils.js"></script>
<style>
canvas {
Expand Down
2 changes: 1 addition & 1 deletion samples/charts/line/point-styles.html
Expand Up @@ -3,7 +3,7 @@

<head>
<title>Line Chart</title>
<script src="../../../dist/Chart.bundle.js"></script>
<script src="../../../dist/Chart.min.js"></script>
<script src="../../utils.js"></script>
<style>
canvas{
Expand Down
2 changes: 1 addition & 1 deletion samples/charts/line/skip-points.html
Expand Up @@ -3,7 +3,7 @@

<head>
<title>Line Chart</title>
<script src="../../../dist/Chart.bundle.js"></script>
<script src="../../../dist/Chart.min.js"></script>
<script src="../../utils.js"></script>
<style>
canvas {
Expand Down
2 changes: 1 addition & 1 deletion samples/charts/line/stepped.html
Expand Up @@ -3,7 +3,7 @@

<head>
<title>Stepped Line Chart</title>
<script src="../../../dist/Chart.bundle.js"></script>
<script src="../../../dist/Chart.min.js"></script>
<script src="../../utils.js"></script>
<style>
canvas {
Expand Down
2 changes: 1 addition & 1 deletion samples/charts/pie.html
Expand Up @@ -3,7 +3,7 @@

<head>
<title>Pie Chart</title>
<script src="../../dist/Chart.bundle.js"></script>
<script src="../../dist/Chart.min.js"></script>
<script src="../utils.js"></script>
</head>

Expand Down
2 changes: 1 addition & 1 deletion samples/charts/polar-area.html
Expand Up @@ -3,7 +3,7 @@

<head>
<title>Polar Area Chart</title>
<script src="../../dist/Chart.bundle.js"></script>
<script src="../../dist/Chart.min.js"></script>
<script src="../utils.js"></script>
<style>
canvas {
Expand Down
2 changes: 1 addition & 1 deletion samples/charts/radar-skip-points.html
Expand Up @@ -3,7 +3,7 @@

<head>
<title>Radar Chart</title>
<script src="../../dist/Chart.bundle.js"></script>
<script src="../../dist/Chart.min.js"></script>
<script src="../utils.js"></script>
<style>
canvas {
Expand Down
2 changes: 1 addition & 1 deletion samples/charts/radar.html
Expand Up @@ -3,7 +3,7 @@

<head>
<title>Radar Chart</title>
<script src="../../dist/Chart.bundle.js"></script>
<script src="../../dist/Chart.min.js"></script>
<script src="../utils.js"></script>
<style>
canvas {
Expand Down
2 changes: 1 addition & 1 deletion samples/charts/scatter/basic.html
Expand Up @@ -3,7 +3,7 @@

<head>
<title>Scatter Chart</title>
<script src="../../../dist/Chart.bundle.js"></script>
<script src="../../../dist/Chart.min.js"></script>
<script src="../../utils.js"></script>
<style>
canvas {
Expand Down
2 changes: 1 addition & 1 deletion samples/charts/scatter/multi-axis.html
Expand Up @@ -3,7 +3,7 @@

<head>
<title>Scatter Chart Multi Axis</title>
<script src="../../../dist/Chart.bundle.js"></script>
<script src="../../../dist/Chart.min.js"></script>
<script src="../../utils.js"></script>
<style>
canvas {
Expand Down
2 changes: 1 addition & 1 deletion samples/legend/point-style.html
Expand Up @@ -3,7 +3,7 @@

<head>
<title>Legend Point Style</title>
<script src="../../dist/Chart.bundle.js"></script>
<script src="../../dist/Chart.min.js"></script>
<script src="../utils.js"></script>
<style>
canvas {
Expand Down
2 changes: 1 addition & 1 deletion samples/legend/positioning.html
Expand Up @@ -3,7 +3,7 @@

<head>
<title>Legend Positions</title>
<script src="../../dist/Chart.bundle.js"></script>
<script src="../../dist/Chart.min.js"></script>
<script src="../utils.js"></script>
<style>
canvas {
Expand Down

0 comments on commit e3f233f

Please sign in to comment.