]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Update samples with some hidden datasets 1517/head
authorEvert Timberg <evert.timberg@gmail.com>
Wed, 7 Oct 2015 23:54:53 +0000 (19:54 -0400)
committerEvert Timberg <evert.timberg@gmail.com>
Wed, 7 Oct 2015 23:54:53 +0000 (19:54 -0400)
samples/bar.html
samples/combo-bar-line.html
samples/doughnut.html
samples/line-x-axis-filter.html
samples/line.html
samples/radar.html

index 1101602da77047f460d9a26cde43cd23009b0dc7..609f672f977c3b442a9fbf386abb49ea3c91557a 100644 (file)
@@ -45,6 +45,7 @@
                 backgroundColor: "rgba(220,220,220,0.5)",
                 data: [randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor()]
             }, {
+                hidden: true,
                 label: 'Dataset 2',
                 backgroundColor: "rgba(151,187,205,0.5)",
                 data: [randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor()]
index f2e936ab3817626241cb2239baddd0b8a60d0acd..b0a96f78ff7ea29c9c753c5bdd912379a9ec0f4d 100644 (file)
@@ -2,7 +2,7 @@
 <html>
 
 <head>
-    <title>Bar Chart</title>
+    <title>Combo Bar-Line Chart</title>
     <script src="../node_modules/jquery/dist/jquery.min.js"></script>
     <script src="../Chart.js"></script>
 </head>
                 borderColor: 'white',
                 borderWidth: 2
             }, {
-                type: 'bar',
+                type: 'line',
                 label: 'Dataset 2',
                 backgroundColor: "rgba(151,187,205,0.5)",
                 data: [randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor()],
                 borderColor: 'white',
                 borderWidth: 2
             }, {
-                type: 'line',
+                type: 'bar',
                 label: 'Dataset 3',
                 backgroundColor: "rgba(220,220,220,0.5)",
                 data: [randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor()]
index 728c8847ae80f8525cbff856174ccfd5aecdd4e0..3972fbc0cca9e14a012c8f3e0eeb078185fd8b90 100644 (file)
@@ -61,6 +61,7 @@
                     "#4D5360",
                 ],
             }, {
+                hidden: true,
                 data: [
                     randomScalingFactor(),
                     randomScalingFactor(),
index 8135dbafee47c38280d0eb221a4d5ce6984b85a9..508ed2b5c8e0f991811097a7226dec7ad5ed62a7 100644 (file)
@@ -54,8 +54,8 @@
                     xAxes: [{
                         display: true,
                         ticks: {
-                            callback: function(dataLabel, index) {
-                                return dataLabel;
+                            userCallback: function(dataLabel, index) {
+                                return index % 2 === 0 ? dataLabel : '';
                             }
                         }
                     }],
index 9e0cf17d78d4a95d87b3d47cb0979931ad3b811d..1179e6bcc63aa28ab396b7012541f082101865bc 100644 (file)
                     data: [randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor()],
                     fill: false,
                     borderDash: [5, 5],
+                }, {
+                    hidden: true,
+                    label: 'hidden dataset',
+                    data: [],
                 }, {
                     label: "My Second dataset",
                     data: [randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor()],
index c9b559aef9e160388bcde1c28c2f51610014f7d6..da45b3e8f242f812a5094a341d474302ea7fdf89 100644 (file)
                 backgroundColor: "rgba(220,220,220,0.2)",
                 pointBackgroundColor: "rgba(220,220,220,1)",
                 data: [null, randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor()]
+            }, {
+                label: 'Hidden dataset',
+                hidden: true,
+                data: [],
             }, {
                 label: "My Second dataset",
                 backgroundColor: "rgba(151,187,205,0.2)",
@@ -49,7 +53,7 @@
                 hoverPointBackgroundColor: "#fff",
                 pointHighlightStroke: "rgba(151,187,205,1)",
                 data: [null, randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor()]
-            }]
+            },]
         },
         options: {
             scale: {