1- import type { ChartJsProviderInterface , ChartJsService , DirectiveScope } from '../src/angular-chart' ;
2- import type { ActiveElement } from 'chart.js' ;
1+ // / <reference types="angular" />
2+ import type { ChartJsProviderInterface } from '../src/angular-chart' ;
3+ import type { ActiveElement } from 'chart.js' ;
34
45interface ExampleScope extends angular . IScope {
56 labels : ( string | string [ ] ) [ ] ;
@@ -36,6 +37,7 @@ interface NoDataScope extends ExampleScope {
3637( ( ) => {
3738 'use strict' ;
3839
40+ const angular = ( window as any ) . angular as angular . IAngularStatic ;
3941 const app = angular . module ( 'examples' , [ 'chart.js' , 'ui.bootstrap' ] ) ;
4042
4143 app . config ( [ 'ChartJsProvider' , ( ChartJsProvider : ChartJsProviderInterface ) => {
@@ -62,7 +64,8 @@ interface NoDataScope extends ExampleScope {
6264 } ) ;
6365 ChartJsProvider . setOptions ( 'bubble' , {
6466 plugins : {
65- tooltip : { enabled : false } ,
67+ legend : { display : false } ,
68+ tooltip : { enabled : false } ,
6669 } ,
6770 } ) ;
6871 } ] ) ;
@@ -104,7 +107,7 @@ interface NoDataScope extends ExampleScope {
104107 console . log ( 'No point' ) ;
105108 }
106109 } ;
107- $scope . datasetOverride = [ { yAxisID : 'y-axis-1' } , { yAxisID : 'y-axis-2' } ] ;
110+ $scope . datasetOverride = [ { yAxisID : 'y-axis-1' } , { yAxisID : 'y-axis-2' } ] ;
108111
109112 $scope . options = {
110113 tension : 0.4 ,
@@ -127,7 +130,7 @@ interface NoDataScope extends ExampleScope {
127130 app . controller ( 'BarCtrl' , [ '$scope' , ( $scope : ExampleScope ) => {
128131 $scope . options = {
129132 plugins : {
130- legend : { display : true } ,
133+ legend : { display : true } ,
131134 } ,
132135 } ;
133136 $scope . labels = [ '2006' , '2007' , '2008' , '2009' , '2010' , '2011' , '2012' ] ;
@@ -152,7 +155,7 @@ interface NoDataScope extends ExampleScope {
152155 $scope . data = [ 300 , 500 , 100 ] ;
153156 $scope . options = {
154157 plugins : {
155- legend : { display : false } ,
158+ legend : { display : false } ,
156159 } ,
157160 } ;
158161 } ] ) ;
@@ -165,7 +168,7 @@ interface NoDataScope extends ExampleScope {
165168 $scope . data = [ 300 , 500 , 100 , 40 , 120 ] ;
166169 $scope . options = {
167170 plugins : {
168- legend : { display : false } ,
171+ legend : { display : false } ,
169172 } ,
170173 } ;
171174 } ] ) ;
@@ -190,7 +193,7 @@ interface NoDataScope extends ExampleScope {
190193 ] ;
191194 $scope . options = {
192195 plugins : {
193- legend : { display : false } ,
196+ legend : { display : false } ,
194197 } ,
195198 } ;
196199
@@ -256,6 +259,7 @@ interface NoDataScope extends ExampleScope {
256259 label : 'Bar chart' ,
257260 borderWidth : 1 ,
258261 type : 'bar' ,
262+ backgroundColor : 'rgba(69, 183, 205, 0.2)' ,
259263 } ,
260264 {
261265 label : 'Line chart' ,
@@ -297,7 +301,7 @@ interface NoDataScope extends ExampleScope {
297301 ] ;
298302 $scope . options = {
299303 plugins : {
300- legend : { display : false } ,
304+ legend : { display : false } ,
301305 } ,
302306 } ;
303307 $scope . randomize = ( ) => {
@@ -336,14 +340,15 @@ interface NoDataScope extends ExampleScope {
336340 $interval ( createChart , 2000 ) ;
337341
338342 function createChart ( ) {
339- $scope . data = [ ] ;
343+ const data = [ ] ;
340344 for ( let i = 0 ; i < 50 ; i ++ ) {
341- $scope . data . push ( [ {
345+ data . push ( {
342346 x : randomScalingFactor ( ) ,
343347 y : randomScalingFactor ( ) ,
344348 r : randomRadius ( ) ,
345- } ] ) ;
349+ } ) ;
346350 }
351+ $scope . data = [ data ] ;
347352 }
348353
349354 function randomScalingFactor ( ) {
0 commit comments