2014-06-29 19:36:25 +02:00
/ * !
* Chart . js
* http : //chartjs.org/
2015-06-04 03:45:14 +02:00
* Version : 2.0 . 0 - alpha
2014-06-29 19:36:25 +02:00
*
2015-01-07 23:49:33 +01:00
* Copyright 2015 Nick Downie
2014-06-29 19:36:25 +02:00
* Released under the MIT license
* https : //github.com/nnnick/Chart.js/blob/master/LICENSE.md
* /
2015-08-09 00:12:01 +02:00
( function ( ) { "use strict" ; var t = this , e = t . Chart , i = function ( t , e ) { this . config = e , t . length && t [ 0 ] . getContext && ( t = t [ 0 ] ) , t . getContext && ( t = t . getContext ( "2d" ) ) , this . canvas = t . canvas , this . ctx = t ; var a = function ( t , e ) { return t [ "offset" + e ] ? t [ "offset" + e ] : document . defaultView . getComputedStyle ( t ) . getPropertyValue ( e ) } , s = this . width = a ( t . canvas , "Width" ) || t . canvas . width , o = this . height = a ( t . canvas , "Height" ) || t . canvas . height ; return t . canvas . width = s , t . canvas . height = o , s = this . width = t . canvas . width , o = this . height = t . canvas . height , this . aspectRatio = this . width / this . height , i . helpers . retinaScale ( this ) , e ? ( this . controller = new i . Controller ( this ) , this . controller ) : this } ; i . defaults = { global : { responsive : ! 0 , responsiveAnimationDuration : 0 , maintainAspectRatio : ! 0 , events : [ "mousemove" , "mouseout" , "click" , "touchstart" , "touchmove" , "touchend" ] , hover : { onHover : null , mode : "single" , animationDuration : 400 } , onClick : null , defaultColor : "rgba(0,0,0,0.1)" , elements : { } , legendTemplate : '<ul class="<%=name.toLowerCase()%>-legend"><% for (var i = 0; i < data.datasets.length; i++){%><li><span style="background-color:<%=data.datasets[i].backgroundColor%>"><%if(data.datasets[i].label){%><%=data.datasets[i].label%><%}%></span></li><%}%></ul>' } } , "undefined" != typeof amd ? define ( function ( ) { return i } ) : "object" == typeof module && module . exports && ( module . exports = i ) , t . Chart = i , i . noConflict = function ( ) { return t . Chart = e , i } } ) . call ( this ) , function ( ) { "use strict" ; { var t = this , e = ( t . Chart , Chart . helpers = { } ) , i = e . each = function ( t , e , i , a ) { var s = Array . prototype . slice . call ( arguments , 3 ) ; if ( t ) if ( t . length === + t . length ) { var o ; if ( a ) for ( o = t . length - 1 ; o >= 0 ; o -- ) e . apply ( i , [ t [ o ] , o ] . concat ( s ) ) ; else for ( o = 0 ; o < t . length ; o ++ ) e . apply ( i , [ t [ o ] , o ] . concat ( s ) ) } else for ( var n in t ) e . apply ( i , [ t [ n ] , n ] . concat ( s ) ) } , a = e . clone = function ( t ) { var s = { } ; return i ( t , function ( i , o ) { t . hasOwnProperty ( o ) && ( s [ o ] = e . isArray ( i ) ? i . slice ( 0 ) : "object" == typeof i && null !== i ? a ( i ) : i ) } ) , s } , s = e . extend = function ( t ) { return i ( Array . prototype . slice . call ( arguments , 1 ) , function ( e ) { i ( e , function ( i , a ) { e . hasOwnProperty ( a ) && ( t [ a ] = i ) } ) } ) , t } , o = ( e . merge = function ( ) { var t = Array . prototype . slice . call ( arguments , 0 ) ; return t . unshift ( { } ) , s . apply ( null , t ) } , e . configMerge = function ( t ) { var i = a ( t ) ; return e . each ( Array . prototype . slice . call ( arguments , 1 ) , function ( t ) { e . each ( t , function ( a , s ) { if ( t . hasOwnProperty ( s ) ) if ( "scales" === s ) i [ s ] = e . scaleMerge ( i . hasOwnProperty ( s ) ? i [ s ] : { } , a ) ; else if ( "scale" === s ) i [ s ] = e . configMerge ( i . hasOwnProperty ( s ) ? i [ s ] : { } , Chart . scaleService . getScaleDefaults ( a . type ) , a ) ; else if ( i . hasOwnProperty ( s ) && e . isArray ( i [ s ] ) && e . isArray ( a ) ) { var o = i [ s ] ; e . each ( a , function ( t , i ) { i < o . length ? o [ i ] = e . configMerge ( o [ i ] , t ) : o . push ( t ) } ) } else i [ s ] = i . hasOwnProperty ( s ) && "object" == typeof i [ s ] && null !== i [ s ] && "object" == typeof a ? e . configMerge ( i [ s ] , a ) : a } ) } ) , i } , e . scaleMerge = function ( t , i ) { var s = a ( t ) ; return e . each ( i , function ( t , a ) { i . hasOwnProperty ( a ) && ( "xAxes" === a || "yAxes" === a ? s . hasOwnProperty ( a ) ? e . each ( t , function ( t , i ) { i >= s [ a ] . length || ! s [ a ] [ i ] . type ? s [ a ] . push ( e . configMerge ( t . type ? Chart . scaleService . getScaleDefaults ( t . type ) : { } , t ) ) : s [ a ] [ i ] = t . type !== s [ a ] [ i ] . type ? e . configMerge ( s [ a ] [ i ] , t . type ? Chart . scaleService . getScaleDefaults ( t . type ) : { } , t ) : e . configMerge ( s [ a ] [ i ] , t ) } ) : ( s [ a ] = [ ] , e . each ( t , function ( t ) { s [ a ] . push ( e . configMerge ( t . type ? Chart . scaleService . getScaleDefaults ( t . type ) : { } , t ) ) } ) ) : s [ a ] = s . hasOwnProperty ( a ) && "object" == typeof s [ a ] && null !== s [ a ] && "object" == typeof t ? e . configMerge ( s [ a ] , t ) : t ) } ) , s } , e . getValueAtIndexOrDefault = function ( t , i , a ) { return t ? e . isArray ( t ) && i < t . length ? t [ i ] : t : a } , e . indexOf = function ( t , e ) { if ( Array . prototype . indexOf ) return t . indexOf ( e ) ; for ( var i = 0 ; i < t . length ; i ++ ) if ( t [ i ] === e ) return i ; return - 1 } , e . where = function ( t , i ) { var a = [ ] ; return e . each ( t , function ( t ) { i ( t ) && a . push ( t ) } ) , a } , e . findNextWhere = function ( t , e , i ) { i || ( i = - 1 ) ; for ( var a = i + 1 ; a < t . length ; a ++ ) { var s = t [ a ] ; if ( e ( s ) ) return s } } , e . findPreviousWhere = function ( t , e , i ) { i || ( i = t . length ) ; for ( var a = i - 1 ; a >= 0 ; a -- ) { var s = t [ a ] ; if ( e ( s ) ) return s } } , e . inherits = function ( t ) { var e = this , i = t && t . hasOwnProperty ( "constructor" ) ? t . constructor : function ( ) { return e . apply ( this , arguments ) } , a = function ( ) { this . constructor = i } ; return a . prototype = e . prototype , i . prototype = new a , i . extend = o , t && s ( i . prototype , t ) , i . _ _super _ _ = e . prototype , i } ) , n =
} , getDataset : function ( ) { return this . chart . data . datasets [ this . index ] } , getScaleForId : function ( t ) { return this . chart . scales [ t ] } , addElements : function ( ) { this . getDataset ( ) . metaData = this . getDataset ( ) . metaData || [ ] , i . each ( this . getDataset ( ) . data , function ( t , i ) { this . getDataset ( ) . metaData [ i ] = this . getDataset ( ) . metaData [ i ] || new e . elements . Rectangle ( { _chart : this . chart . chart , _datasetIndex : this . index , _index : i } ) } , this ) } , addElementAndReset : function ( t ) { this . getDataset ( ) . metaData = this . getDataset ( ) . metaData || [ ] ; var i = new e . elements . Rectangle ( { _chart : this . chart . chart , _datasetIndex : this . index , _index : t } ) ; this . updateElement ( i , t , ! 0 ) , this . getDataset ( ) . metaData . splice ( t , 0 , i ) } , removeElement : function ( t ) { this . getDataset ( ) . metaData . splice ( t , 1 ) } , reset : function ( ) { this . update ( ! 0 ) } , update : function ( t ) { i . each ( this . getDataset ( ) . metaData , function ( e , i ) { this . updateElement ( e , i , t ) } , this ) } , updateElement : function ( t , e , a ) { var s , o = this . getScaleForId ( this . getDataset ( ) . xAxisID ) , n = this . getScaleForId ( this . getDataset ( ) . yAxisID ) ; s = n . getPixelForValue ( n . min < 0 && n . max < 0 ? n . max : n . min > 0 && n . max > 0 ? n . min : 0 ) , i . extend ( t , { _chart : this . chart . chart , _xScale : o , _yScale : n , _datasetIndex : this . index , _index : e , _model : { x : o . calculateBarX ( this . chart . data . datasets . length , this . index , e ) , y : a ? s : n . calculateBarY ( this . index , e ) , label : this . chart . data . labels [ e ] , datasetLabel : this . getDataset ( ) . label , base : n . calculateBarBase ( this . index , e ) , width : o . calculateBarWidth ( this . chart . data . datasets . length ) , backgroundColor : t . custom && t . custom . backgroundColor ? t . custom . backgroundColor : i . getValueAtIndexOrDefault ( this . getDataset ( ) . backgroundColor , e , this . chart . options . elements . rectangle . backgroundColor ) , borderColor : t . custom && t . custom . borderColor ? t . custom . borderColor : i . getValueAtIndexOrDefault ( this . getDataset ( ) . borderColor , e , this . chart . options . elements . rectangle . borderColor ) , borderWidth : t . custom && t . custom . borderWidth ? t . custom . borderWidth : i . getValueAtIndexOrDefault ( this . getDataset ( ) . borderWidth , e , this . chart . options . elements . rectangle . borderWidth ) } } ) , t . pivot ( ) } , draw : function ( t ) { var e = t || 1 ; i . each ( this . getDataset ( ) . metaData , function ( t ) { t . transition ( e ) . draw ( ) } , this ) } , setHoverStyle : function ( t ) { var e = this . chart . data . datasets [ t . _datasetIndex ] , a = t . _index ; t . _model . backgroundColor = t . custom && t . custom . hoverBackgroundColor ? t . custom . hoverBackgroundColor : i . getValueAtIndexOrDefault ( e . hoverBackgroundColor , a , i . color ( t . _model . backgroundColor ) . saturate ( . 5 ) . darken ( . 1 ) . rgbString ( ) ) , t . _model . borderColor = t . custom && t . custom . hoverBorderColor ? t . custom . hoverBorderColor : i . getValueAtIndexOrDefault ( e . hoverBorderColor , a , i . color ( t . _model . borderColor ) . saturate ( . 5 ) . darken ( . 1 ) . rgbString ( ) ) , t . _model . borderWidth = t . custom && t . custom . hoverBorderWidth ? t . custom . hoverBorderWidth : i . getValueAtIndexOrDefault ( e . borderWidth , a , t . _model . borderWidth ) } , removeHoverStyle : function ( t ) { var e = ( this . chart . data . datasets [ t . _datasetIndex ] , t . _index ) ; t . _model . backgroundColor = t . custom && t . custom . backgroundColor ? t . custom . backgroundColor : i . getValueAtIndexOrDefault ( this . getDataset ( ) . backgroundColor , e , this . chart . options . elements . rectangle . backgroundColor ) , t . _model . borderColor = t . custom && t . custom . borderColor ? t . custom . borderColor : i . getValueAtIndexOrDefault ( this . getDataset ( ) . borderColor , e , this . chart . options . elements . rectangle . borderColor ) , t . _model . borderWidth = t . custom && t . custom . borderWidth ? t . custom . borderWidth : i . getValueAtIndexOrDefault ( this . getDataset ( ) . borderWidth , e , this . chart . options . elements . rectangle . borderWidth ) } } ) } . call ( this ) , function ( ) { "use strict" ; var t = this , e = t . Chart , i = e . helpers ; e . defaults . doughnut = { animation : { animateRotate : ! 0 , animateScale : ! 1 } , hover : { mode : "single" } , cutoutPercentage : 50 } , e . defaults . pie = i . clone ( e . defaults . doughnut ) , i . extend ( e . defaults . pie , { cutoutPercentage : 0 } ) , e . controllers . doughnut = e . controllers . pie = function ( t , e ) { this . initialize . call ( this , t , e ) } , i . extend ( e . controllers . doughnut . prototype , { initialize : function ( t , e ) { this . chart = t , this . index = e , this . linkScales ( ) , this . addElements ( ) } , updateIndex : function ( t ) { this . index = t } , linkScales : function ( ) { } , getDataset : function ( ) { return this . chart . data . datasets [ this . index ] } , getScaleForId : function ( t ) { return this . chart . scales [ t ] } , addElements : function ( ) { this . getD
} else this . options . display && ( s . height = e ) ; return this . width = s . width , this . height = s . height , s } , draw : function ( t ) { if ( this . options . display ) { var e ; if ( this . ctx . fillStyle = this . options . labels . fontColor , this . isHorizontal ( ) ) { e = ! 0 ; var a = "bottom" == this . options . position ? this . top : this . bottom - 10 , s = "bottom" == this . options . position ? this . top + 10 : this . bottom , o = 0 !== this . labelRotation , n = ! 1 ; ( this . options . labels . fontSize + 4 ) * this . labels . length > this . width - ( this . paddingLeft + this . paddingRight ) && ( n = 1 + Math . floor ( ( this . options . labels . fontSize + 4 ) * this . labels . length / ( this . width - ( this . paddingLeft + this . paddingRight ) ) ) ) , i . each ( this . labels , function ( r , h ) { if ( ! ( n > 1 && h % n > 0 ) ) { var l = this . getPixelForValue ( r , h , null , ! 1 ) , c = this . getPixelForValue ( r , h , null , ! 0 ) ; this . options . gridLines . show && ( 0 === h ? ( this . ctx . lineWidth = this . options . gridLines . zeroLineWidth , this . ctx . strokeStyle = this . options . gridLines . zeroLineColor , e = ! 0 ) : e && ( this . ctx . lineWidth = this . options . gridLines . lineWidth , this . ctx . strokeStyle = this . options . gridLines . color , e = ! 1 ) , l += i . aliasPixel ( this . ctx . lineWidth ) , this . ctx . beginPath ( ) , this . options . gridLines . drawTicks && ( this . ctx . moveTo ( l , a ) , this . ctx . lineTo ( l , s ) ) , this . options . gridLines . drawOnChartArea && ( this . ctx . moveTo ( l , t . top ) , this . ctx . lineTo ( l , t . bottom ) ) , this . ctx . stroke ( ) ) , this . options . labels . show && ( this . ctx . save ( ) , this . ctx . translate ( c , o ? this . top + 12 : this . top + 8 ) , this . ctx . rotate ( - 1 * i . toRadians ( this . labelRotation ) ) , this . ctx . font = this . font , this . ctx . textAlign = o ? "right" : "center" , this . ctx . textBaseline = o ? "middle" : "top" , this . ctx . fillText ( r , 0 , 0 ) , this . ctx . restore ( ) ) } } , this ) } else this . options . gridLines . show , this . options . labels . show } } } ) ; e . scaleService . registerScaleType ( "category" , s , a ) } . call ( this ) , function ( ) { "use strict" ; var t = this , e = t . Chart , i = e . helpers , a = { display : ! 0 , position : "left" , gridLines : { show : ! 0 , color : "rgba(0, 0, 0, 0.1)" , lineWidth : 1 , drawOnChartArea : ! 0 , drawTicks : ! 0 , zeroLineWidth : 1 , zeroLineColor : "rgba(0,0,0,0.25)" } , reverse : ! 1 , beginAtZero : ! 1 , override : null , labels : { show : ! 0 , mirror : ! 1 , padding : 10 , template : "<%=value.toLocaleString()%>" , fontSize : 12 , fontStyle : "normal" , fontColor : "#666" , fontFamily : "Helvetica Neue" } } , s = e . Element . extend ( { isHorizontal : function ( ) { return "top" == this . options . position || "bottom" == this . options . position } , generateTicks : function ( t , e ) { if ( this . ticks = [ ] , this . options . override ) for ( var a = 0 ; a <= this . options . override . steps ; ++ a ) { var s = this . options . override . start + a * this . options . override . stepWidth ; this . ticks . push ( s ) } else { var o ; if ( o = this . isHorizontal ( ) ? Math . min ( 11 , Math . ceil ( t / 50 ) ) : Math . min ( 11 , Math . ceil ( e / ( 2 * this . options . labels . fontSize ) ) ) , o = Math . max ( 2 , o ) , this . options . beginAtZero ) { var n = i . sign ( this . min ) , r = i . sign ( this . max ) ; 0 > n && 0 > r ? this . max = 0 : n > 0 && r > 0 && ( this . min = 0 ) } for ( var h = i . niceNum ( this . max - this . min , ! 1 ) , l = i . niceNum ( h / ( o - 1 ) , ! 0 ) , c = Math . floor ( this . min / l ) * l , u = Math . ceil ( this . max / l ) * l , d = c ; u >= d ; d += l ) this . ticks . push ( d ) } ( "left" == this . options . position || "right" == this . options . position ) && this . ticks . reverse ( ) , this . max = i . max ( this . ticks ) , this . min = i . min ( this . ticks ) , this . options . reverse ? ( this . ticks . reverse ( ) , this . start = this . max , this . end = this . min ) : ( this . start = this . min , this . end = this . max ) } , buildLabels : function ( ) { this . labels = [ ] , i . each ( this . ticks , function ( t , e , a ) { var s ; this . options . labels . userCallback ? s = this . options . labels . userCallback ( t , e , a ) : this . options . labels . template && ( s = i . template ( this . options . labels . template , { value : t } ) ) , this . labels . push ( s ? s : "" ) } , this ) } , getRightValue : function ( t ) { return "object" == typeof t ? this . isHorizontal ( ) ? t . x : t . y : t } , getPixelForValue : function ( t ) { var e , i = this . end - this . start ; if ( this . isHorizontal ( ) ) { var a = this . width - ( this . paddingLeft + this . paddingRight ) ; e = this . left + a / i * ( t - this . start ) , e += this . paddingLeft } else { var s = this . height - ( this . paddingTop + this . paddingBottom ) ; e = this . bottom - s / i * ( t - this . start ) , e += this . paddingTop } return e } , calculateRange : function ( ) { this . min = null , this . max = null ; var t = [ ] , e = [ ] ; if ( this . options . stacked ) { i . each ( this . data . datasets , function ( a ) { ( this . isHorizontal ( ) ? a . xAxisID === this . id : a . yAxisID === this . id ) && i . each ( a . data , function ( i , a ) { var s = this . getRightValue ( i ) ; t [ a ] = t [ a ] || 0 , e [ a ] = e [ a ] || 0 , this . options . relativePoints ? t [ a ] = 100 : 0 > s ? e [ a ] += s : t [ a ] += s } , this ) } , this ) ; var a = t . concat ( e ) ; this . min = i . mi
2015-06-12 22:00:48 +02:00
* Chart . js
* http : //chartjs.org/
* Version : 2.0 . 0 - alpha
*
* Copyright 2015 Nick Downie
* Released under the MIT license
* https : //github.com/nnnick/Chart.js/blob/master/LICENSE.md
* /
2015-06-17 23:10:57 +02:00
function ( ) { "use strict" ; var t = this , e = t . Chart , i = e . helpers ; e . defaults . global . elements . arc = { backgroundColor : e . defaults . global . defaultColor , borderColor : "#fff" , borderWidth : 2 } , e . elements . Arc = e . Element . extend ( { inLabelRange : function ( t ) { var e = this . _view ; return e ? Math . pow ( t - e . x , 2 ) < Math . pow ( e . radius + e . hoverRadius , 2 ) : ! 1 } , inRange : function ( t , e ) { var a = this . _view , s = i . getAngleFromPoint ( a , { x : t , y : e } ) , o = a . startAngle < - . 5 * Math . PI ? a . startAngle + 2 * Math . PI : a . startAngle > 1.5 * Math . PI ? a . startAngle - 2 * Math . PI : a . startAngle , n = a . endAngle < - . 5 * Math . PI ? a . endAngle + 2 * Math . PI : a . endAngle > 1.5 * Math . PI ? a . endAngle - 2 * Math . PI : a . endAngle , r = s . angle >= o && s . angle <= n , h = s . distance >= a . innerRadius && s . distance <= a . outerRadius ; return r && h } , tooltipPosition : function ( ) { var t = this . _view , e = t . startAngle + ( t . endAngle - t . startAngle ) / 2 , i = ( t . outerRadius - t . innerRadius ) / 2 + t . innerRadius ; return { x : t . x + Math . cos ( e ) * i , y : t . y + Math . sin ( e ) * i } } , draw : function ( ) { var t = this . _chart . ctx , e = this . _view ; t . beginPath ( ) , t . arc ( e . x , e . y , e . outerRadius , e . startAngle , e . endAngle ) , t . arc ( e . x , e . y , e . innerRadius , e . endAngle , e . startAngle , ! 0 ) , t . closePath ( ) , t . strokeStyle = e . borderColor , t . lineWidth = e . borderWidth , t . fillStyle = e . backgroundColor , t . fill ( ) , t . lineJoin = "bevel" , e . borderWidth && t . stroke ( ) } } ) } . call ( this ) , / * !
2015-06-12 22:00:48 +02:00
* Chart . js
* http : //chartjs.org/
* Version : 2.0 . 0 - alpha
*
* Copyright 2015 Nick Downie
* Released under the MIT license
* https : //github.com/nnnick/Chart.js/blob/master/LICENSE.md
* /
2015-06-22 21:11:19 +02:00
function ( ) { "use strict" ; var t = this , e = t . Chart , i = e . helpers ; e . defaults . global . elements . line = { tension : . 4 , backgroundColor : e . defaults . global . defaultColor , borderWidth : 3 , borderColor : e . defaults . global . defaultColor , borderCapStyle : "butt" , borderDash : [ ] , borderDashOffset : 0 , borderJoinStyle : "miter" , fill : ! 0 , skipNull : ! 0 , drawNull : ! 1 } , e . elements . Line = e . Element . extend ( { draw : function ( ) { var t = this . _view , a = this . _chart . ctx , s = this . _children [ 0 ] , o = this . _children [ this . _children . length - 1 ] ; a . save ( ) , i . each ( this . _children , function ( e , s ) { var o = i . previousItem ( this . _children , s ) , n = i . nextItem ( this . _children , s ) ; return 0 === s ? void a . moveTo ( e . _view . x , e . _view . y ) : ( e . _view . skip && t . skipNull && ! this . _loop ? ( a . lineTo ( o . _view . x , e . _view . y ) , a . moveTo ( n . _view . x , e . _view . y ) ) : o . _view . skip && t . skipNull && ! this . _loop && ( a . moveTo ( e . _view . x , o . _view . y ) , a . lineTo ( e . _view . x , e . _view . y ) ) , void ( o . _view . skip && t . skipNull ? a . moveTo ( e . _view . x , e . _view . y ) : t . tension > 0 ? a . bezierCurveTo ( o . _view . controlPointNextX , o . _view . controlPointNextY , e . _view . controlPointPreviousX , e . _view . controlPointPreviousY , e . _view . x , e . _view . y ) : a . lineTo ( e . _view . x , e . _view . y ) ) ) } , this ) , this . _loop && ( t . tension > 0 && ! s . _view . skip ? a . bezierCurveTo ( o . _view . controlPointNextX , o . _view . controlPointNextY , s . _view . controlPointPreviousX , s . _view . controlPointPreviousY , s . _view . x , s . _view . y ) : a . lineTo ( s . _view . x , s . _view . y ) ) , this . _children . length > 0 && t . fill && ( a . lineTo ( this . _children [ this . _children . length - 1 ] . _view . x , t . scaleZero ) , a . lineTo ( this . _children [ 0 ] . _view . x , t . scaleZero ) , a . fillStyle = t . backgroundColor || e . defaults . global . defaultColor , a . closePath ( ) , a . fill ( ) ) , a . lineCap = t . borderCapStyle || e . defaults . global . elements . line . borderCapStyle , a . setLineDash ( t . borderDash || e . defaults . global . elements . line . borderDash ) , a . lineDashOffset = t . borderDashOffset || e . defaults . global . elements . line . borderDashOffset , a . lineJoin = t . borderJoinStyle || e . defaults . global . elements . line . borderJoinStyle , a . lineWidth = t . borderWidth || e . defaults . global . defaultColor , a . strokeStyle = t . borderColor || e . defaults . global . defaultColor , a . beginPath ( ) , i . each ( this . _children , function ( e , s ) { var o = i . previousItem ( this . _children , s ) , n = i . nextItem ( this . _children , s ) ; return 0 === s ? void a . moveTo ( e . _view . x , e . _view . y ) : e . _view . skip && t . skipNull && ! this . _loop ? ( a . moveTo ( o . _view . x , e . _view . y ) , void a . moveTo ( n . _view . x , e . _view . y ) ) : o . _view . skip && t . skipNull && ! this . _loop ? ( a . moveTo ( e . _view . x , o . _view . y ) , void a . moveTo ( e . _view . x , e . _view . y ) ) : o . _view . skip && t . skipNull ? void a . moveTo ( e . _view . x , e . _view . y ) : void ( t . tension > 0 ? a . bezierCurveTo ( o . _view . controlPointNextX , o . _view . controlPointNextY , e . _view . controlPointPreviousX , e . _view . controlPointPreviousY , e . _view . x , e . _view . y ) : a . lineTo ( e . _view . x , e . _view . y ) ) } , this ) , this . _loop && ! s . _view . skip && ( t . tension > 0 ? a . bezierCurveTo ( o . _view . controlPointNextX , o . _view . controlPointNextY , s . _view . controlPointPreviousX , s . _view . controlPointPreviousY , s . _view . x , s . _view . y ) : a . lineTo ( s . _view . x , s . _view . y ) ) , a . stroke ( ) , a . restore ( ) } } ) } . call ( this ) , / * !
2015-06-12 22:00:48 +02:00
* Chart . js
* http : //chartjs.org/
* Version : 2.0 . 0 - alpha
*
* Copyright 2015 Nick Downie
* Released under the MIT license
* https : //github.com/nnnick/Chart.js/blob/master/LICENSE.md
* /
2015-08-09 00:12:01 +02:00
function ( ) { "use strict" ; { var t = this , e = t . Chart ; e . helpers } e . defaults . global . elements . point = { radius : 3 , backgroundColor : e . defaults . global . defaultColor , borderWidth : 1 , borderColor : e . defaults . global . defaultColor , hitRadius : 1 , hoverRadius : 4 , hoverBorderWidth : 1 } , e . elements . Point = e . Element . extend ( { inRange : function ( t , e ) { var i = this . _view , a = i . hitRadius + i . radius ; return Math . pow ( t - i . x , 2 ) + Math . pow ( e - i . y , 2 ) < Math . pow ( a , 2 ) } , inLabelRange : function ( t ) { var e = this . _view ; return e ? Math . pow ( t - e . x , 2 ) < Math . pow ( e . radius + e . hitRadius , 2 ) : ! 1 } , tooltipPosition : function ( ) { var t = this . _view ; return { x : t . x , y : t . y , padding : t . radius + t . borderWidth } } , draw : function ( ) { var t = this . _view , i = this . _chart . ctx ; t . skip || ( t . radius > 0 || t . borderWidth > 0 ) && ( i . beginPath ( ) , i . arc ( t . x , t . y , t . radius || e . defaults . global . elements . point . radius , 0 , 2 * Math . PI ) , i . closePath ( ) , i . strokeStyle = t . borderColor || e . defaults . global . defaultColor , i . lineWidth = t . borderWidth || e . defaults . global . elements . point . borderWidth , i . fillStyle = t . backgroundColor || e . defaults . global . defaultColor , i . fill ( ) , i . stroke ( ) ) } } ) } . call ( this ) , function ( ) { "use strict" ; { var t = this , e = t . Chart ; e . helpers } e . defaults . global . elements . rectangle = { backgroundColor : e . defaults . global . defaultColor , borderWidth : 0 , borderColor : e . defaults . global . defaultColor } , e . elements . Rectangle = e . Element . extend ( { draw : function ( ) { var t = this . _chart . ctx , e = this . _view , i = e . width / 2 , a = e . x - i , s = e . x + i , o = e . base - ( e . base - e . y ) , n = e . borderWidth / 2 ; e . borderWidth && ( a += n , s -= n , o += n ) , t . beginPath ( ) , t . fillStyle = e . backgroundColor , t . strokeStyle = e . borderColor , t . lineWidth = e . borderWidth , t . moveTo ( a , e . base ) , t . lineTo ( a , o ) , t . lineTo ( s , o ) , t . lineTo ( s , e . base ) , t . fill ( ) , e . borderWidth && t . stroke ( ) } , height : function ( ) { var t = this . _view ; return t . base - t . y } , inRange : function ( t , e ) { var i = this . _view ; return i . y < i . base ? t >= i . x - i . width / 2 && t <= i . x + i . width / 2 && e >= i . y && e <= i . base : t >= i . x - i . width / 2 && t <= i . x + i . width / 2 && e >= i . base && e <= i . y } , inLabelRange : function ( t ) { var e = this . _view ; return t >= e . x - e . width / 2 && t <= e . x + e . width / 2 } , tooltipPosition : function ( ) { var t = this . _view ; return t . y < t . base ? { x : t . x , y : t . y } : { x : t . x , y : t . base } } } ) } . call ( this ) , function ( ) { "use strict" ; { var t = this , e = t . Chart ; e . helpers } e . Bar = function ( t , i ) { return i . type = "bar" , new e ( t , i ) } } . call ( this ) , function ( ) { "use strict" ; var t = this , e = t . Chart , i = e . helpers , a = { legendTemplate : '<ul class="<%=name.toLowerCase()%>-legend"><% for (var i = 0; i < data.datasets[0].data.length; i++){%><li><span style="background-color:<%=data.datasets[0].backgroundColor[i]%>"><%if(data.labels && i < data.labels.length){%><%=data.labels[i]%><%}%></span></li><%}%></ul>' } ; e . Doughnut = function ( t , s ) { return s . options = i . configMerge ( a , s . options ) , s . type = "doughnut" , new e ( t , s ) } } . call ( this ) , function ( ) { "use strict" ; { var t = this , e = t . Chart ; e . helpers } e . Line = function ( t , i ) { return i . type = "line" , new e ( t , i ) } } . call ( this ) , function ( ) { "use strict" ; var t = this , e = t . Chart , i = e . helpers , a = { legendTemplate : '<ul class="<%=name.toLowerCase()%>-legend"><% for (var i = 0; i < data.datasets[0].data.length; i++){%><li><span style="background-color:<%=data.datasets[0].backgroundColor[i]%>"><%if(data.labels && i < data.labels.length){%><%=data.labels[i]%><%}%></span></li><%}%></ul>' } ; e . PolarArea = function ( t , s ) { return s . options = i . configMerge ( a , s . options ) , s . type = "polarArea" , new e ( t , s ) } } . call ( this ) , function ( ) { "use strict" ; { var t = this , e = t . Chart ; e . helpers } e . Radar = function ( t , i ) { return i . type = "radar" , new e ( t , i ) } } . call ( this ) , function ( ) { "use strict" ; var t = this , e = t . Chart , i = e . helpers , a = { hover : { mode : "single" } , scales : { xAxes : [ { type : "linear" , position : "bottom" , id : "x-axis-1" } ] , yAxes : [ { type : "linear" , position : "left" , id : "y-axis-1" } ] } , tooltips : { template : "(<%= value.x %>, <%= value.y %>)" , multiTemplate : "<%if (datasetLabel){%><%=datasetLabel%>: <%}%>(<%= value.x %>, <%= value.y %>)" } } ; e . Scatter = function ( t , s ) { return s . options = i . configMerge ( a , s . options ) , s . type = "line" , new e ( t , s ) } } . call ( this ) , ! function t ( e , i , a ) { function s ( n , r ) { if ( ! i [ n ] ) { if ( ! e [ n ] ) { var h = "function" == typeof require && require ; if ( ! r && h ) return h ( n , ! 0 ) ; if ( o ) return o ( n , ! 0 ) ; var l = new Error ( "Cannot find module '" + n + "'" ) ; throw l . code = "MODULE_NOT_FOUND" , l } var c = i [ n ] = { exports : { } } ; e [ n ] [ 0 ] . call ( c . exports , function ( t ) { var i = e [ n ] [ 1 ] [ t ] ; return s ( i ? i : t ) }