]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Add color to financial time series sample (#5661)
authorTom Pullen <tpullen21@gmail.com>
Wed, 8 Aug 2018 16:44:53 +0000 (17:44 +0100)
committerSimon Brunel <simonbrunel@users.noreply.github.com>
Wed, 8 Aug 2018 16:44:53 +0000 (18:44 +0200)
samples/scales/time/financial.html

index 792eef55306f333ead2bfd6d083dfd20db6e4a1c..b261b898661a820c2ce1e847443cc23dbe9c90d0 100644 (file)
                var ctx = document.getElementById('chart1').getContext('2d');
                ctx.canvas.width = 1000;
                ctx.canvas.height = 300;
+
+               var color = Chart.helpers.color;
                var cfg = {
                        type: 'bar',
                        data: {
                                labels: labels,
                                datasets: [{
                                        label: 'CHRT - Chart.js Corporation',
+                                       backgroundColor: color(window.chartColors.red).alpha(0.5).rgbString(),
+                                       borderColor: window.chartColors.red,
                                        data: data,
                                        type: 'line',
                                        pointRadius: 0,