diff --git a/demo/demo_chartjs.html b/demo/chartjs.html similarity index 97% rename from demo/demo_chartjs.html rename to demo/chartjs.html index 734db69..425bf13 100644 --- a/demo/demo_chartjs.html +++ b/demo/chartjs.html @@ -1,214 +1,214 @@ - - -
-<:chartjs:demo_type{type=bar}:>
<chart
- |id=barre
- |type=bar
- |datasets=40,32,50,35 next 20,25,45,42 next 40,43, 61,50 next 33,15,40,22
- |labels=Salé,Sucré,Amer,Acide
- |dataLabels=poire,pomme,courgette,citron
- |width=500
- |height=500>
-
- <:chartjs:demo_type{type=line}:>
<chart
- |id=ligne
- |type=line
- |datasets=40,43,61,50 next 33,15,40,22
- |labels=Janvier, Février, Mars, Avril0
- |dataLabels=patates,poireaux
- |width=500
- |height=500>
-
- <:chartjs:demo_type{type=pie}:>
<chart
- |id=camembert1
- |type=pie
- |labels=Tôkyô - 東京,Kyoto, Osaka,Chiba,Hiroshima
- |data=10,32,50,25,5>
-
- <:chartjs:demo_type{type=doughnut}:>
<chart
- |id=anneau
- |type=doughnut
- |align=right
- |data=30,10,55,25,15,8
- |labels=Tôkyô - 東京,Kyoto, Osaka,Chiba,Hiroshima
- |colors=#69D2E7,#E0E4CC,#F38630,#96CE7F,#CEBC17,#CE4264>
-
- <:chartjs:demo_type{type=polarArea}:>
<chart
- |id=polaire
- |type=polarArea
- |data=40,32,5,25,50,45
- |labels=Noix,Amandes,Raisins,Autres sucreries,Salés,Six>
-
- <:chartjs:demo_type{type=radar}:>
<chart
- |id=radar45
- |type=radar
- |datasets=40,43,61,50 next 33,15,40,22
- |labels=Précis, Rapide, Joli, Complet, かわい
- |colors=#CEBC17,#CE4264>
-
- <:chartjs:demo_type{type=bubble}:>
<chart
- |id=bubble
- |type=bubble
- |datasets=2,5,10 10,7,5 next 15,20,5 ,10,12,15
- |dataLabels=poireaux,patates>
-
- <:chartjs:demo_type{type=scatter}:>
<chart
- |id=scatter
- |type=scatter
- |datasets=5,10, 10,0, 15,10 next 5,20, 6,25, 7,20 next 13,20, 14,25, 15,20
- |dataLabels=poireaux,patates,piments>
-
- #SET{nb_article,0}
-<BOUCLE_articles(ARTICLES)> </BOUCLE_articles>#SET{nb_article,#TOTAL_BOUCLE} </B_articles>
-#SET{nb_auteur,0}
-<BOUCLE_auteurs(AUTEURS)> </BOUCLE_auteurs>#SET{nb_auteur,#TOTAL_BOUCLE} </B_auteurs>
-#SET{data,#GET{nb_article}|concat{",",#GET{nb_auteur}}}
-#SET{labels,"Articles, Auteurs"}
-[(#MODELE{chart}{id=barrespip,type=bar,datasets=#GET{data},labels=#GET{labels}})]
-
- #SET{data,''}
-#SET{labels,''}
-<BOUCLE_cours(DATA){source simplexml,http://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml?#ENV{date}}{datapath root/children/cube/0/children/cube}{0,30}>
-#SET{labels, #GET{labels}|concat{",",#VALEUR{attributes/time}|affdate{d/m/y}}}
-<BOUCLE_yen(DATA){source tableau,#VALEUR{children/cube}}>[
-(#VALEUR{attributes/currency}|=={JPY}|oui)
- #SET{data,#GET{data}|concat{",",#VALEUR{attributes/rate}}
-]</BOUCLE_yen>
-</BOUCLE_cours>
-#SET{data,#GET{data}|substr{1}}
-#SET{labels,#GET{labels}|substr{1}}
-[(#MODELE{chart}{id=coursduyen,type=line,width=auto,height=auto,datasets=#GET{data},labels=#GET{labels}})]
-
- <:chartjs:demo_type{type=bar}:>
<chart
+ |id=barre
+ |type=bar
+ |datasets=40,32,50,35 next 20,25,45,42 next 40,43, 61,50 next 33,15,40,22
+ |labels=Salé,Sucré,Amer,Acide
+ |dataLabels=poire,pomme,courgette,citron
+ |width=500
+ |height=500>
+
+ <:chartjs:demo_type{type=line}:>
<chart
+ |id=ligne
+ |type=line
+ |datasets=40,43,61,50 next 33,15,40,22
+ |labels=Janvier, Février, Mars, Avril0
+ |dataLabels=patates,poireaux
+ |width=500
+ |height=500>
+
+ <:chartjs:demo_type{type=pie}:>
<chart
+ |id=camembert1
+ |type=pie
+ |labels=Tôkyô - 東京,Kyoto, Osaka,Chiba,Hiroshima
+ |data=10,32,50,25,5>
+
+ <:chartjs:demo_type{type=doughnut}:>
<chart
+ |id=anneau
+ |type=doughnut
+ |align=right
+ |data=30,10,55,25,15,8
+ |labels=Tôkyô - 東京,Kyoto, Osaka,Chiba,Hiroshima
+ |colors=#69D2E7,#E0E4CC,#F38630,#96CE7F,#CEBC17,#CE4264>
+
+ <:chartjs:demo_type{type=polarArea}:>
<chart
+ |id=polaire
+ |type=polarArea
+ |data=40,32,5,25,50,45
+ |labels=Noix,Amandes,Raisins,Autres sucreries,Salés,Six>
+
+ <:chartjs:demo_type{type=radar}:>
<chart
+ |id=radar45
+ |type=radar
+ |datasets=40,43,61,50 next 33,15,40,22
+ |labels=Précis, Rapide, Joli, Complet, かわい
+ |colors=#CEBC17,#CE4264>
+
+ <:chartjs:demo_type{type=bubble}:>
<chart
+ |id=bubble
+ |type=bubble
+ |datasets=2,5,10 10,7,5 next 15,20,5 ,10,12,15
+ |dataLabels=poireaux,patates>
+
+ <:chartjs:demo_type{type=scatter}:>
<chart
+ |id=scatter
+ |type=scatter
+ |datasets=5,10, 10,0, 15,10 next 5,20, 6,25, 7,20 next 13,20, 14,25, 15,20
+ |dataLabels=poireaux,patates,piments>
+
+ #SET{nb_article,0}
+<BOUCLE_articles(ARTICLES)> </BOUCLE_articles>#SET{nb_article,#TOTAL_BOUCLE} </B_articles>
+#SET{nb_auteur,0}
+<BOUCLE_auteurs(AUTEURS)> </BOUCLE_auteurs>#SET{nb_auteur,#TOTAL_BOUCLE} </B_auteurs>
+#SET{data,#GET{nb_article}|concat{",",#GET{nb_auteur}}}
+#SET{labels,"Articles, Auteurs"}
+[(#MODELE{chart}{id=barrespip,type=bar,datasets=#GET{data},labels=#GET{labels}})]
+
+ #SET{data,''}
+#SET{labels,''}
+<BOUCLE_cours(DATA){source simplexml,http://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml?#ENV{date}}{datapath root/children/cube/0/children/cube}{0,30}>
+#SET{labels, #GET{labels}|concat{",",#VALEUR{attributes/time}|affdate{d/m/y}}}
+<BOUCLE_yen(DATA){source tableau,#VALEUR{children/cube}}>[
+(#VALEUR{attributes/currency}|=={JPY}|oui)
+ #SET{data,#GET{data}|concat{",",#VALEUR{attributes/rate}}
+]</BOUCLE_yen>
+</BOUCLE_cours>
+#SET{data,#GET{data}|substr{1}}
+#SET{labels,#GET{labels}|substr{1}}
+[(#MODELE{chart}{id=coursduyen,type=line,width=auto,height=auto,datasets=#GET{data},labels=#GET{labels}})]
+
+ f&&(f=i),x=(b*x+e)/++b):(y(),t.lineTo(e,i),g=a,b=0,p=f=i),m=i}y()}function _getSegmentMethod(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return!(t._loop||e.tension||e.stepped||i)?fastPathSegment:pathSegment}function _getInterpolationMethod(t){return t.stepped?_steppedInterpolation:t.tension?_bezierInterpolation:_pointInLine}Arc.id="arc",Arc.defaults={borderAlign:"center",borderColor:"#fff",borderWidth:2},Arc.defaultRoutes={backgroundColor:"color"};class Line extends Element{constructor(t){super(),this.options=void 0,this._loop=void 0,this._fullLoop=void 0,this._points=void 0,this._segments=void 0,t&&Object.assign(this,t)}updateControlPoints(t){const e=this,i=e.options;if(i.tension&&!i.stepped){const a=i.spanGaps?e._loop:e._fullLoop;_updateBezierControlPoints(e._points,i,t,a)}}set points(t){this._points=t,delete this._segments}get points(){return this._points}get segments(){return this._segments||(this._segments=_computeSegments(this))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this,a=i.options,n=t[e],o=i.points,s=_boundSegments(i,{property:e,start:n,end:n});if(!s.length)return;const r=[],l=_getInterpolationMethod(a);let c,d;for(c=0,d=s.length;c 0&&i>0&&(t.min=0)}const i=void 0!==e.min||void 0!==e.suggestedMin,a=void 0!==e.max||void 0!==e.suggestedMax;void 0!==e.min?t.min=e.min:void 0!==e.suggestedMin&&(null===t.min?t.min=e.suggestedMin:t.min=Math.min(t.min,e.suggestedMin)),void 0!==e.max?t.max=e.max:void 0!==e.suggestedMax&&(null===t.max?t.max=e.suggestedMax:t.max=Math.max(t.max,e.suggestedMax)),i!==a&&t.min>=t.max&&(i?t.max=t.min+1:t.min=t.max-1),t.min===t.max&&(t.max++,e.beginAtZero||t.min--)}getTickLimit(){const t=this,e=t.options.ticks;let i,{maxTicksLimit:a,stepSize:n}=e;return n?i=Math.ceil(t.max/n)-Math.floor(t.min/n)+1:(i=t.computeTickLimit(),a=a||11),a&&(i=Math.min(a,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this,e=t.options,i=e.ticks;let a=t.getTickLimit();a=Math.max(2,a);const n=generateTicks({maxTicks:a,min:e.min,max:e.max,precision:i.precision,stepSize:valueOrDefault(i.fixedStepSize,i.stepSize)},t);return _setMinAndMaxByKey(n,t,"value"),e.reverse?(n.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max),n}configure(){const t=this,e=t.ticks;let i=t.min,a=t.max;if(super.configure(),t.options.offset&&e.length){const t=(a-i)/Math.max(e.length-1,1)/2;i-=t,a+=t}t._startValue=i,t._endValue=a,t._valueRange=a-i}getLabelForValue(t){return new Intl.NumberFormat(this.options.locale).format(t)}}class LinearScale extends LinearScaleBase{determineDataLimits(){const t=this,e=t.options,{min:i,max:a}=t.getMinMax(!0);t.min=isNumberFinite(i)?i:valueOrDefault(e.suggestedMin,0),t.max=isNumberFinite(a)?a:valueOrDefault(e.suggestedMax,1),e.stacked&&i>0&&(t.min=0),t.handleTickRangeOptions()}computeTickLimit(){const t=this;if(t.isHorizontal())return Math.ceil(t.width/40);const e=t._resolveTickFontOptions(0);return Math.ceil(t.height/e.lineHeight)}getPixelForValue(t){const e=this;return e.getPixelForDecimal((t-e._startValue)/e._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}function isMajor(t){return 1===t/Math.pow(10,Math.floor(log10(t)))}function finiteOrDefault(t,e){return isNumberFinite(t)?t:e}function generateTicks$1(t,e){const i=Math.floor(log10(e.max)),a=Math.ceil(e.max/Math.pow(10,i)),n=[];let o=finiteOrDefault(t.min,Math.pow(10,Math.floor(log10(e.min)))),s=Math.floor(log10(o)),r=Math.floor(o/Math.pow(10,s)),l=s<0?Math.pow(10,Math.abs(s)):1;do{n.push({value:o,major:isMajor(o)}),++r,10===r&&(r=1,++s,l=s>=0?1:l),o=Math.round(r*Math.pow(10,s)*l)/l}while(s0?i:NaN}determineDataLimits(){const t=this,{min:e,max:i}=t.getMinMax(!0);t.min=isNumberFinite(e)?Math.max(0,e):null,t.max=isNumberFinite(i)?Math.max(0,i):null,t.handleTickRangeOptions()}handleTickRangeOptions(){const t=this;let e=t.min,i=t.max;e===i&&(e<=0?(e=1,i=10):(e=Math.pow(10,Math.floor(log10(e))-1),i=Math.pow(10,Math.floor(log10(i))+1))),e<=0&&(e=Math.pow(10,Math.floor(log10(i))-1)),i<=0&&(i=Math.pow(10,Math.floor(log10(e))+1)),t.min=e,t.max=i}buildTicks(){const t=this,e=t.options,i=generateTicks$1({min:t._userMin,max:t._userMax},t);let a=!t.isHorizontal();return _setMinAndMaxByKey(i,t,"value"),e.reverse?(a=!a,t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max),a&&i.reverse(),i}getLabelForValue(t){return void 0===t?"0":new Intl.NumberFormat(this.options.locale).format(t)}configure(){const t=this,e=t.min;super.configure(),t._startValue=log10(e),t._valueRange=log10(t.max)-log10(e)}getPixelForValue(t){const e=this;return void 0!==t&&0!==t||(t=e.min),e.getPixelForDecimal(t===e.min?0:(log10(t)-e._startValue)/e._valueRange)}getValueForPixel(t){const e=this,i=e.getDecimalForPixel(t);return Math.pow(10,e._startValue+i*e._valueRange)}}function getTickBackdropHeight(t){const e=t.ticks;return e.display&&t.display?valueOrDefault(e.font&&e.font.size,defaults.font.size)+2*e.backdropPaddingY:0}function measureLabelSize(t,e,i){return isArray(i)?{w:_longestText(t,t.font,i),h:i.length*e}:{w:t.measureText(i).width,h:e}}function determineLimits(t,e,i,a,n){return t===a||t===n?{start:e-i/2,end:e+i/2}:tn?{start:e-i,end:e}:{start:e,end:e+i}}function fitWithPointLabels(t){const e={l:0,r:t.width,t:0,b:t.height-t.paddingTop},i={};let a,n,o;t._pointLabelSizes=[];const s=t.chart.data.labels.length;for(a=0;a 0&&t.stroke()}}function W(t,e){return t.x>e.left-.5&&t.x 0&&t.stroke()}}function N(t,e){return t.x>e.left-.5&&t.xt.height-s&&(h="bottom");const u=(r.left+r.right)/2,g=(r.top+r.bottom)/2;"center"===h?(l=t=>t<=u,c=t=>t>u):(l=t=>t<=o/2,c=e=>e>=t.width-o/2);const p=t=>t<=g?"top":"bottom";return l(a)?(d="left",a+o+e.caretSize+e.caretPadding>t.width&&(d="center",h=p(n))):c(a)&&(d="right",(t=>t-o-e.caretSize-e.caretPadding<0)(a)&&(d="center",h=p(n))),{xAlign:e.xAlign?e.xAlign:d,yAlign:e.yAlign?e.yAlign:h}}function alignX(t,e,i){let{x:a,width:n}=t;return"right"===e?a-=n:"center"===e&&(a-=n/2,a+n>i&&(a=i-n),a<0&&(a=0)),a}function alignY(t,e,i){let{y:a,height:n}=t;return"top"===e?a+=i:a-="bottom"===e?n+i:n/2,a}function getBackgroundPoint(t,e,i,a){const{caretSize:n,caretPadding:o,cornerRadius:s}=t,{xAlign:r,yAlign:l}=i,c=n+o,d=s+o;let h=alignX(e,r,a.width);return"center"===l?"left"===r?h+=c:"right"===r&&(h-=c):"left"===r?h-=d:"right"===r&&(h+=d),{x:h,y:alignY(e,l,c)}}function getAlignedX(t,e){const i=t.options;return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-i.xPadding:t.x+i.xPadding}function getBeforeAfterBodyLines(t){return pushOrConcat([],splitNewlines(t))}class Tooltip extends Element{constructor(t){super(),this.opacity=0,this._active=[],this._chart=t._chart,this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this.$animations=void 0,this.options=void 0,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelTextColors=void 0,this.initialize()}initialize(){this.options=resolveOptions$1(this._chart.options.tooltips)}_resolveAnimations(){const t=this,e=t._cachedAnimations;if(e)return e;const i=t._chart,a=t.options,n=a.enabled&&i.options.animation&&a.animation,o=new Animations(t._chart,n);return t._cachedAnimations=Object.freeze(o),o}getTitle(t){const e=this,i=e.options.callbacks,a=i.beforeTitle.apply(e,[t]),n=i.title.apply(e,[t]),o=i.afterTitle.apply(e,[t]);let s=[];return s=pushOrConcat(s,splitNewlines(a)),s=pushOrConcat(s,splitNewlines(n)),s=pushOrConcat(s,splitNewlines(o)),s}getBeforeBody(t){return getBeforeAfterBodyLines(this.options.callbacks.beforeBody.apply(this,[t]))}getBody(t){const e=this,i=e.options.callbacks,a=[];return each(t,t=>{const n={before:[],lines:[],after:[]};pushOrConcat(n.before,splitNewlines(i.beforeLabel.call(e,t))),pushOrConcat(n.lines,i.label.call(e,t)),pushOrConcat(n.after,splitNewlines(i.afterLabel.call(e,t))),a.push(n)}),a}getAfterBody(t){return getBeforeAfterBodyLines(this.options.callbacks.afterBody.apply(this,[t]))}getFooter(t){const e=this,i=e.options.callbacks,a=i.beforeFooter.apply(e,[t]),n=i.footer.apply(e,[t]),o=i.afterFooter.apply(e,[t]);let s=[];return s=pushOrConcat(s,splitNewlines(a)),s=pushOrConcat(s,splitNewlines(n)),s=pushOrConcat(s,splitNewlines(o)),s}_createItems(){const t=this,e=t._active,i=t.options,a=t._chart.data,n=[],o=[];let s,r,l=[];for(s=0,r=e.length;se.r&&(e.r=d.end,i.r=l),h.start{const a=callback(e.options.pointLabels.callback,[t,i],e);return a||0===a?a:""})}fit(){const t=this,e=t.options;e.display&&e.pointLabels.display?fitWithPointLabels(t):t.setCenterPoint(0,0,0,0)}_setReductions(t,e,i){const a=this;let n=e.l/Math.sin(i.l),o=Math.max(e.r-a.width,0)/Math.sin(i.r),s=-e.t/Math.cos(i.t),r=-Math.max(e.b-(a.height-a.paddingTop),0)/Math.cos(i.b);n=numberOrZero(n),o=numberOrZero(o),s=numberOrZero(s),r=numberOrZero(r),a.drawingArea=Math.min(Math.floor(t-(n+o)/2),Math.floor(t-(s+r)/2)),a.setCenterPoint(n,o,s,r)}setCenterPoint(t,e,i,a){const n=this,o=n.width-e-n.drawingArea,s=t+n.drawingArea,r=i+n.drawingArea,l=n.height-n.paddingTop-a-n.drawingArea;n.xCenter=Math.floor((s+o)/2+n.left),n.yCenter=Math.floor((r+l)/2+n.top+n.paddingTop)}getIndexAngle(t){const e=this.chart,i=2*Math.PI/e.data.labels.length,a=(e.options||{}).startAngle||0;return _normalizeAngle(t*i+toRadians(a))}getDistanceFromCenterForValue(t){const e=this;if(isNullOrUndef(t))return NaN;const i=e.drawingArea/(e.max-e.min);return e.options.reverse?(e.max-t)*i:(t-e.min)*i}getValueForDistanceFromCenter(t){if(isNullOrUndef(t))return NaN;const e=this,i=t/(e.drawingArea/(e.max-e.min));return e.options.reverse?e.max-i:e.min+i}getPointPosition(t,e){const i=this,a=i.getIndexAngle(t)-Math.PI/2;return{x:Math.cos(a)*e+i.xCenter,y:Math.sin(a)*e+i.yCenter,angle:a}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}drawGrid(){const t=this,e=t.ctx,i=t.options,a=i.gridLines,n=i.angleLines;let o,s,r;if(i.pointLabels.display&&drawPointLabels(t),a.display&&t.ticks.forEach((e,i)=>{0!==i&&(s=t.getDistanceFromCenterForValue(t.ticks[i].value),drawRadiusLine(t,a,s,i))}),n.display){for(e.save(),o=t.chart.data.labels.length-1;o>=0;o--){const l={chart:t.chart,scale:t,index:o,label:t.pointLabels[o]},c=resolve([n.lineWidth,a.lineWidth],l,o),d=resolve([n.color,a.color],l,o);c&&d&&(e.lineWidth=c,e.strokeStyle=d,e.setLineDash&&(e.setLineDash(resolve([n.borderDash,a.borderDash,[]],l)),e.lineDashOffset=resolve([n.borderDashOffset,a.borderDashOffset,0],l,o)),s=t.getDistanceFromCenterForValue(i.ticks.reverse?t.min:t.max),r=t.getPointPosition(o,s),e.beginPath(),e.moveTo(t.xCenter,t.yCenter),e.lineTo(r.x,r.y),e.stroke())}e.restore()}}drawLabels(){const t=this,e=t.ctx,i=t.options,a=i.ticks;if(!a.display)return;const n=t.getIndexAngle(0);let o,s;e.save(),e.translate(t.xCenter,t.yCenter),e.rotate(n),e.textAlign="center",e.textBaseline="middle",t.ticks.forEach((n,r)=>{const l={chart:t.chart,scale:t,index:r,tick:n};if(0===r&&!i.reverse)return;const c=t._resolveTickFontOptions(r);e.font=c.string,o=t.getDistanceFromCenterForValue(t.ticks[r].value);resolve([a.showLabelBackdrop],l,r)&&(s=e.measureText(n.label).width,e.fillStyle=resolve([a.backdropColor],l,r),e.fillRect(-s/2-a.backdropPaddingX,-o-c.size/2-a.backdropPaddingY,s+2*a.backdropPaddingX,c.size+2*a.backdropPaddingY)),e.fillStyle=c.color,e.fillText(n.label,0,-o)}),e.restore()}drawTitle(){}}RadialLinearScale.id="radialLinear",RadialLinearScale.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,borderDash:[],borderDashOffset:0},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:Ticks.formatters.numeric},pointLabels:{display:!0,font:{size:10},callback:t=>t}};const MAX_INTEGER=Number.MAX_SAFE_INTEGER||9007199254740991,INTERVALS={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},UNITS=Object.keys(INTERVALS);function sorter(t,e){return t-e}function parse(t,e){if(isNullOrUndef(e))return null;const i=t._adapter,a=t.options.time,{parser:n,round:o,isoWeekday:s}=a;let r=e;return"function"==typeof n&&(r=n(r)),isNumberFinite(r)||(r="string"==typeof n?i.parse(r,n):i.parse(r)),null===r?r:(o&&(r="week"===o&&s?t._adapter.startOf(r,"isoWeek",s):t._adapter.startOf(r,o)),+r)}function determineUnitForAutoTicks(t,e,i,a){const n=UNITS.length;for(let o=UNITS.indexOf(t);o0){var s=o[0].datasetIndex,l=t.getDatasetMeta(s).data;o=[];for(var c=0;cr&&t[a%e].skip;)a--;return{start:r,end:a%=e}}(e,n,r,i),o=a.start,s=a.end;return!0===i?[{start:o,end:s,loop:r}]:function(t,e,i,n){var r,a=t.length,o=[],s=e,l=t[e];for(r=e+1;r<=i;++r){var c=t[r%a];c.skip||c.stop?l.skip||(n=!1,o.push({start:e%a,end:(r-1)%a,loop:n}),e=s=c.stop?r:null):(s=r,l.skip&&(e=r)),l=c}return null!==s&&o.push({start:e%a,end:s%a,loop:n}),o}(e,o,s=0;t--){var l={chart:n.chart,scale:n,index:t,label:n.pointLabels[t]},c=xt([s.lineWidth,o.lineWidth],l,t),u=xt([s.color,o.color],l,t);c&&u&&(r.lineWidth=c,r.strokeStyle=u,r.setLineDash&&(r.setLineDash(xt([s.borderDash,o.borderDash,[]],l)),r.lineDashOffset=xt([s.borderDashOffset,o.borderDashOffset,0],l,t)),e=n.getDistanceFromCenterForValue(a.ticks.reverse?n.min:n.max),i=n.getPointPosition(t,e),r.beginPath(),r.moveTo(n.xCenter,n.yCenter),r.lineTo(i.x,i.y),r.stroke())}r.restore()}},i.drawLabels=function(){var t=this,e=t.ctx,i=t.options,n=i.ticks;if(n.display){var r,a,o=t.getIndexAngle(0);e.save(),e.translate(t.xCenter,t.yCenter),e.rotate(o),e.textAlign="center",e.textBaseline="middle",t.ticks.forEach((function(o,s){var l={chart:t.chart,scale:t,index:s,tick:o};if(0!==s||i.reverse){var c=t._resolveTickFontOptions(s);e.font=c.string,r=t.getDistanceFromCenterForValue(t.ticks[s].value),xt([n.showLabelBackdrop],l,s)&&(a=e.measureText(o.label).width,e.fillStyle=xt([n.backdropColor],l,s),e.fillRect(-a/2-n.backdropPaddingX,-r-c.size/2-n.backdropPaddingY,a+2*n.backdropPaddingX,c.size+2*n.backdropPaddingY)),e.fillStyle=c.color,e.fillText(o.label,0,-r)}})),e.restore()}},i.drawTitle=function(){},e}(Lr);Yr.id="radialLinear",Yr.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,borderDash:[],borderDashOffset:0},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:Oi.formatters.numeric},pointLabels:{display:!0,font:{size:10},callback:function(t){return t}}};var Xr=Number.MAX_SAFE_INTEGER||9007199254740991,Ur={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},qr=Object.keys(Ur);function Kr(t,e){return t-e}function Gr(t,e){if(u(e))return null;var i=t._adapter,n=t.options.time,r=n.parser,a=n.round,o=n.isoWeekday,s=e;return"function"==typeof r&&(s=r(s)),f(s)||(s="string"==typeof r?i.parse(s,r):i.parse(s)),null===s?s:(a&&(s="week"===a&&o?t._adapter.startOf(s,"isoWeek",o):t._adapter.startOf(s,a)),+s)}function $r(t,e,i,n){for(var r=qr.length,a=qr.indexOf(t);a=0&&(e[a].major=!0);return e}(t,a,o,i):a}var Jr=function(t){function e(e){var i;return(i=t.call(this,e)||this)._cache={data:[],labels:[],all:[]},i._unit="day",i._majorUnit=void 0,i._offsets={},i._normalized=!1,i}n(e,t);var i=e.prototype;return i.init=function(e,i){var n=e.time||(e.time={}),r=this._adapter=new un._date(e.adapters.date);_(n.displayFormats,r.formats()),t.prototype.init.call(this,e),this._normalized=i.normalized},i.parse=function(t,e){return void 0===t?NaN:Gr(this,t)},i.invalidateCaches=function(){this._cache={data:[],labels:[],all:[]}},i.determineDataLimits=function(){var t=this,e=t.options,i=t._adapter,n=e.time.unit||"day",r=t.getUserBounds(),a=r.min,o=r.max,s=r.minDefined,l=r.maxDefined;function c(t){s||isNaN(t.min)||(a=Math.min(a,t.min)),l||isNaN(t.max)||(o=Math.max(o,t.max))}s&&l||(c(t._getLabelBounds()),"ticks"===e.bounds&&"labels"===e.ticks.source||c(t.getMinMax(!1))),a=f(a)&&!isNaN(a)?a:+i.startOf(Date.now(),n),o=f(o)&&!isNaN(o)?o:+i.endOf(Date.now(),n)+1,t.min=Math.min(a,o),t.max=Math.max(a+1,o)},i._getLabelBounds=function(){var t=this.getLabelTimestamps(),e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}},i.buildTicks=function(){var t=this,e=t.options,i=e.time,n=e.ticks,r="labels"===n.source?t.getLabelTimestamps():t._generate();"ticks"===e.bounds&&r.length&&(t.min=t._userMin||r[0],t.max=t._userMax||r[r.length-1]);var a=t.min,o=function(t,e,i){for(var n=0,r=t.length;n0){var s=o[0].datasetIndex,l=t.getDatasetMeta(s).data;o=[];for(var c=0;c