@@ -80,7 +80,7 @@ define([
8080
8181 _set = {
8282 label : ( this . scaleShowLabelsBottom === true ) ? label : "" ,
83- backgroundColor : ( this . seriesColorReduceOpacity ) ? this . _hexToRgb ( color , "0.2" ) : this . _hexToRgb ( color , "0.2" ) ,
83+ backgroundColor : ( this . seriesColorReduceOpacity ) ? this . _hexToRgb ( color , "0.2" ) : color ,
8484 borderColor : ( this . seriesColorReduceOpacity ) ? this . _hexToRgb ( color , "0.5" ) : color ,
8585 pointColor : ( this . seriesColorReduceOpacity ) ? this . _hexToRgb ( color , "0.8" ) : color ,
8686 pointBorderColor : ( this . seriesColorReduceOpacity ) ? this . _hexToRgb ( color , "0.8" ) : color ,
@@ -110,18 +110,25 @@ define([
110110 _createChart : function ( data ) {
111111 logger . debug ( this . id + "._createChart" ) ;
112112
113+
113114 if ( this . _chart ) {
114115 this . _chart . stop ( ) ;
115116 this . _chart . data . datasets = data . datasets ;
116117 this . _chart . data . labels = data . labels ;
117118 this . _chart . update ( 1000 ) ;
118119 this . _chart . bindEvents ( ) ; // tooltips otherwise won't work
119120 } else {
120-
121+ logger . debug ( "stacked:" + this . isStacked ) ;
121122 this . _chart = new this . _chartJS ( this . _ctx , {
122123 type : "line" ,
123124 data : data ,
124125 options : {
126+ scales : {
127+ yAxes : [ {
128+ //If stacked is set to true, the Y-axis needs to be stacked for it to work
129+ stacked : this . isStacked
130+ } ]
131+ } ,
125132
126133 responsive : this . responsive ,
127134 responsiveAnimationDuration : ( this . responsiveAnimationDuration > 0 ? this . responsiveAnimationDuration : 0 ) ,
@@ -151,6 +158,9 @@ define([
151158 //Boolean - Whether to show vertical lines (except Y axis)
152159 scaleShowVerticalLines : this . scaleShowVerticalLines ,
153160
161+ //Boolean - Whether or not to render as a stacked chart
162+ stacked : this . isStacked ,
163+
154164 //Boolean - Whether to show a dot for each point
155165 pointDot : this . pointDot ,
156166
0 commit comments