Commit f88075ff authored by Vivek's avatar Vivek

added chartjs files

parent e365a9d3
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>chartjs</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>chartjs</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41271265.9</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>.gitignore</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/octet-stream</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string>\n
.DS_Store\n
\n
node_modules/*\n
custom/*\n
\n
docs/index.md\n
\n
.settings/\n
</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>63</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>.gitignore</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41271277.17</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>.travis.yml</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/octet-stream</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string>language: node_js\n
node_js:\n
- "0.11"\n
- "0.10"\n
\n
before_script:\n
- npm install\n
\n
script:\n
- gulp test\n
\n
notifications:\n
slack: chartjs:pcfCZR6ugg5TEcaLtmIfQYuA\n
</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>162</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>.travis.yml</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41271270.02</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>CONTRIBUTING.md</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/octet-stream</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string>Contributing to Chart.js\n
========================\n
\n
Contributions to Chart.js are welcome and encouraged, but please have a look through the guidelines in this document before raising an issue, or writing code for the project.\n
\n
\n
Using issues\n
------------\n
\n
The [issue tracker](https://github.com/nnnick/Chart.js/issues) is the preferred channel for reporting bugs, requesting new features and submitting pull requests.\n
\n
If you\'re suggesting a new chart type, please take a look at [writing new chart types](https://github.com/nnnick/Chart.js/blob/master/docs/06-Advanced.md#writing-new-chart-types) in the documentation, and some of the [community extensions](https://github.com/nnnick/Chart.js/blob/master/docs/06-Advanced.md#community-extensions) that have been created already.\n
\n
To keep the library lightweight for everyone, it\'s unlikely we\'ll add many more chart types to the core of Chart.js, but issues are a good medium to design and spec out how new chart types could work and look.\n
\n
Please do not use issues for support requests. For help using Chart.js, please take a look at the [`chartjs`](http://stackoverflow.com/questions/tagged/chartjs) tag on Stack Overflow.\n
\n
\n
Reporting bugs\n
--------------\n
\n
Well structured, detailed bug reports are hugely valuable for the project.\n
\n
Guidlines for reporting bugs:\n
\n
- Check the issue search to see if it has already been reported\n
- Isolate the problem to a simple test case\n
- Provide a demonstration of the problem on [JS Bin](http://jsbin.com) or similar\n
\n
Please provide any additional details associated with the bug, if it\'s browser or screen density specific, or only happens with a certain configuration or data.\n
\n
\n
Pull requests\n
-------------\n
\n
Clear, concise pull requests are excellent at continuing the project\'s community driven growth. But please review [these guidelines](https://github.com/blog/1943-how-to-write-the-perfect-pull-request) and the guidelines below before starting work on the project.\n
\n
Guidlines:\n
\n
- Please create an issue first:\n
- For bugs, we can discuss the fixing approach\n
- For enhancements, we can discuss if it is within the project scope and avoid duplicate effort\n
- Please make changes to the files in [`/src`](https://github.com/nnnick/Chart.js/tree/master/src), not `Chart.js` or `Chart.min.js` in the repo root directory, this avoids merge conflicts\n
- Tabs for indentation, not spaces please\n
- If adding new functionality, please also update the relevant `.md` file in [`/docs`](https://github.com/nnnick/Chart.js/tree/master/docs)\n
- Please make your commits in logical sections with clear commit messages\n
\n
Joining the Project\n
-------------\n
- Active committers and contributors are invited to introduce yourself and request commit access to this project. Please send an email to hello@nickdownie.com or file an issue. \n
\n
License\n
-------\n
\n
By contributing your code, you agree to license your contribution under the [MIT license](https://github.com/nnnick/Chart.js/blob/master/LICENSE.md).\n
</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>2991</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>CONTRIBUTING.md</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
This source diff could not be displayed because it is too large. You can view the blob instead.
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41271269.18</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Chart.min.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
/*!\n
* Chart.js\n
* http://chartjs.org/\n
* Version: 1.0.2\n
*\n
* Copyright 2015 Nick Downie\n
* Released under the MIT license\n
* https://github.com/nnnick/Chart.js/blob/master/LICENSE.md\n
*/\n
(function(){"use strict";var t=this,i=t.Chart,e=function(t){this.canvas=t.canvas,this.ctx=t;var i=function(t,i){return t["offset"+i]?t["offset"+i]:document.defaultView.getComputedStyle(t).getPropertyValue(i)},e=this.width=i(t.canvas,"Width"),n=this.height=i(t.canvas,"Height");t.canvas.width=e,t.canvas.height=n;var e=this.width=t.canvas.width,n=this.height=t.canvas.height;return this.aspectRatio=this.width/this.height,s.retinaScale(this),this};e.defaults={global:{animation:!0,animationSteps:60,animationEasing:"easeOutQuart",showScale:!0,scaleOverride:!1,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleLineColor:"rgba(0,0,0,.1)",scaleLineWidth:1,scaleShowLabels:!0,scaleLabel:"<%=value%>",scaleIntegersOnly:!0,scaleBeginAtZero:!1,scaleFontFamily:"\'Helvetica Neue\', \'Helvetica\', \'Arial\', sans-serif",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",responsive:!1,maintainAspectRatio:!0,showTooltips:!0,customTooltips:!1,tooltipEvents:["mousemove","touchstart","touchmove","mouseout"],tooltipFillColor:"rgba(0,0,0,0.8)",tooltipFontFamily:"\'Helvetica Neue\', \'Helvetica\', \'Arial\', sans-serif",tooltipFontSize:14,tooltipFontStyle:"normal",tooltipFontColor:"#fff",tooltipTitleFontFamily:"\'Helvetica Neue\', \'Helvetica\', \'Arial\', sans-serif",tooltipTitleFontSize:14,tooltipTitleFontStyle:"bold",tooltipTitleFontColor:"#fff",tooltipYPadding:6,tooltipXPadding:6,tooltipCaretSize:8,tooltipCornerRadius:6,tooltipXOffset:10,tooltipTemplate:"<%if (label){%><%=label%>: <%}%><%= value %>",multiTooltipTemplate:"<%= value %>",multiTooltipKeyBackground:"#fff",onAnimationProgress:function(){},onAnimationComplete:function(){}}},e.types={};var s=e.helpers={},n=s.each=function(t,i,e){var s=Array.prototype.slice.call(arguments,3);if(t)if(t.length===+t.length){var n;for(n=0;n<t.length;n++)i.apply(e,[t[n],n].concat(s))}else for(var o in t)i.apply(e,[t[o],o].concat(s))},o=s.clone=function(t){var i={};return n(t,function(e,s){t.hasOwnProperty(s)&&(i[s]=e)}),i},a=s.extend=function(t){return n(Array.prototype.slice.call(arguments,1),function(i){n(i,function(e,s){i.hasOwnProperty(s)&&(t[s]=e)})}),t},h=s.merge=function(){var t=Array.prototype.slice.call(arguments,0);return t.unshift({}),a.apply(null,t)},l=s.indexOf=function(t,i){if(Array.prototype.indexOf)return t.indexOf(i);for(var e=0;e<t.length;e++)if(t[e]===i)return e;return-1},r=(s.where=function(t,i){var e=[];return s.each(t,function(t){i(t)&&e.push(t)}),e},s.findNextWhere=function(t,i,e){e||(e=-1);for(var s=e+1;s<t.length;s++){var n=t[s];if(i(n))return n}},s.findPreviousWhere=function(t,i,e){e||(e=t.length);for(var s=e-1;s>=0;s--){var n=t[s];if(i(n))return n}},s.inherits=function(t){var i=this,e=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return i.apply(this,arguments)},s=function(){this.constructor=e};return s.prototype=i.prototype,e.prototype=new s,e.extend=r,t&&a(e.prototype,t),e.__super__=i.prototype,e}),c=s.noop=function(){},u=s.uid=function(){var t=0;return function(){return"chart-"+t++}}(),d=s.warn=function(t){window.console&&"function"==typeof window.console.warn&&console.warn(t)},p=s.amd="function"==typeof define&&define.amd,f=s.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},g=s.max=function(t){return Math.max.apply(Math,t)},m=s.min=function(t){return Math.min.apply(Math,t)},v=(s.cap=function(t,i,e){if(f(i)){if(t>i)return i}else if(f(e)&&e>t)return e;return t},s.getDecimalPlaces=function(t){return t%1!==0&&f(t)?t.toString().split(".")[1].length:0}),S=s.radians=function(t){return t*(Math.PI/180)},x=(s.getAngleFromPoint=function(t,i){var e=i.x-t.x,s=i.y-t.y,n=Math.sqrt(e*e+s*s),o=2*Math.PI+Math.atan2(s,e);return 0>e&&0>s&&(o+=2*Math.PI),{angle:o,distance:n}},s.aliasPixel=function(t){return t%2===0?0:.5}),y=(s.splineCurve=function(t,i,e,s){var n=Math.sqrt(Math.pow(i.x-t.x,2)+Math.pow(i.y-t.y,2)),o=Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2)),a=s*n/(n+o),h=s*o/(n+o);return{inner:{x:i.x-a*(e.x-t.x),y:i.y-a*(e.y-t.y)},outer:{x:i.x+h*(e.x-t.x),y:i.y+h*(e.y-t.y)}}},s.calculateOrderOfMagnitude=function(t){return Math.floor(Math.log(t)/Math.LN10)}),C=(s.calculateScaleRange=function(t,i,e,s,n){var o=2,a=Math.floor(i/(1.5*e)),h=o>=a,l=g(t),r=m(t);l===r&&(l+=.5,r>=.5&&!s?r-=.5:l+=.5);for(var c=Math.abs(l-r),u=y(c),d=Math.ceil(l/(1*Math.pow(10,u)))*Math.pow(10,u),p=s?0:Math.floor(r/(1*Math.pow(10,u)))*Math.pow(10,u),f=d-p,v=Math.pow(10,u),S=Math.round(f/v);(S>a||a>2*S)&&!h;)if(S>a)v*=2,S=Math.round(f/v),S%1!==0&&(h=!0);else if(n&&u>=0){if(v/2%1!==0)break;v/=2,S=Math.round(f/v)}else v/=2,S=Math.round(f/v);return h&&(S=o,v=f/S),{steps:S,stepValue:v,min:p,max:p+S*v}},s.template=function(t,i){function e(t,i){var e=/\\W/.test(t)?new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push(\'"+t.replace(/[\\r\\t\\n]/g," ").split("<%").join("\t").replace(/((^|%>)[^\\t]*)\'/g,"$1\\r").replace(/\\t=(.*?)%>/g,"\',$1,\'").split("\t").join("\');").split("%>").join("p.push(\'").split("\\r").join("\\\\\'")+"\');}return p.join(\'\');"):s[t]=s[t];return i?e(i):e}if(t instanceof Function)return t(i);var s={};return e(t,i)}),w=(s.generateLabels=function(t,i,e,s){var o=new Array(i);return labelTemplateString&&n(o,function(i,n){o[n]=C(t,{value:e+s*(n+1)})}),o},s.easingEffects={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return-1*t*(t-2)},easeInOutQuad:function(t){return(t/=.5)<1?.5*t*t:-0.5*(--t*(t-2)-1)},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return 1*((t=t/1-1)*t*t+1)},easeInOutCubic:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return-1*((t=t/1-1)*t*t*t-1)},easeInOutQuart:function(t){return(t/=.5)<1?.5*t*t*t*t:-0.5*((t-=2)*t*t*t-2)},easeInQuint:function(t){return 1*(t/=1)*t*t*t*t},easeOutQuint:function(t){return 1*((t=t/1-1)*t*t*t*t+1)},easeInOutQuint:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},easeInSine:function(t){return-1*Math.cos(t/1*(Math.PI/2))+1},easeOutSine:function(t){return 1*Math.sin(t/1*(Math.PI/2))},easeInOutSine:function(t){return-0.5*(Math.cos(Math.PI*t/1)-1)},easeInExpo:function(t){return 0===t?1:1*Math.pow(2,10*(t/1-1))},easeOutExpo:function(t){return 1===t?1:1*(-Math.pow(2,-10*t/1)+1)},easeInOutExpo:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(-Math.pow(2,-10*--t)+2)},easeInCirc:function(t){return t>=1?t:-1*(Math.sqrt(1-(t/=1)*t)-1)},easeOutCirc:function(t){return 1*Math.sqrt(1-(t=t/1-1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-0.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var i=1.70158,e=0,s=1;return 0===t?0:1==(t/=1)?1:(e||(e=.3),s<Math.abs(1)?(s=1,i=e/4):i=e/(2*Math.PI)*Math.asin(1/s),-(s*Math.pow(2,10*(t-=1))*Math.sin(2*(1*t-i)*Math.PI/e)))},easeOutElastic:function(t){var i=1.70158,e=0,s=1;return 0===t?0:1==(t/=1)?1:(e||(e=.3),s<Math.abs(1)?(s=1,i=e/4):i=e/(2*Math.PI)*Math.asin(1/s),s*Math.pow(2,-10*t)*Math.sin(2*(1*t-i)*Math.PI/e)+1)},easeInOutElastic:function(t){var i=1.70158,e=0,s=1;return 0===t?0:2==(t/=.5)?1:(e||(e=.3*1.5),s<Math.abs(1)?(s=1,i=e/4):i=e/(2*Math.PI)*Math.asin(1/s),1>t?-.5*s*Math.pow(2,10*(t-=1))*Math.sin(2*(1*t-i)*Math.PI/e):s*Math.pow(2,-10*(t-=1))*Math.sin(2*(1*t-i)*Math.PI/e)*.5+1)},easeInBack:function(t){var i=1.70158;return 1*(t/=1)*t*((i+1)*t-i)},easeOutBack:function(t){var i=1.70158;return 1*((t=t/1-1)*t*((i+1)*t+i)+1)},easeInOutBack:function(t){var i=1.70158;return(t/=.5)<1?.5*t*t*(((i*=1.525)+1)*t-i):.5*((t-=2)*t*(((i*=1.525)+1)*t+i)+2)},easeInBounce:function(t){return 1-w.easeOutBounce(1-t)},easeOutBounce:function(t){return(t/=1)<1/2.75?7.5625*t*t:2/2.75>t?1*(7.5625*(t-=1.5/2.75)*t+.75):2.5/2.75>t?1*(7.5625*(t-=2.25/2.75)*t+.9375):1*(7.5625*(t-=2.625/2.75)*t+.984375)},easeInOutBounce:function(t){return.5>t?.5*w.easeInBounce(2*t):.5*w.easeOutBounce(2*t-1)+.5}}),b=s.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)}}(),P=s.cancelAnimFrame=function(){return window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||function(t){return window.clearTimeout(t,1e3/60)}}(),L=(s.animationLoop=function(t,i,e,s,n,o){var a=0,h=w[e]||w.linear,l=function(){a++;var e=a/i,r=h(e);t.call(o,r,e,a),s.call(o,r,e),i>a?o.animationFrame=b(l):n.apply(o)};b(l)},s.getRelativePosition=function(t){var i,e,s=t.originalEvent||t,n=t.currentTarget||t.srcElement,o=n.getBoundingClientRect();return s.touches?(i=s.touches[0].clientX-o.left,e=s.touches[0].clientY-o.top):(i=s.clientX-o.left,e=s.clientY-o.top),{x:i,y:e}},s.addEvent=function(t,i,e){t.addEventListener?t.addEventListener(i,e):t.attachEvent?t.attachEvent("on"+i,e):t["on"+i]=e}),k=s.removeEvent=function(t,i,e){t.removeEventListener?t.removeEventListener(i,e,!1):t.detachEvent?t.detachEvent("on"+i,e):t["on"+i]=c},F=(s.bindEvents=function(t,i,e){t.events||(t.events={}),n(i,function(i){t.events[i]=function(){e.apply(t,arguments)},L(t.chart.canvas,i,t.events[i])})},s.unbindEvents=function(t,i){n(i,function(i,e){k(t.chart.canvas,e,i)})}),R=s.getMaximumWidth=function(t){var i=t.parentNode;return i.clientWidth},T=s.getMaximumHeight=function(t){var i=t.parentNode;return i.clientHeight},A=(s.getMaximumSize=s.getMaximumWidth,s.retinaScale=function(t){var i=t.ctx,e=t.canvas.width,s=t.canvas.height;window.devicePixelRatio&&(i.canvas.style.width=e+"px",i.canvas.style.height=s+"px",i.canvas.height=s*window.devicePixelRatio,i.canvas.width=e*window.devicePixelRatio,i.scale(window.devicePixelRatio,window.devicePixelRatio))}),M=s.clear=function(t){t.ctx.clearRect(0,0,t.width,t.height)},W=s.fontString=function(t,i,e){return i+" "+t+"px "+e},z=s.longestText=function(t,i,e){t.font=i;var s=0;return n(e,function(i){var e=t.measureText(i).width;s=e>s?e:s}),s},B=s.drawRoundedRectangle=function(t,i,e,s,n,o){t.beginPath(),t.moveTo(i+o,e),t.lineTo(i+s-o,e),t.quadraticCurveTo(i+s,e,i+s,e+o),t.lineTo(i+s,e+n-o),t.quadraticCurveTo(i+s,e+n,i+s-o,e+n),t.lineTo(i+o,e+n),t.quadraticCurveTo(i,e+n,i,e+n-o),t.lineTo(i,e+o),t.quadraticCurveTo(i,e,i+o,e),t.closePath()};e.instances={},e.Type=function(t,i,s){this.options=i,this.chart=s,this.id=u(),e.instances[this.id]=this,i.responsive&&this.resize(),this.initialize.call(this,t)},a(e.Type.prototype,{initialize:function(){return this},clear:function(){return M(this.chart),this},stop:function(){return P(this.animationFrame),this},resize:function(t){this.stop();var i=this.chart.canvas,e=R(this.chart.canvas),s=this.options.maintainAspectRatio?e/this.chart.aspectRatio:T(this.chart.canvas);return i.width=this.chart.width=e,i.height=this.chart.height=s,A(this.chart),"function"==typeof t&&t.apply(this,Array.prototype.slice.call(arguments,1)),this},reflow:c,render:function(t){return t&&this.reflow(),this.options.animation&&!t?s.animationLoop(this.draw,this.options.animationSteps,this.options.animationEasing,this.options.onAnimationProgress,this.options.onAnimationComplete,this):(this.draw(),this.options.onAnimationComplete.call(this)),this},generateLegend:function(){return C(this.options.legendTemplate,this)},destroy:function(){this.clear(),F(this,this.events);var t=this.chart.canvas;t.width=this.chart.width,t.height=this.chart.height,t.style.removeProperty?(t.style.removeProperty("width"),t.style.removeProperty("height")):(t.style.removeAttribute("width"),t.style.removeAttribute("height")),delete e.instances[this.id]},showTooltip:function(t,i){"undefined"==typeof this.activeElements&&(this.activeElements=[]);var o=function(t){var i=!1;return t.length!==this.activeElements.length?i=!0:(n(t,function(t,e){t!==this.activeElements[e]&&(i=!0)},this),i)}.call(this,t);if(o||i){if(this.activeElements=t,this.draw(),this.options.customTooltips&&this.options.customTooltips(!1),t.length>0)if(this.datasets&&this.datasets.length>1){for(var a,h,r=this.datasets.length-1;r>=0&&(a=this.datasets[r].points||this.datasets[r].bars||this.datasets[r].segments,h=l(a,t[0]),-1===h);r--);var c=[],u=[],d=function(){var t,i,e,n,o,a=[],l=[],r=[];return s.each(this.datasets,function(i){t=i.points||i.bars||i.segments,t[h]&&t[h].hasValue()&&a.push(t[h])}),s.each(a,function(t){l.push(t.x),r.push(t.y),c.push(s.template(this.options.multiTooltipTemplate,t)),u.push({fill:t._saved.fillColor||t.fillColor,stroke:t._saved.strokeColor||t.strokeColor})},this),o=m(r),e=g(r),n=m(l),i=g(l),{x:n>this.chart.width/2?n:i,y:(o+e)/2}}.call(this,h);new e.MultiTooltip({x:d.x,y:d.y,xPadding:this.options.tooltipXPadding,yPadding:this.options.tooltipYPadding,xOffset:this.options.tooltipXOffset,fillColor:this.options.tooltipFillColor,textColor:this.options.tooltipFontColor,fontFamily:this.options.tooltipFontFamily,fontStyle:this.options.tooltipFontStyle,fontSize:this.options.tooltipFontSize,titleTextColor:this.options.tooltipTitleFontColor,titleFontFamily:this.options.tooltipTitleFontFamily,titleFontStyle:this.options.tooltipTitleFontStyle,titleFontSize:this.options.tooltipTitleFontSize,cornerRadius:this.options.tooltipCornerRadius,labels:c,legendColors:u,legendColorBackground:this.options.multiTooltipKeyBackground,title:t[0].label,chart:this.chart,ctx:this.chart.ctx,custom:this.options.customTooltips}).draw()}else n(t,function(t){var i=t.tooltipPosition();new e.Tooltip({x:Math.round(i.x),y:Math.round(i.y),xPadding:this.options.tooltipXPadding,yPadding:this.options.tooltipYPadding,fillColor:this.options.tooltipFillColor,textColor:this.options.tooltipFontColor,fontFamily:this.options.tooltipFontFamily,fontStyle:this.options.tooltipFontStyle,fontSize:this.options.tooltipFontSize,caretHeight:this.options.tooltipCaretSize,cornerRadius:this.options.tooltipCornerRadius,text:C(this.options.tooltipTemplate,t),chart:this.chart,custom:this.options.customTooltips}).draw()},this);return this}},toBase64Image:function(){return this.chart.canvas.toDataURL.apply(this.chart.canvas,arguments)}}),e.Type.extend=function(t){var i=this,s=function(){return i.apply(this,arguments)};if(s.prototype=o(i.prototype),a(s.prototype,t),s.extend=e.Type.extend,t.name||i.prototype.name){var n=t.name||i.prototype.name,l=e.defaults[i.prototype.name]?o(e.defaults[i.prototype.name]):{};e.defaults[n]=a(l,t.defaults),e.types[n]=s,e.prototype[n]=function(t,i){var o=h(e.defaults.global,e.defaults[n],i||{});return new s(t,o,this)}}else d("Name not provided for this chart, so it hasn\'t been registered");return i},e.Element=function(t){a(this,t),this.initialize.apply(this,arguments),this.save()},a(e.Element.prototype,{initialize:function(){},restore:function(t){return t?n(t,function(t){this[t]=this._saved[t]},this):a(this,this._saved),this},save:function(){return this._saved=o(this),delete this._saved._saved,this},update:function(t){return n(t,function(t,i){this._saved[i]=this[i],this[i]=t},this),this},transition:function(t,i){return n(t,function(t,e){this[e]=(t-this._saved[e])*i+this._saved[e]},this),this},tooltipPosition:function(){return{x:this.x,y:this.y}},hasValue:function(){return f(this.value)}}),e.Element.extend=r,e.Point=e.Element.extend({display:!0,inRange:function(t,i){var e=this.hitDetectionRadius+this.radius;return Math.pow(t-this.x,2)+Math.pow(i-this.y,2)<Math.pow(e,2)},draw:function(){if(this.display){var t=this.ctx;t.beginPath(),t.arc(this.x,this.y,this.radius,0,2*Math.PI),t.closePath(),t.strokeStyle=this.strokeColor,t.lineWidth=this.strokeWidth,t.fillStyle=this.fillColor,t.fill(),t.stroke()}}}),e.Arc=e.Element.extend({inRange:function(t,i){var e=s.getAngleFromPoint(this,{x:t,y:i}),n=e.angle>=this.startAngle&&e.angle<=this.endAngle,o=e.distance>=this.innerRadius&&e.distance<=this.outerRadius;return n&&o},tooltipPosition:function(){var t=this.startAngle+(this.endAngle-this.startAngle)/2,i=(this.outerRadius-this.innerRadius)/2+this.innerRadius;return{x:this.x+Math.cos(t)*i,y:this.y+Math.sin(t)*i}},draw:function(t){var i=this.ctx;i.beginPath(),i.arc(this.x,this.y,this.outerRadius,this.startAngle,this.endAngle),i.arc(this.x,this.y,this.innerRadius,this.endAngle,this.startAngle,!0),i.closePath(),i.strokeStyle=this.strokeColor,i.lineWidth=this.strokeWidth,i.fillStyle=this.fillColor,i.fill(),i.lineJoin="bevel",this.showStroke&&i.stroke()}}),e.Rectangle=e.Element.extend({draw:function(){var t=this.ctx,i=this.width/2,e=this.x-i,s=this.x+i,n=this.base-(this.base-this.y),o=this.strokeWidth/2;this.showStroke&&(e+=o,s-=o,n+=o),t.beginPath(),t.fillStyle=this.fillColor,t.strokeStyle=this.strokeColor,t.lineWidth=this.strokeWidth,t.moveTo(e,this.base),t.lineTo(e,n),t.lineTo(s,n),t.lineTo(s,this.base),t.fill(),this.showStroke&&t.stroke()},height:function(){return this.base-this.y},inRange:function(t,i){return t>=this.x-this.width/2&&t<=this.x+this.width/2&&i>=this.y&&i<=this.base}}),e.Tooltip=e.Element.extend({draw:function(){var t=this.chart.ctx;t.font=W(this.fontSize,this.fontStyle,this.fontFamily),this.xAlign="center",this.yAlign="above";var i=this.caretPadding=2,e=t.measureText(this.text).width+2*this.xPadding,s=this.fontSize+2*this.yPadding,n=s+this.caretHeight+i;this.x+e/2>this.chart.width?this.xAlign="left":this.x-e/2<0&&(this.xAlign="right"),this.y-n<0&&(this.yAlign="below");var o=this.x-e/2,a=this.y-n;if(t.fillStyle=this.fillColor,this.custom)this.custom(this);else{switch(this.yAlign){case"above":t.beginPath(),t.moveTo(this.x,this.y-i),t.lineTo(this.x+this.caretHeight,this.y-(i+this.caretHeight)),t.lineTo(this.x-this.caretHeight,this.y-(i+this.caretHeight)),t.closePath(),t.fill();break;case"below":a=this.y+i+this.caretHeight,t.beginPath(),t.moveTo(this.x,this.y+i),t.lineTo(this.x+this.caretHeight,this.y+i+this.caretHeight),t.lineTo(this.x-this.caretHeight,this.y+i+this.caretHeight),t.closePath(),t.fill()}switch(this.xAlign){case"left":o=this.x-e+(this.cornerRadius+this.caretHeight);break;case"right":o=this.x-(this.cornerRadius+this.caretHeight)}B(t,o,a,e,s,this.cornerRadius),t.fill(),t.fillStyle=this.textColor,t.textAlign="center",t.textBaseline="middle",t.fillText(this.text,o+e/2,a+s/2)}}}),e.MultiTooltip=e.Element.extend({initialize:function(){this.font=W(this.fontSize,this.fontStyle,this.fontFamily),this.titleFont=W(this.titleFontSize,this.titleFontStyle,this.titleFontFamily),this.height=this.labels.length*this.fontSize+(this.labels.length-1)*(this.fontSize/2)+2*this.yPadding+1.5*this.titleFontSize,this.ctx.font=this.titleFont;var t=this.ctx.measureText(this.title).width,i=z(this.ctx,this.font,this.labels)+this.fontSize+3,e=g([i,t]);this.width=e+2*this.xPadding;var s=this.height/2;this.y-s<0?this.y=s:this.y+s>this.chart.height&&(this.y=this.chart.height-s),this.x>this.chart.width/2?this.x-=this.xOffset+this.width:this.x+=this.xOffset},getLineHeight:function(t){var i=this.y-this.height/2+this.yPadding,e=t-1;return 0===t?i+this.titleFontSize/2:i+(1.5*this.fontSize*e+this.fontSize/2)+1.5*this.titleFontSize},draw:function(){if(this.custom)this.custom(this);else{B(this.ctx,this.x,this.y-this.height/2,this.width,this.height,this.cornerRadius);var t=this.ctx;t.fillStyle=this.fillColor,t.fill(),t.closePath(),t.textAlign="left",t.textBaseline="middle",t.fillStyle=this.titleTextColor,t.font=this.titleFont,t.fillText(this.title,this.x+this.xPadding,this.getLineHeight(0)),t.font=this.font,s.each(this.labels,function(i,e){t.fillStyle=this.textColor,t.fillText(i,this.x+this.xPadding+this.fontSize+3,this.getLineHeight(e+1)),t.fillStyle=this.legendColorBackground,t.fillRect(this.x+this.xPadding,this.getLineHeight(e+1)-this.fontSize/2,this.fontSize,this.fontSize),t.fillStyle=this.legendColors[e].fill,t.fillRect(this.x+this.xPadding,this.getLineHeight(e+1)-this.fontSize/2,this.fontSize,this.fontSize)},this)}}}),e.Scale=e.Element.extend({initialize:function(){this.fit()},buildYLabels:function(){this.yLabels=[];for(var t=v(this.stepValue),i=0;i<=this.steps;i++)this.yLabels.push(C(this.templateString,{value:(this.min+i*this.stepValue).toFixed(t)}));this.yLabelWidth=this.display&&this.showLabels?z(this.ctx,this.font,this.yLabels):0},addXLabel:function(t){this.xLabels.push(t),this.valuesCount++,this.fit()},removeXLabel:function(){this.xLabels.shift(),this.valuesCount--,this.fit()},fit:function(){this.startPoint=this.display?this.fontSize:0,this.endPoint=this.display?this.height-1.5*this.fontSize-5:this.height,this.startPoint+=this.padding,this.endPoint-=this.padding;var t,i=this.endPoint-this.startPoint;for(this.calculateYRange(i),this.buildYLabels(),this.calculateXLabelRotation();i>this.endPoint-this.startPoint;)i=this.endPoint-this.startPoint,t=this.yLabelWidth,this.calculateYRange(i),this.buildYLabels(),t<this.yLabelWidth&&this.calculateXLabelRotation()},calculateXLabelRotation:function(){this.ctx.font=this.font;var t,i,e=this.ctx.measureText(this.xLabels[0]).width,s=this.ctx.measureText(this.xLabels[this.xLabels.length-1]).width;if(this.xScalePaddingRight=s/2+3,this.xScalePaddingLeft=e/2>this.yLabelWidth+10?e/2:this.yLabelWidth+10,this.xLabelRotation=0,this.display){var n,o=z(this.ctx,this.font,this.xLabels);this.xLabelWidth=o;for(var a=Math.floor(this.calculateX(1)-this.calculateX(0))-6;this.xLabelWidth>a&&0===this.xLabelRotation||this.xLabelWidth>a&&this.xLabelRotation<=90&&this.xLabelRotation>0;)n=Math.cos(S(this.xLabelRotation)),t=n*e,i=n*s,t+this.fontSize/2>this.yLabelWidth+8&&(this.xScalePaddingLeft=t+this.fontSize/2),this.xScalePaddingRight=this.fontSize/2,this.xLabelRotation++,this.xLabelWidth=n*o;this.xLabelRotation>0&&(this.endPoint-=Math.sin(S(this.xLabelRotation))*o+3)}else this.xLabelWidth=0,this.xScalePaddingRight=this.padding,this.xScalePaddingLeft=this.padding},calculateYRange:c,drawingArea:function(){return this.startPoint-this.endPoint},calculateY:function(t){var i=this.drawingArea()/(this.min-this.max);return this.endPoint-i*(t-this.min)},calculateX:function(t){var i=(this.xLabelRotation>0,this.width-(this.xScalePaddingLeft+this.xScalePaddingRight)),e=i/Math.max(this.valuesCount-(this.offsetGridLines?0:1),1),s=e*t+this.xScalePaddingLeft;return this.offsetGridLines&&(s+=e/2),Math.round(s)},update:function(t){s.extend(this,t),this.fit()},draw:function(){var t=this.ctx,i=(this.endPoint-this.startPoint)/this.steps,e=Math.round(this.xScalePaddingLeft);this.display&&(t.fillStyle=this.textColor,t.font=this.font,n(this.yLabels,function(n,o){var a=this.endPoint-i*o,h=Math.round(a),l=this.showHorizontalLines;t.textAlign="right",t.textBaseline="middle",this.showLabels&&t.fillText(n,e-10,a),0!==o||l||(l=!0),l&&t.beginPath(),o>0?(t.lineWidth=this.gridLineWidth,t.strokeStyle=this.gridLineColor):(t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor),h+=s.aliasPixel(t.lineWidth),l&&(t.moveTo(e,h),t.lineTo(this.width,h),t.stroke(),t.closePath()),t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor,t.beginPath(),t.moveTo(e-5,h),t.lineTo(e,h),t.stroke(),t.closePath()},this),n(this.xLabels,function(i,e){var s=this.calculateX(e)+x(this.lineWidth),n=this.calculateX(e-(this.offsetGridLines?.5:0))+x(this.lineWidth),o=this.xLabelRotation>0,a=this.showVerticalLines;0!==e||a||(a=!0),a&&t.beginPath(),e>0?(t.lineWidth=this.gridLineWidth,t.strokeStyle=this.gridLineColor):(t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor),a&&(t.moveTo(n,this.endPoint),t.lineTo(n,this.startPoint-3),t.stroke(),t.closePath()),t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor,t.beginPath(),t.moveTo(n,this.endPoint),t.lineTo(n,this.endPoint+5),t.stroke(),t.closePath(),t.save(),t.translate(s,o?this.endPoint+12:this.endPoint+8),t.rotate(-1*S(this.xLabelRotation)),t.font=this.font,t.textAlign=o?"right":"center",t.textBaseline=o?"middle":"top",t.fillText(i,0,0),t.restore()},this))}}),e.RadialScale=e.Element.extend({initialize:function(){this.size=m([this.height,this.width]),this.drawingArea=this.display?this.size/2-(this.fontSize/2+this.backdropPaddingY):this.size/2},calculateCenterOffset:function(t){var i=this.drawingArea/(this.max-this.min);return(t-this.min)*i},update:function(){this.lineArc?this.drawingArea=this.display?this.size/2-(this.fontSize/2+this.backdropPaddingY):this.size/2:this.setScaleSize(),this.buildYLabels()},buildYLabels:function(){this.yLabels=[];for(var t=v(this.stepValue),i=0;i<=this.steps;i++)this.yLabels.push(C(this.templateString,{value:(this.min+i*this.stepValue).toFixed(t)}))},getCircumference:function(){return 2*Math.PI/this.valuesCount},setScaleSize:function(){var t,i,e,s,n,o,a,h,l,r,c,u,d=m([this.height/2-this.pointLabelFontSize-5,this.width/2]),p=this.width,g=0;for(this.ctx.font=W(this.pointLabelFontSize,this.pointLabelFontStyle,this.pointLabelFontFamily),i=0;i<this.valuesCount;i++)t=this.getPointPosition(i,d),e=this.ctx.measureText(C(this.templateString,{value:this.labels[i]})).width+5,0===i||i===this.valuesCount/2?(s=e/2,t.x+s>p&&(p=t.x+s,n=i),t.x-s<g&&(g=t.x-s,a=i)):i<this.valuesCount/2?t.x+e>p&&(p=t.x+e,n=i):i>this.valuesCount/2&&t.x-e<g&&(g=t.x-e,a=i);l=g,r=Math.ceil(p-this.width),o=this.getIndexAngle(n),h=this.getIndexAngle(a),c=r/Math.sin(o+Math.PI/2),u=l/Math.sin(h+Math.PI/2),c=f(c)?c:0,u=f(u)?u:0,this.drawingArea=d-(u+c)/2,this.setCenterPoint(u,c)},setCenterPoint:function(t,i){var e=this.width-i-this.drawingArea,s=t+this.drawingArea;this.xCenter=(s+e)/2,this.yCenter=this.height/2},getIndexAngle:function(t){var i=2*Math.PI/this.valuesCount;return t*i-Math.PI/2},getPointPosition:function(t,i){var e=this.getIndexAngle(t);return{x:Math.cos(e)*i+this.xCenter,y:Math.sin(e)*i+this.yCenter}},draw:function(){if(this.display){var t=this.ctx;if(n(this.yLabels,function(i,e){if(e>0){var s,n=e*(this.drawingArea/this.steps),o=this.yCenter-n;if(this.lineWidth>0)if(t.strokeStyle=this.lineColor,t.lineWidth=this.lineWidth,this.lineArc)t.beginPath(),t.arc(this.xCenter,this.yCenter,n,0,2*Math.PI),t.closePath(),t.stroke();else{t.beginPath();for(var a=0;a<this.valuesCount;a++)s=this.getPointPosition(a,this.calculateCenterOffset(this.min+e*this.stepValue)),0===a?t.moveTo(s.x,s.y):t.lineTo(s.x,s.y);t.closePath(),t.stroke()}if(this.showLabels){if(t.font=W(this.fontSize,this.fontStyle,this.fontFamily),this.showLabelBackdrop){var h=t.measureText(i).width;t.fillStyle=this.backdropColor,t.fillRect(this.xCenter-h/2-this.backdropPaddingX,o-this.fontSize/2-this.backdropPaddingY,h+2*this.backdropPaddingX,this.fontSize+2*this.backdropPaddingY)}t.textAlign="center",t.textBaseline="middle",t.fillStyle=this.fontColor,t.fillText(i,this.xCenter,o)}}},this),!this.lineArc){t.lineWidth=this.angleLineWidth,t.strokeStyle=this.angleLineColor;for(var i=this.valuesCount-1;i>=0;i--){if(this.angleLineWidth>0){var e=this.getPointPosition(i,this.calculateCenterOffset(this.max));t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(e.x,e.y),t.stroke(),t.closePath()}var s=this.getPointPosition(i,this.calculateCenterOffset(this.max)+5);t.font=W(this.pointLabelFontSize,this.pointLabelFontStyle,this.pointLabelFontFamily),t.fillStyle=this.pointLabelFontColor;var o=this.labels.length,a=this.labels.length/2,h=a/2,l=h>i||i>o-h,r=i===h||i===o-h;t.textAlign=0===i?"center":i===a?"center":a>i?"left":"right",t.textBaseline=r?"middle":l?"bottom":"top",t.fillText(this.labels[i],s.x,s.y)}}}}}),s.addEvent(window,"resize",function(){var t;return function(){clearTimeout(t),t=setTimeout(function(){n(e.instances,function(t){t.options.responsive&&t.resize(t.render,!0)})},50)}}()),p?define(function(){return e}):"object"==typeof module&&module.exports&&(module.exports=e),t.Chart=e,e.noConflict=function(){return t.Chart=i,e}}).call(this),function(){"use strict";var t=this,i=t.Chart,e=i.helpers,s={scaleBeginAtZero:!0,scaleShowGridLines:!0,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineWidth:1,scaleShowHorizontalLines:!0,scaleShowVerticalLines:!0,barShowStroke:!0,barStrokeWidth:2,barValueSpacing:5,barDatasetSpacing:1,legendTemplate:\'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<datasets.length; i++){%><li><span style="background-color:<%=datasets[i].fillColor%>"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>\'};i.Type.extend({name:"Bar",defaults:s,initialize:function(t){var s=this.options;this.ScaleClass=i.Scale.extend({offsetGridLines:!0,calculateBarX:function(t,i,e){var n=this.calculateBaseWidth(),o=this.calculateX(e)-n/2,a=this.calculateBarWidth(t);return o+a*i+i*s.barDatasetSpacing+a/2},calculateBaseWidth:function(){return this.calculateX(1)-this.calculateX(0)-2*s.barValueSpacing},calculateBarWidth:function(t){var i=this.calculateBaseWidth()-(t-1)*s.barDatasetSpacing;return i/t}}),this.datasets=[],this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getBarsAtEvent(t):[];this.eachBars(function(t){t.restore(["fillColor","strokeColor"])}),e.each(i,function(t){t.fillColor=t.highlightFill,t.strokeColor=t.highlightStroke}),this.showTooltip(i)}),this.BarClass=i.Rectangle.extend({strokeWidth:this.options.barStrokeWidth,showStroke:this.options.barShowStroke,ctx:this.chart.ctx}),e.each(t.datasets,function(i){var s={label:i.label||null,fillColor:i.fillColor,strokeColor:i.strokeColor,bars:[]};this.datasets.push(s),e.each(i.data,function(e,n){s.bars.push(new this.BarClass({value:e,label:t.labels[n],datasetLabel:i.label,strokeColor:i.strokeColor,fillColor:i.fillColor,highlightFill:i.highlightFill||i.fillColor,highlightStroke:i.highlightStroke||i.strokeColor}))},this)},this),this.buildScale(t.labels),this.BarClass.prototype.base=this.scale.endPoint,this.eachBars(function(t,i,s){e.extend(t,{width:this.scale.calculateBarWidth(this.datasets.length),x:this.scale.calculateBarX(this.datasets.length,s,i),y:this.scale.endPoint}),t.save()},this),this.render()},update:function(){this.scale.update(),e.each(this.activeElements,function(t){t.restore(["fillColor","strokeColor"])}),this.eachBars(function(t){t.save()}),this.render()},eachBars:function(t){e.each(this.datasets,function(i,s){e.each(i.bars,t,this,s)},this)},getBarsAtEvent:function(t){for(var i,s=[],n=e.getRelativePosition(t),o=function(t){s.push(t.bars[i])},a=0;a<this.datasets.length;a++)for(i=0;i<this.datasets[a].bars.length;i++)if(this.datasets[a].bars[i].inRange(n.x,n.y))return e.each(this.datasets,o),s;return s},buildScale:function(t){var i=this,s=function(){var t=[];return i.eachBars(function(i){t.push(i.value)}),t},n={templateString:this.options.scaleLabel,height:this.chart.height,width:this.chart.width,ctx:this.chart.ctx,textColor:this.options.scaleFontColor,fontSize:this.options.scaleFontSize,fontStyle:this.options.scaleFontStyle,fontFamily:this.options.scaleFontFamily,valuesCount:t.length,beginAtZero:this.options.scaleBeginAtZero,integersOnly:this.options.scaleIntegersOnly,calculateYRange:function(t){var i=e.calculateScaleRange(s(),t,this.fontSize,this.beginAtZero,this.integersOnly);e.extend(this,i)},xLabels:t,font:e.fontString(this.options.scaleFontSize,this.options.scaleFontStyle,this.options.scaleFontFamily),lineWidth:this.options.scaleLineWidth,lineColor:this.options.scaleLineColor,showHorizontalLines:this.options.scaleShowHorizontalLines,showVerticalLines:this.options.scaleShowVerticalLines,gridLineWidth:this.options.scaleShowGridLines?this.options.scaleGridLineWidth:0,gridLineColor:this.options.scaleShowGridLines?this.options.scaleGridLineColor:"rgba(0,0,0,0)",padding:this.options.showScale?0:this.options.barShowStroke?this.options.barStrokeWidth:0,showLabels:this.options.scaleShowLabels,display:this.options.showScale};this.options.scaleOverride&&e.extend(n,{calculateYRange:e.noop,steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}),this.scale=new this.ScaleClass(n)},addData:function(t,i){e.each(t,function(t,e){this.datasets[e].bars.push(new this.BarClass({value:t,label:i,x:this.scale.calculateBarX(this.datasets.length,e,this.scale.valuesCount+1),y:this.scale.endPoint,width:this.scale.calculateBarWidth(this.datasets.length),base:this.scale.endPoint,strokeColor:this.datasets[e].strokeColor,fillColor:this.datasets[e].fillColor}))\n
},this),this.scale.addXLabel(i),this.update()},removeData:function(){this.scale.removeXLabel(),e.each(this.datasets,function(t){t.bars.shift()},this),this.update()},reflow:function(){e.extend(this.BarClass.prototype,{y:this.scale.endPoint,base:this.scale.endPoint});var t=e.extend({height:this.chart.height,width:this.chart.width});this.scale.update(t)},draw:function(t){var i=t||1;this.clear();this.chart.ctx;this.scale.draw(i),e.each(this.datasets,function(t,s){e.each(t.bars,function(t,e){t.hasValue()&&(t.base=this.scale.endPoint,t.transition({x:this.scale.calculateBarX(this.datasets.length,s,e),y:this.scale.calculateY(t.value),width:this.scale.calculateBarWidth(this.datasets.length)},i).draw())},this)},this)}})}.call(this),function(){"use strict";var t=this,i=t.Chart,e=i.helpers,s={segmentShowStroke:!0,segmentStrokeColor:"#fff",segmentStrokeWidth:2,percentageInnerCutout:50,animationSteps:100,animationEasing:"easeOutBounce",animateRotate:!0,animateScale:!1,legendTemplate:\'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<segments.length; i++){%><li><span style="background-color:<%=segments[i].fillColor%>"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>\'};i.Type.extend({name:"Doughnut",defaults:s,initialize:function(t){this.segments=[],this.outerRadius=(e.min([this.chart.width,this.chart.height])-this.options.segmentStrokeWidth/2)/2,this.SegmentArc=i.Arc.extend({ctx:this.chart.ctx,x:this.chart.width/2,y:this.chart.height/2}),this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getSegmentsAtEvent(t):[];e.each(this.segments,function(t){t.restore(["fillColor"])}),e.each(i,function(t){t.fillColor=t.highlightColor}),this.showTooltip(i)}),this.calculateTotal(t),e.each(t,function(t,i){this.addData(t,i,!0)},this),this.render()},getSegmentsAtEvent:function(t){var i=[],s=e.getRelativePosition(t);return e.each(this.segments,function(t){t.inRange(s.x,s.y)&&i.push(t)},this),i},addData:function(t,i,e){var s=i||this.segments.length;this.segments.splice(s,0,new this.SegmentArc({value:t.value,outerRadius:this.options.animateScale?0:this.outerRadius,innerRadius:this.options.animateScale?0:this.outerRadius/100*this.options.percentageInnerCutout,fillColor:t.color,highlightColor:t.highlight||t.color,showStroke:this.options.segmentShowStroke,strokeWidth:this.options.segmentStrokeWidth,strokeColor:this.options.segmentStrokeColor,startAngle:1.5*Math.PI,circumference:this.options.animateRotate?0:this.calculateCircumference(t.value),label:t.label})),e||(this.reflow(),this.update())},calculateCircumference:function(t){return 2*Math.PI*(Math.abs(t)/this.total)},calculateTotal:function(t){this.total=0,e.each(t,function(t){this.total+=Math.abs(t.value)},this)},update:function(){this.calculateTotal(this.segments),e.each(this.activeElements,function(t){t.restore(["fillColor"])}),e.each(this.segments,function(t){t.save()}),this.render()},removeData:function(t){var i=e.isNumber(t)?t:this.segments.length-1;this.segments.splice(i,1),this.reflow(),this.update()},reflow:function(){e.extend(this.SegmentArc.prototype,{x:this.chart.width/2,y:this.chart.height/2}),this.outerRadius=(e.min([this.chart.width,this.chart.height])-this.options.segmentStrokeWidth/2)/2,e.each(this.segments,function(t){t.update({outerRadius:this.outerRadius,innerRadius:this.outerRadius/100*this.options.percentageInnerCutout})},this)},draw:function(t){var i=t?t:1;this.clear(),e.each(this.segments,function(t,e){t.transition({circumference:this.calculateCircumference(t.value),outerRadius:this.outerRadius,innerRadius:this.outerRadius/100*this.options.percentageInnerCutout},i),t.endAngle=t.startAngle+t.circumference,t.draw(),0===e&&(t.startAngle=1.5*Math.PI),e<this.segments.length-1&&(this.segments[e+1].startAngle=t.endAngle)},this)}}),i.types.Doughnut.extend({name:"Pie",defaults:e.merge(s,{percentageInnerCutout:0})})}.call(this),function(){"use strict";var t=this,i=t.Chart,e=i.helpers,s={scaleShowGridLines:!0,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineWidth:1,scaleShowHorizontalLines:!0,scaleShowVerticalLines:!0,bezierCurve:!0,bezierCurveTension:.4,pointDot:!0,pointDotRadius:4,pointDotStrokeWidth:1,pointHitDetectionRadius:20,datasetStroke:!0,datasetStrokeWidth:2,datasetFill:!0,legendTemplate:\'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<datasets.length; i++){%><li><span style="background-color:<%=datasets[i].strokeColor%>"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>\'};i.Type.extend({name:"Line",defaults:s,initialize:function(t){this.PointClass=i.Point.extend({strokeWidth:this.options.pointDotStrokeWidth,radius:this.options.pointDotRadius,display:this.options.pointDot,hitDetectionRadius:this.options.pointHitDetectionRadius,ctx:this.chart.ctx,inRange:function(t){return Math.pow(t-this.x,2)<Math.pow(this.radius+this.hitDetectionRadius,2)}}),this.datasets=[],this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getPointsAtEvent(t):[];this.eachPoints(function(t){t.restore(["fillColor","strokeColor"])}),e.each(i,function(t){t.fillColor=t.highlightFill,t.strokeColor=t.highlightStroke}),this.showTooltip(i)}),e.each(t.datasets,function(i){var s={label:i.label||null,fillColor:i.fillColor,strokeColor:i.strokeColor,pointColor:i.pointColor,pointStrokeColor:i.pointStrokeColor,points:[]};this.datasets.push(s),e.each(i.data,function(e,n){s.points.push(new this.PointClass({value:e,label:t.labels[n],datasetLabel:i.label,strokeColor:i.pointStrokeColor,fillColor:i.pointColor,highlightFill:i.pointHighlightFill||i.pointColor,highlightStroke:i.pointHighlightStroke||i.pointStrokeColor}))},this),this.buildScale(t.labels),this.eachPoints(function(t,i){e.extend(t,{x:this.scale.calculateX(i),y:this.scale.endPoint}),t.save()},this)},this),this.render()},update:function(){this.scale.update(),e.each(this.activeElements,function(t){t.restore(["fillColor","strokeColor"])}),this.eachPoints(function(t){t.save()}),this.render()},eachPoints:function(t){e.each(this.datasets,function(i){e.each(i.points,t,this)},this)},getPointsAtEvent:function(t){var i=[],s=e.getRelativePosition(t);return e.each(this.datasets,function(t){e.each(t.points,function(t){t.inRange(s.x,s.y)&&i.push(t)})},this),i},buildScale:function(t){var s=this,n=function(){var t=[];return s.eachPoints(function(i){t.push(i.value)}),t},o={templateString:this.options.scaleLabel,height:this.chart.height,width:this.chart.width,ctx:this.chart.ctx,textColor:this.options.scaleFontColor,fontSize:this.options.scaleFontSize,fontStyle:this.options.scaleFontStyle,fontFamily:this.options.scaleFontFamily,valuesCount:t.length,beginAtZero:this.options.scaleBeginAtZero,integersOnly:this.options.scaleIntegersOnly,calculateYRange:function(t){var i=e.calculateScaleRange(n(),t,this.fontSize,this.beginAtZero,this.integersOnly);e.extend(this,i)},xLabels:t,font:e.fontString(this.options.scaleFontSize,this.options.scaleFontStyle,this.options.scaleFontFamily),lineWidth:this.options.scaleLineWidth,lineColor:this.options.scaleLineColor,showHorizontalLines:this.options.scaleShowHorizontalLines,showVerticalLines:this.options.scaleShowVerticalLines,gridLineWidth:this.options.scaleShowGridLines?this.options.scaleGridLineWidth:0,gridLineColor:this.options.scaleShowGridLines?this.options.scaleGridLineColor:"rgba(0,0,0,0)",padding:this.options.showScale?0:this.options.pointDotRadius+this.options.pointDotStrokeWidth,showLabels:this.options.scaleShowLabels,display:this.options.showScale};this.options.scaleOverride&&e.extend(o,{calculateYRange:e.noop,steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}),this.scale=new i.Scale(o)},addData:function(t,i){e.each(t,function(t,e){this.datasets[e].points.push(new this.PointClass({value:t,label:i,x:this.scale.calculateX(this.scale.valuesCount+1),y:this.scale.endPoint,strokeColor:this.datasets[e].pointStrokeColor,fillColor:this.datasets[e].pointColor}))},this),this.scale.addXLabel(i),this.update()},removeData:function(){this.scale.removeXLabel(),e.each(this.datasets,function(t){t.points.shift()},this),this.update()},reflow:function(){var t=e.extend({height:this.chart.height,width:this.chart.width});this.scale.update(t)},draw:function(t){var i=t||1;this.clear();var s=this.chart.ctx,n=function(t){return null!==t.value},o=function(t,i,s){return e.findNextWhere(i,n,s)||t},a=function(t,i,s){return e.findPreviousWhere(i,n,s)||t};this.scale.draw(i),e.each(this.datasets,function(t){var h=e.where(t.points,n);e.each(t.points,function(t,e){t.hasValue()&&t.transition({y:this.scale.calculateY(t.value),x:this.scale.calculateX(e)},i)},this),this.options.bezierCurve&&e.each(h,function(t,i){var s=i>0&&i<h.length-1?this.options.bezierCurveTension:0;t.controlPoints=e.splineCurve(a(t,h,i),t,o(t,h,i),s),t.controlPoints.outer.y>this.scale.endPoint?t.controlPoints.outer.y=this.scale.endPoint:t.controlPoints.outer.y<this.scale.startPoint&&(t.controlPoints.outer.y=this.scale.startPoint),t.controlPoints.inner.y>this.scale.endPoint?t.controlPoints.inner.y=this.scale.endPoint:t.controlPoints.inner.y<this.scale.startPoint&&(t.controlPoints.inner.y=this.scale.startPoint)},this),s.lineWidth=this.options.datasetStrokeWidth,s.strokeStyle=t.strokeColor,s.beginPath(),e.each(h,function(t,i){if(0===i)s.moveTo(t.x,t.y);else if(this.options.bezierCurve){var e=a(t,h,i);s.bezierCurveTo(e.controlPoints.outer.x,e.controlPoints.outer.y,t.controlPoints.inner.x,t.controlPoints.inner.y,t.x,t.y)}else s.lineTo(t.x,t.y)},this),s.stroke(),this.options.datasetFill&&h.length>0&&(s.lineTo(h[h.length-1].x,this.scale.endPoint),s.lineTo(h[0].x,this.scale.endPoint),s.fillStyle=t.fillColor,s.closePath(),s.fill()),e.each(h,function(t){t.draw()})},this)}})}.call(this),function(){"use strict";var t=this,i=t.Chart,e=i.helpers,s={scaleShowLabelBackdrop:!0,scaleBackdropColor:"rgba(255,255,255,0.75)",scaleBeginAtZero:!0,scaleBackdropPaddingY:2,scaleBackdropPaddingX:2,scaleShowLine:!0,segmentShowStroke:!0,segmentStrokeColor:"#fff",segmentStrokeWidth:2,animationSteps:100,animationEasing:"easeOutBounce",animateRotate:!0,animateScale:!1,legendTemplate:\'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<segments.length; i++){%><li><span style="background-color:<%=segments[i].fillColor%>"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>\'};i.Type.extend({name:"PolarArea",defaults:s,initialize:function(t){this.segments=[],this.SegmentArc=i.Arc.extend({showStroke:this.options.segmentShowStroke,strokeWidth:this.options.segmentStrokeWidth,strokeColor:this.options.segmentStrokeColor,ctx:this.chart.ctx,innerRadius:0,x:this.chart.width/2,y:this.chart.height/2}),this.scale=new i.RadialScale({display:this.options.showScale,fontStyle:this.options.scaleFontStyle,fontSize:this.options.scaleFontSize,fontFamily:this.options.scaleFontFamily,fontColor:this.options.scaleFontColor,showLabels:this.options.scaleShowLabels,showLabelBackdrop:this.options.scaleShowLabelBackdrop,backdropColor:this.options.scaleBackdropColor,backdropPaddingY:this.options.scaleBackdropPaddingY,backdropPaddingX:this.options.scaleBackdropPaddingX,lineWidth:this.options.scaleShowLine?this.options.scaleLineWidth:0,lineColor:this.options.scaleLineColor,lineArc:!0,width:this.chart.width,height:this.chart.height,xCenter:this.chart.width/2,yCenter:this.chart.height/2,ctx:this.chart.ctx,templateString:this.options.scaleLabel,valuesCount:t.length}),this.updateScaleRange(t),this.scale.update(),e.each(t,function(t,i){this.addData(t,i,!0)},this),this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getSegmentsAtEvent(t):[];e.each(this.segments,function(t){t.restore(["fillColor"])}),e.each(i,function(t){t.fillColor=t.highlightColor}),this.showTooltip(i)}),this.render()},getSegmentsAtEvent:function(t){var i=[],s=e.getRelativePosition(t);return e.each(this.segments,function(t){t.inRange(s.x,s.y)&&i.push(t)},this),i},addData:function(t,i,e){var s=i||this.segments.length;this.segments.splice(s,0,new this.SegmentArc({fillColor:t.color,highlightColor:t.highlight||t.color,label:t.label,value:t.value,outerRadius:this.options.animateScale?0:this.scale.calculateCenterOffset(t.value),circumference:this.options.animateRotate?0:this.scale.getCircumference(),startAngle:1.5*Math.PI})),e||(this.reflow(),this.update())},removeData:function(t){var i=e.isNumber(t)?t:this.segments.length-1;this.segments.splice(i,1),this.reflow(),this.update()},calculateTotal:function(t){this.total=0,e.each(t,function(t){this.total+=t.value},this),this.scale.valuesCount=this.segments.length},updateScaleRange:function(t){var i=[];e.each(t,function(t){i.push(t.value)});var s=this.options.scaleOverride?{steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}:e.calculateScaleRange(i,e.min([this.chart.width,this.chart.height])/2,this.options.scaleFontSize,this.options.scaleBeginAtZero,this.options.scaleIntegersOnly);e.extend(this.scale,s,{size:e.min([this.chart.width,this.chart.height]),xCenter:this.chart.width/2,yCenter:this.chart.height/2})},update:function(){this.calculateTotal(this.segments),e.each(this.segments,function(t){t.save()}),this.reflow(),this.render()},reflow:function(){e.extend(this.SegmentArc.prototype,{x:this.chart.width/2,y:this.chart.height/2}),this.updateScaleRange(this.segments),this.scale.update(),e.extend(this.scale,{xCenter:this.chart.width/2,yCenter:this.chart.height/2}),e.each(this.segments,function(t){t.update({outerRadius:this.scale.calculateCenterOffset(t.value)})},this)},draw:function(t){var i=t||1;this.clear(),e.each(this.segments,function(t,e){t.transition({circumference:this.scale.getCircumference(),outerRadius:this.scale.calculateCenterOffset(t.value)},i),t.endAngle=t.startAngle+t.circumference,0===e&&(t.startAngle=1.5*Math.PI),e<this.segments.length-1&&(this.segments[e+1].startAngle=t.endAngle),t.draw()},this),this.scale.draw()}})}.call(this),function(){"use strict";var t=this,i=t.Chart,e=i.helpers;i.Type.extend({name:"Radar",defaults:{scaleShowLine:!0,angleShowLineOut:!0,scaleShowLabels:!1,scaleBeginAtZero:!0,angleLineColor:"rgba(0,0,0,.1)",angleLineWidth:1,pointLabelFontFamily:"\'Arial\'",pointLabelFontStyle:"normal",pointLabelFontSize:10,pointLabelFontColor:"#666",pointDot:!0,pointDotRadius:3,pointDotStrokeWidth:1,pointHitDetectionRadius:20,datasetStroke:!0,datasetStrokeWidth:2,datasetFill:!0,legendTemplate:\'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<datasets.length; i++){%><li><span style="background-color:<%=datasets[i].strokeColor%>"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>\'},initialize:function(t){this.PointClass=i.Point.extend({strokeWidth:this.options.pointDotStrokeWidth,radius:this.options.pointDotRadius,display:this.options.pointDot,hitDetectionRadius:this.options.pointHitDetectionRadius,ctx:this.chart.ctx}),this.datasets=[],this.buildScale(t),this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getPointsAtEvent(t):[];this.eachPoints(function(t){t.restore(["fillColor","strokeColor"])}),e.each(i,function(t){t.fillColor=t.highlightFill,t.strokeColor=t.highlightStroke}),this.showTooltip(i)}),e.each(t.datasets,function(i){var s={label:i.label||null,fillColor:i.fillColor,strokeColor:i.strokeColor,pointColor:i.pointColor,pointStrokeColor:i.pointStrokeColor,points:[]};this.datasets.push(s),e.each(i.data,function(e,n){var o;this.scale.animation||(o=this.scale.getPointPosition(n,this.scale.calculateCenterOffset(e))),s.points.push(new this.PointClass({value:e,label:t.labels[n],datasetLabel:i.label,x:this.options.animation?this.scale.xCenter:o.x,y:this.options.animation?this.scale.yCenter:o.y,strokeColor:i.pointStrokeColor,fillColor:i.pointColor,highlightFill:i.pointHighlightFill||i.pointColor,highlightStroke:i.pointHighlightStroke||i.pointStrokeColor}))},this)},this),this.render()},eachPoints:function(t){e.each(this.datasets,function(i){e.each(i.points,t,this)},this)},getPointsAtEvent:function(t){var i=e.getRelativePosition(t),s=e.getAngleFromPoint({x:this.scale.xCenter,y:this.scale.yCenter},i),n=2*Math.PI/this.scale.valuesCount,o=Math.round((s.angle-1.5*Math.PI)/n),a=[];return(o>=this.scale.valuesCount||0>o)&&(o=0),s.distance<=this.scale.drawingArea&&e.each(this.datasets,function(t){a.push(t.points[o])}),a},buildScale:function(t){this.scale=new i.RadialScale({display:this.options.showScale,fontStyle:this.options.scaleFontStyle,fontSize:this.options.scaleFontSize,fontFamily:this.options.scaleFontFamily,fontColor:this.options.scaleFontColor,showLabels:this.options.scaleShowLabels,showLabelBackdrop:this.options.scaleShowLabelBackdrop,backdropColor:this.options.scaleBackdropColor,backdropPaddingY:this.options.scaleBackdropPaddingY,backdropPaddingX:this.options.scaleBackdropPaddingX,lineWidth:this.options.scaleShowLine?this.options.scaleLineWidth:0,lineColor:this.options.scaleLineColor,angleLineColor:this.options.angleLineColor,angleLineWidth:this.options.angleShowLineOut?this.options.angleLineWidth:0,pointLabelFontColor:this.options.pointLabelFontColor,pointLabelFontSize:this.options.pointLabelFontSize,pointLabelFontFamily:this.options.pointLabelFontFamily,pointLabelFontStyle:this.options.pointLabelFontStyle,height:this.chart.height,width:this.chart.width,xCenter:this.chart.width/2,yCenter:this.chart.height/2,ctx:this.chart.ctx,templateString:this.options.scaleLabel,labels:t.labels,valuesCount:t.datasets[0].data.length}),this.scale.setScaleSize(),this.updateScaleRange(t.datasets),this.scale.buildYLabels()},updateScaleRange:function(t){var i=function(){var i=[];return e.each(t,function(t){t.data?i=i.concat(t.data):e.each(t.points,function(t){i.push(t.value)})}),i}(),s=this.options.scaleOverride?{steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}:e.calculateScaleRange(i,e.min([this.chart.width,this.chart.height])/2,this.options.scaleFontSize,this.options.scaleBeginAtZero,this.options.scaleIntegersOnly);e.extend(this.scale,s)},addData:function(t,i){this.scale.valuesCount++,e.each(t,function(t,e){var s=this.scale.getPointPosition(this.scale.valuesCount,this.scale.calculateCenterOffset(t));this.datasets[e].points.push(new this.PointClass({value:t,label:i,x:s.x,y:s.y,strokeColor:this.datasets[e].pointStrokeColor,fillColor:this.datasets[e].pointColor}))},this),this.scale.labels.push(i),this.reflow(),this.update()},removeData:function(){this.scale.valuesCount--,this.scale.labels.shift(),e.each(this.datasets,function(t){t.points.shift()},this),this.reflow(),this.update()},update:function(){this.eachPoints(function(t){t.save()}),this.reflow(),this.render()},reflow:function(){e.extend(this.scale,{width:this.chart.width,height:this.chart.height,size:e.min([this.chart.width,this.chart.height]),xCenter:this.chart.width/2,yCenter:this.chart.height/2}),this.updateScaleRange(this.datasets),this.scale.setScaleSize(),this.scale.buildYLabels()},draw:function(t){var i=t||1,s=this.chart.ctx;this.clear(),this.scale.draw(),e.each(this.datasets,function(t){e.each(t.points,function(t,e){t.hasValue()&&t.transition(this.scale.getPointPosition(e,this.scale.calculateCenterOffset(t.value)),i)},this),s.lineWidth=this.options.datasetStrokeWidth,s.strokeStyle=t.strokeColor,s.beginPath(),e.each(t.points,function(t,i){0===i?s.moveTo(t.x,t.y):s.lineTo(t.x,t.y)},this),s.closePath(),s.stroke(),s.fillStyle=t.fillColor,s.fill(),e.each(t.points,function(t){t.hasValue()&&t.draw()})},this)}})}.call(this);
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>52091</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Chart.min.js</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41271276.42</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>LICENSE.md</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/octet-stream</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string>Copyright (c) 2013-2015 Nick Downie\n
\n
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n
\n
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n
\n
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n
</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>1060</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>LICENSE.md</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41271276.81</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>README.md</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/octet-stream</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string># Chart.js \n
\n
[![Build Status](https://travis-ci.org/nnnick/Chart.js.svg?branch=master)](https://travis-ci.org/nnnick/Chart.js) [![Code Climate](https://codeclimate.com/github/nnnick/Chart.js/badges/gpa.svg)](https://codeclimate.com/github/nnnick/Chart.js)\n
\n
\n
*Simple HTML5 Charts using the canvas element* [chartjs.org](http://www.chartjs.org)\n
\n
## Documentation\n
\n
You can find documentation at [chartjs.org/docs](http://www.chartjs.org/docs/). The markdown files that build the site are available under `/docs`. Please note - in some of the json examples of configuration you might notice some liquid tags - this is just for the generating the site html, please disregard.\n
\n
## Bugs, issues and contributing\n
\n
Before submitting an issue or a pull request to the project, please take a moment to look over the [contributing guidelines](https://github.com/nnnick/Chart.js/blob/master/CONTRIBUTING.md) first.\n
\n
For support using Chart.js, please post questions with the [`chartjs` tag on Stack Overflow](http://stackoverflow.com/questions/tagged/chartjs).\n
\n
## License\n
\n
Chart.js is available under the [MIT license](http://opensource.org/licenses/MIT).\n
</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>1144</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>README.md</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41271275.98</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>bower.json</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/json</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string>{\n
"name": "Chart.js",\n
"version": "1.0.2",\n
"description": "Simple HTML5 Charts using the canvas element",\n
"homepage": "https://github.com/nnnick/Chart.js",\n
"author": "nnnick",\n
"main": [\n
"Chart.js"\n
],\n
"dependencies": {}\n
}</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>239</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>bower.json</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>docs</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>docs</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41271311.14</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>00-Getting-Started.md</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/octet-stream</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
---\n
title: Getting started\n
anchor: getting-started\n
---\n
\n
###Include Chart.js\n
\n
First we need to include the Chart.js library on the page. The library occupies a global variable of `Chart`.\n
\n
```html\n
<script src="Chart.js"></script>\n
```\n
\n
Alternatively, if you\'re using an AMD loader for JavaScript modules, that is also supported in the Chart.js core. Please note: the library will still occupy a global variable of `Chart`, even if it detects `define` and `define.amd`. If this is a problem, you can call `noConflict` to restore the global Chart variable to its previous owner.\n
\n
```javascript\n
// Using requirejs\n
require([\'path/to/Chartjs\'], function(Chart){\n
\t// Use Chart.js as normal here.\n
\n
\t// Chart.noConflict restores the Chart global variable to its previous owner\n
\t// The function returns what was previously Chart, allowing you to reassign.\n
\tvar Chartjs = Chart.noConflict();\n
\n
});\n
```\n
\n
You can also grab Chart.js using bower:\n
\n
```bash\n
bower install Chart.js --save\n
```\n
\n
Also, Chart.js is available from CDN:\n
\n
https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.min.js\n
\n
###Creating a chart\n
\n
To create a chart, we need to instantiate the `Chart` class. To do this, we need to pass in the 2d context of where we want to draw the chart. Here\'s an example.\n
\n
```html\n
<canvas id="myChart" width="400" height="400"></canvas>\n
```\n
\n
```javascript\n
// Get the context of the canvas element we want to select\n
var ctx = document.getElementById("myChart").getContext("2d");\n
var myNewChart = new Chart(ctx).PolarArea(data);\n
```\n
\n
We can also get the context of our canvas with jQuery. To do this, we need to get the DOM node out of the jQuery collection, and call the `getContext("2d")` method on that.\n
\n
```javascript\n
// Get context with jQuery - using jQuery\'s .get() method.\n
var ctx = $("#myChart").get(0).getContext("2d");\n
// This will get the first returned node in the jQuery collection.\n
var myNewChart = new Chart(ctx);\n
```\n
\n
After we\'ve instantiated the Chart class on the canvas we want to draw on, Chart.js will handle the scaling for retina displays.\n
\n
With the Chart class set up, we can go on to create one of the charts Chart.js has available. In the example below, we would be drawing a Polar area chart.\n
\n
```javascript\n
new Chart(ctx).PolarArea(data, options);\n
```\n
\n
We call a method of the name of the chart we want to create. We pass in the data for that chart type, and the options for that chart as parameters. Chart.js will merge the global defaults with chart type specific defaults, then merge any options passed in as a second argument after data.\n
\n
###Global chart configuration\n
\n
This concept was introduced in Chart.js 1.0 to keep configuration DRY, and allow for changing options globally across chart types, avoiding the need to specify options for each instance, or the default for a particular chart type.\n
\n
```javascript\n
Chart.defaults.global = {\n
\t// Boolean - Whether to animate the chart\n
\tanimation: true,\n
\n
\t// Number - Number of animation steps\n
\tanimationSteps: 60,\n
\n
\t// String - Animation easing effect\n
\t// Possible effects are:\n
\t// [easeInOutQuart, linear, easeOutBounce, easeInBack, easeInOutQuad,\n
\t// easeOutQuart, easeOutQuad, easeInOutBounce, easeOutSine, easeInOutCubic,\n
\t// easeInExpo, easeInOutBack, easeInCirc, easeInOutElastic, easeOutBack,\n
\t// easeInQuad, easeInOutExpo, easeInQuart, easeOutQuint, easeInOutCirc,\n
\t// easeInSine, easeOutExpo, easeOutCirc, easeOutCubic, easeInQuint,\n
\t// easeInElastic, easeInOutSine, easeInOutQuint, easeInBounce,\n
\t// easeOutElastic, easeInCubic]\n
\tanimationEasing: "easeOutQuart",\n
\n
\t// Boolean - If we should show the scale at all\n
\tshowScale: true,\n
\n
\t// Boolean - If we want to override with a hard coded scale\n
\tscaleOverride: false,\n
\n
\t// ** Required if scaleOverride is true **\n
\t// Number - The number of steps in a hard coded scale\n
\tscaleSteps: null,\n
\t// Number - The value jump in the hard coded scale\n
\tscaleStepWidth: null,\n
\t// Number - The scale starting value\n
\tscaleStartValue: null,\n
\n
\t// String - Colour of the scale line\n
\tscaleLineColor: "rgba(0,0,0,.1)",\n
\n
\t// Number - Pixel width of the scale line\n
\tscaleLineWidth: 1,\n
\n
\t// Boolean - Whether to show labels on the scale\n
\tscaleShowLabels: true,\n
\n
\t// Interpolated JS string - can access value\n
\tscaleLabel: "<%=value%>",\n
\n
\t// Boolean - Whether the scale should stick to integers, not floats even if drawing space is there\n
\tscaleIntegersOnly: true,\n
\n
\t// Boolean - Whether the scale should start at zero, or an order of magnitude down from the lowest value\n
\tscaleBeginAtZero: false,\n
\n
\t// String - Scale label font declaration for the scale label\n
\tscaleFontFamily: "\'Helvetica Neue\', \'Helvetica\', \'Arial\', sans-serif",\n
\n
\t// Number - Scale label font size in pixels\n
\tscaleFontSize: 12,\n
\n
\t// String - Scale label font weight style\n
\tscaleFontStyle: "normal",\n
\n
\t// String - Scale label font colour\n
\tscaleFontColor: "#666",\n
\n
\t// Boolean - whether or not the chart should be responsive and resize when the browser does.\n
\tresponsive: false,\n
\n
\t// Boolean - whether to maintain the starting aspect ratio or not when responsive, if set to false, will take up entire container\n
\tmaintainAspectRatio: true,\n
\n
\t// Boolean - Determines whether to draw tooltips on the canvas or not\n
\tshowTooltips: true,\n
\n
\t// Function - Determines whether to execute the customTooltips function instead of drawing the built in tooltips (See [Advanced - External Tooltips](#advanced-usage-external-tooltips))\n
\tcustomTooltips: false,\n
\n
\t// Array - Array of string names to attach tooltip events\n
\ttooltipEvents: ["mousemove", "touchstart", "touchmove"],\n
\n
\t// String - Tooltip background colour\n
\ttooltipFillColor: "rgba(0,0,0,0.8)",\n
\n
\t// String - Tooltip label font declaration for the scale label\n
\ttooltipFontFamily: "\'Helvetica Neue\', \'Helvetica\', \'Arial\', sans-serif",\n
\n
\t// Number - Tooltip label font size in pixels\n
\ttooltipFontSize: 14,\n
\n
\t// String - Tooltip font weight style\n
\ttooltipFontStyle: "normal",\n
\n
\t// String - Tooltip label font colour\n
\ttooltipFontColor: "#fff",\n
\n
\t// String - Tooltip title font declaration for the scale label\n
\ttooltipTitleFontFamily: "\'Helvetica Neue\', \'Helvetica\', \'Arial\', sans-serif",\n
\n
\t// Number - Tooltip title font size in pixels\n
\ttooltipTitleFontSize: 14,\n
\n
\t// String - Tooltip title font weight style\n
\ttooltipTitleFontStyle: "bold",\n
\n
\t// String - Tooltip title font colour\n
\ttooltipTitleFontColor: "#fff",\n
\n
\t// String - Tooltip title template\n
\ttooltipTitleTemplate: "<%= label%>",\n
\n
\t// Number - pixel width of padding around tooltip text\n
\ttooltipYPadding: 6,\n
\n
\t// Number - pixel width of padding around tooltip text\n
\ttooltipXPadding: 6,\n
\n
\t// Number - Size of the caret on the tooltip\n
\ttooltipCaretSize: 8,\n
\n
\t// Number - Pixel radius of the tooltip border\n
\ttooltipCornerRadius: 6,\n
\n
\t// Number - Pixel offset from point x to tooltip edge\n
\ttooltipXOffset: 10,\n
\t{% raw %}\n
\t// String - Template string for single tooltips\n
\ttooltipTemplate: "<%if (label){%><%=label%>: <%}%><%= value %>",\n
\t{% endraw %}\n
\t// String - Template string for multiple tooltips\n
\tmultiTooltipTemplate: "<%= value %>",\n
\n
\t// Function - Will fire on animation progression.\n
\tonAnimationProgress: function(){},\n
\n
\t// Function - Will fire on animation completion.\n
\tonAnimationComplete: function(){}\n
}\n
```\n
\n
If for example, you wanted all charts created to be responsive, and resize when the browser window does, the following setting can be changed:\n
\n
```javascript\n
Chart.defaults.global.responsive = true;\n
```\n
\n
Now, every time we create a chart, `options.responsive` will be `true`.\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>7470</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>00-Getting-Started.md</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41271312.63</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>01-Line-Chart.md</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/octet-stream</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
---\n
title: Line Chart\n
anchor: line-chart\n
---\n
###Introduction\n
A line chart is a way of plotting data points on a line.\n
\n
Often, it is used to show trend data, and the comparison of two data sets.\n
\n
<div class="canvas-holder">\n
\t<canvas width="250" height="125"></canvas>\n
</div>\n
\n
###Example usage\n
```javascript\n
var myLineChart = new Chart(ctx).Line(data, options);\n
```\n
###Data structure\n
\n
```javascript\n
var data = {\n
\tlabels: ["January", "February", "March", "April", "May", "June", "July"],\n
\tdatasets: [\n
\t\t{\n
\t\t\tlabel: "My First dataset",\n
\t\t\tfillColor: "rgba(220,220,220,0.2)",\n
\t\t\tstrokeColor: "rgba(220,220,220,1)",\n
\t\t\tpointColor: "rgba(220,220,220,1)",\n
\t\t\tpointStrokeColor: "#fff",\n
\t\t\tpointHighlightFill: "#fff",\n
\t\t\tpointHighlightStroke: "rgba(220,220,220,1)",\n
\t\t\tdata: [65, 59, 80, 81, 56, 55, 40]\n
\t\t},\n
\t\t{\n
\t\t\tlabel: "My Second dataset",\n
\t\t\tfillColor: "rgba(151,187,205,0.2)",\n
\t\t\tstrokeColor: "rgba(151,187,205,1)",\n
\t\t\tpointColor: "rgba(151,187,205,1)",\n
\t\t\tpointStrokeColor: "#fff",\n
\t\t\tpointHighlightFill: "#fff",\n
\t\t\tpointHighlightStroke: "rgba(151,187,205,1)",\n
\t\t\tdata: [28, 48, 40, 19, 86, 27, 90]\n
\t\t}\n
\t]\n
};\n
```\n
\n
The line chart requires an array of labels for each of the data points. This is shown on the X axis.\n
The data for line charts is broken up into an array of datasets. Each dataset has a colour for the fill, a colour for the line and colours for the points and strokes of the points. These colours are strings just like CSS. You can use RGBA, RGB, HEX or HSL notation.\n
\n
The label key on each dataset is optional, and can be used when generating a scale for the chart.\n
\n
### Chart options\n
\n
These are the customisation options specific to Line charts. These options are merged with the [global chart configuration options](#getting-started-global-chart-configuration), and form the options of the chart.\n
\n
```javascript\n
{\n
\n
\t///Boolean - Whether grid lines are shown across the chart\n
\tscaleShowGridLines : true,\n
\n
\t//String - Colour of the grid lines\n
\tscaleGridLineColor : "rgba(0,0,0,.05)",\n
\n
\t//Number - Width of the grid lines\n
\tscaleGridLineWidth : 1,\n
\n
\t//Boolean - Whether to show horizontal lines (except X axis)\n
\tscaleShowHorizontalLines: true,\n
\n
\t//Boolean - Whether to show vertical lines (except Y axis)\n
\tscaleShowVerticalLines: true,\n
\n
\t//Boolean - Whether the line is curved between points\n
\tbezierCurve : true,\n
\n
\t//Number - Tension of the bezier curve between points\n
\tbezierCurveTension : 0.4,\n
\n
\t//Boolean - Whether to show a dot for each point\n
\tpointDot : true,\n
\n
\t//Number - Radius of each point dot in pixels\n
\tpointDotRadius : 4,\n
\n
\t//Number - Pixel width of point dot stroke\n
\tpointDotStrokeWidth : 1,\n
\n
\t//Number - amount extra to add to the radius to cater for hit detection outside the drawn point\n
\tpointHitDetectionRadius : 20,\n
\n
\t//Boolean - Whether to show a stroke for datasets\n
\tdatasetStroke : true,\n
\n
\t//Number - Pixel width of dataset stroke\n
\tdatasetStrokeWidth : 2,\n
\n
\t//Boolean - Whether to fill the dataset with a colour\n
\tdatasetFill : true,\n
\t{% raw %}\n
\t//String - A legend template\n
\tlegendTemplate : "<ul class=\\"<%=name.toLowerCase()%>-legend\\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\\"background-color:<%=datasets[i].strokeColor%>\\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>"\n
\t{% endraw %}\n
\n
\t//Boolean - Whether to horizontally center the label and point dot inside the grid\n
\toffsetGridLines : false\n
};\n
```\n
\n
You can override these for your `Chart` instance by passing a second argument into the `Line` method as an object with the keys you want to override.\n
\n
For example, we could have a line chart without bezier curves between points by doing the following:\n
\n
```javascript\n
new Chart(ctx).Line(data, {\n
\tbezierCurve: false\n
});\n
// This will create a chart with all of the default options, merged from the global config,\n
// and the Line chart defaults, but this particular instance will have `bezierCurve` set to false.\n
```\n
\n
We can also change these defaults values for each Line type that is created, this object is available at `Chart.defaults.Line`.\n
\n
\n
### Prototype methods\n
\n
#### .getPointsAtEvent( event )\n
\n
Calling `getPointsAtEvent(event)` on your Chart instance passing an argument of an event, or jQuery event, will return the point elements that are at that the same position of that event.\n
\n
```javascript\n
canvas.onclick = function(evt){\n
\tvar activePoints = myLineChart.getPointsAtEvent(evt);\n
\t// => activePoints is an array of points on the canvas that are at the same position as the click event.\n
};\n
```\n
\n
This functionality may be useful for implementing DOM based tooltips, or triggering custom behaviour in your application.\n
\n
#### .update( )\n
\n
Calling `update()` on your Chart instance will re-render the chart with any updated values, allowing you to edit the value of multiple existing points, then render those in one animated render loop.\n
\n
```javascript\n
myLineChart.datasets[0].points[2].value = 50;\n
// Would update the first dataset\'s value of \'March\' to be 50\n
myLineChart.update();\n
// Calling update now animates the position of March from 90 to 50.\n
```\n
\n
#### .addData( valuesArray, label )\n
\n
Calling `addData(valuesArray, label)` on your Chart instance passing an array of values for each dataset, along with a label for those points.\n
\n
```javascript\n
// The values array passed into addData should be one for each dataset in the chart\n
myLineChart.addData([40, 60], "August");\n
// This new data will now animate at the end of the chart.\n
```\n
\n
#### .removeData( )\n
\n
Calling `removeData()` on your Chart instance will remove the first value for all datasets on the chart.\n
\n
```javascript\n
myLineChart.removeData();\n
// The chart will remove the first point and animate other points into place\n
```\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>5680</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>01-Line-Chart.md</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41271312.01</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>02-Bar-Chart.md</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/octet-stream</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
---\n
title: Bar Chart\n
anchor: bar-chart\n
---\n
\n
### Introduction\n
A bar chart is a way of showing data as bars.\n
\n
It is sometimes used to show trend data, and the comparison of multiple data sets side by side.\n
\n
<div class="canvas-holder">\n
\t<canvas width="250" height="125"></canvas>\n
</div>\n
\n
### Example usage\n
```javascript\n
var myBarChart = new Chart(ctx).Bar(data, options);\n
```\n
\n
### Data structure\n
\n
```javascript\n
var data = {\n
\tlabels: ["January", "February", "March", "April", "May", "June", "July"],\n
\tdatasets: [\n
\t\t{\n
\t\t\tlabel: "My First dataset",\n
\t\t\tfillColor: "rgba(220,220,220,0.5)",\n
\t\t\tstrokeColor: "rgba(220,220,220,0.8)",\n
\t\t\thighlightFill: "rgba(220,220,220,0.75)",\n
\t\t\thighlightStroke: "rgba(220,220,220,1)",\n
\t\t\tdata: [65, 59, 80, 81, 56, 55, 40]\n
\t\t},\n
\t\t{\n
\t\t\tlabel: "My Second dataset",\n
\t\t\tfillColor: "rgba(151,187,205,0.5)",\n
\t\t\tstrokeColor: "rgba(151,187,205,0.8)",\n
\t\t\thighlightFill: "rgba(151,187,205,0.75)",\n
\t\t\thighlightStroke: "rgba(151,187,205,1)",\n
\t\t\tdata: [28, 48, 40, 19, 86, 27, 90]\n
\t\t}\n
\t]\n
};\n
```\n
The bar chart has the a very similar data structure to the line chart, and has an array of datasets, each with colours and an array of data. Again, colours are in CSS format.\n
We have an array of labels too for display. In the example, we are showing the same data as the previous line chart example.\n
\n
The label key on each dataset is optional, and can be used when generating a scale for the chart.\n
\n
### Chart Options\n
\n
These are the customisation options specific to Bar charts. These options are merged with the [global chart configuration options](#getting-started-global-chart-configuration), and form the options of the chart.\n
\n
```javascript\n
{\n
\t//Boolean - Whether the scale should start at zero, or an order of magnitude down from the lowest value\n
\tscaleBeginAtZero : true,\n
\n
\t//Boolean - Whether grid lines are shown across the chart\n
\tscaleShowGridLines : true,\n
\n
\t//String - Colour of the grid lines\n
\tscaleGridLineColor : "rgba(0,0,0,.05)",\n
\n
\t//Number - Width of the grid lines\n
\tscaleGridLineWidth : 1,\n
\n
\t//Boolean - Whether to show horizontal lines (except X axis)\n
\tscaleShowHorizontalLines: true,\n
\n
\t//Boolean - Whether to show vertical lines (except Y axis)\n
\tscaleShowVerticalLines: true,\n
\n
\t//Boolean - If there is a stroke on each bar\n
\tbarShowStroke : true,\n
\n
\t//Number - Pixel width of the bar stroke\n
\tbarStrokeWidth : 2,\n
\n
\t//Number - Spacing between each of the X value sets\n
\tbarValueSpacing : 5,\n
\n
\t//Number - Spacing between data sets within X values\n
\tbarDatasetSpacing : 1,\n
\t{% raw %}\n
\t//String - A legend template\n
\tlegendTemplate : "<ul class=\\"<%=name.toLowerCase()%>-legend\\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\\"background-color:<%=datasets[i].fillColor%>\\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>"\n
\t{% endraw %}\n
}\n
```\n
\n
You can override these for your `Chart` instance by passing a second argument into the `Bar` method as an object with the keys you want to override.\n
\n
For example, we could have a bar chart without a stroke on each bar by doing the following:\n
\n
```javascript\n
new Chart(ctx).Bar(data, {\n
\tbarShowStroke: false\n
});\n
// This will create a chart with all of the default options, merged from the global config,\n
// and the Bar chart defaults but this particular instance will have `barShowStroke` set to false.\n
```\n
\n
We can also change these defaults values for each Bar type that is created, this object is available at `Chart.defaults.Bar`.\n
\n
### Prototype methods\n
\n
#### .getBarsAtEvent( event )\n
\n
Calling `getBarsAtEvent(event)` on your Chart instance passing an argument of an event, or jQuery event, will return the bar elements that are at that the same position of that event.\n
\n
```javascript\n
canvas.onclick = function(evt){\n
\tvar activeBars = myBarChart.getBarsAtEvent(evt);\n
\t// => activeBars is an array of bars on the canvas that are at the same position as the click event.\n
};\n
```\n
\n
This functionality may be useful for implementing DOM based tooltips, or triggering custom behaviour in your application.\n
\n
#### .update( )\n
\n
Calling `update()` on your Chart instance will re-render the chart with any updated values, allowing you to edit the value of multiple existing points, then render those in one animated render loop.\n
\n
```javascript\n
myBarChart.datasets[0].bars[2].value = 50;\n
// Would update the first dataset\'s value of \'March\' to be 50\n
myBarChart.update();\n
// Calling update now animates the position of March from 90 to 50.\n
```\n
\n
#### .addData( valuesArray, label )\n
\n
Calling `addData(valuesArray, label)` on your Chart instance passing an array of values for each dataset, along with a label for those bars.\n
\n
```javascript\n
// The values array passed into addData should be one for each dataset in the chart\n
myBarChart.addData([40, 60], "August");\n
// The new data will now animate at the end of the chart.\n
```\n
\n
#### .removeData( )\n
\n
Calling `removeData()` on your Chart instance will remove the first value for all datasets on the chart.\n
\n
```javascript\n
myBarChart.removeData();\n
// The chart will now animate and remove the first bar\n
```\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>5039</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>02-Bar-Chart.md</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41271308.13</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>03-Radar-Chart.md</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/octet-stream</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
---\n
title: Radar Chart\n
anchor: radar-chart\n
---\n
\n
###Introduction\n
A radar chart is a way of showing multiple data points and the variation between them.\n
\n
They are often useful for comparing the points of two or more different data sets.\n
\n
<div class="canvas-holder">\n
\t<canvas width="250" height="125"></canvas>\n
</div>\n
\n
###Example usage\n
\n
```javascript\n
var myRadarChart = new Chart(ctx).Radar(data, options);\n
```\n
\n
###Data structure\n
```javascript\n
var data = {\n
\tlabels: ["Eating", "Drinking", "Sleeping", "Designing", "Coding", "Cycling", "Running"],\n
\tdatasets: [\n
\t\t{\n
\t\t\tlabel: "My First dataset",\n
\t\t\tfillColor: "rgba(220,220,220,0.2)",\n
\t\t\tstrokeColor: "rgba(220,220,220,1)",\n
\t\t\tpointColor: "rgba(220,220,220,1)",\n
\t\t\tpointStrokeColor: "#fff",\n
\t\t\tpointHighlightFill: "#fff",\n
\t\t\tpointHighlightStroke: "rgba(220,220,220,1)",\n
\t\t\tdata: [65, 59, 90, 81, 56, 55, 40]\n
\t\t},\n
\t\t{\n
\t\t\tlabel: "My Second dataset",\n
\t\t\tfillColor: "rgba(151,187,205,0.2)",\n
\t\t\tstrokeColor: "rgba(151,187,205,1)",\n
\t\t\tpointColor: "rgba(151,187,205,1)",\n
\t\t\tpointStrokeColor: "#fff",\n
\t\t\tpointHighlightFill: "#fff",\n
\t\t\tpointHighlightStroke: "rgba(151,187,205,1)",\n
\t\t\tdata: [28, 48, 40, 19, 96, 27, 100]\n
\t\t}\n
\t]\n
};\n
```\n
For a radar chart, to provide context of what each point means, we include an array of strings that show around each point in the chart.\n
For the radar chart data, we have an array of datasets. Each of these is an object, with a fill colour, a stroke colour, a colour for the fill of each point, and a colour for the stroke of each point. We also have an array of data values.\n
\n
The label key on each dataset is optional, and can be used when generating a scale for the chart.\n
\n
### Chart options\n
\n
These are the customisation options specific to Radar charts. These options are merged with the [global chart configuration options](#getting-started-global-chart-configuration), and form the options of the chart.\n
\n
\n
```javascript\n
{\n
\t//Boolean - Whether to show lines for each scale point\n
\tscaleShowLine : true,\n
\n
\t//Boolean - Whether we show the angle lines out of the radar\n
\tangleShowLineOut : true,\n
\n
\t//Boolean - Whether to show labels on the scale\n
\tscaleShowLabels : false,\n
\n
\t// Boolean - Whether the scale should begin at zero\n
\tscaleBeginAtZero : true,\n
\n
\t//String - Colour of the angle line\n
\tangleLineColor : "rgba(0,0,0,.1)",\n
\n
\t//Number - Pixel width of the angle line\n
\tangleLineWidth : 1,\n
\n
\t//String - Point label font declaration\n
\tpointLabelFontFamily : "\'Arial\'",\n
\n
\t//String - Point label font weight\n
\tpointLabelFontStyle : "normal",\n
\n
\t//Number - Point label font size in pixels\n
\tpointLabelFontSize : 10,\n
\n
\t//String - Point label font colour\n
\tpointLabelFontColor : "#666",\n
\n
\t//Boolean - Whether to show a dot for each point\n
\tpointDot : true,\n
\n
\t//Number - Radius of each point dot in pixels\n
\tpointDotRadius : 3,\n
\n
\t//Number - Pixel width of point dot stroke\n
\tpointDotStrokeWidth : 1,\n
\n
\t//Number - amount extra to add to the radius to cater for hit detection outside the drawn point\n
\tpointHitDetectionRadius : 20,\n
\n
\t//Boolean - Whether to show a stroke for datasets\n
\tdatasetStroke : true,\n
\n
\t//Number - Pixel width of dataset stroke\n
\tdatasetStrokeWidth : 2,\n
\n
\t//Boolean - Whether to fill the dataset with a colour\n
\tdatasetFill : true,\n
\t{% raw %}\n
\t//String - A legend template\n
\tlegendTemplate : "<ul class=\\"<%=name.toLowerCase()%>-legend\\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\\"background-color:<%=datasets[i].strokeColor%>\\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>"\n
\t{% endraw %}\n
}\n
```\n
\n
\n
You can override these for your `Chart` instance by passing a second argument into the `Radar` method as an object with the keys you want to override.\n
\n
For example, we could have a radar chart without a point for each on piece of data by doing the following:\n
\n
```javascript\n
new Chart(ctx).Radar(data, {\n
\tpointDot: false\n
});\n
// This will create a chart with all of the default options, merged from the global config,\n
// and the Bar chart defaults but this particular instance will have `pointDot` set to false.\n
```\n
\n
We can also change these defaults values for each Radar type that is created, this object is available at `Chart.defaults.Radar`.\n
\n
\n
### Prototype methods\n
\n
#### .getPointsAtEvent( event )\n
\n
Calling `getPointsAtEvent(event)` on your Chart instance passing an argument of an event, or jQuery event, will return the point elements that are at that the same position of that event.\n
\n
```javascript\n
canvas.onclick = function(evt){\n
\tvar activePoints = myRadarChart.getPointsAtEvent(evt);\n
\t// => activePoints is an array of points on the canvas that are at the same position as the click event.\n
};\n
```\n
\n
This functionality may be useful for implementing DOM based tooltips, or triggering custom behaviour in your application.\n
\n
#### .update( )\n
\n
Calling `update()` on your Chart instance will re-render the chart with any updated values, allowing you to edit the value of multiple existing points, then render those in one animated render loop.\n
\n
```javascript\n
myRadarChart.datasets[0].points[2].value = 50;\n
// Would update the first dataset\'s value of \'Sleeping\' to be 50\n
myRadarChart.update();\n
// Calling update now animates the position of Sleeping from 90 to 50.\n
```\n
\n
#### .addData( valuesArray, label )\n
\n
Calling `addData(valuesArray, label)` on your Chart instance passing an array of values for each dataset, along with a label for those points.\n
\n
```javascript\n
// The values array passed into addData should be one for each dataset in the chart\n
myRadarChart.addData([40, 60], "Dancing");\n
// The new data will now animate at the end of the chart.\n
```\n
\n
#### .removeData( )\n
\n
Calling `removeData()` on your Chart instance will remove the first value for all datasets on the chart.\n
\n
```javascript\n
myRadarChart.removeData();\n
// Other points will now animate to their correct positions.\n
```
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>5807</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>03-Radar-Chart.md</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41271309.31</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>04-Polar-Area-Chart.md</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/octet-stream</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
---\n
title: Polar Area Chart\n
anchor: polar-area-chart\n
---\n
### Introduction\n
Polar area charts are similar to pie charts, but each segment has the same angle - the radius of the segment differs depending on the value.\n
\n
This type of chart is often useful when we want to show a comparison data similar to a pie chart, but also show a scale of values for context.\n
\n
<div class="canvas-holder">\n
\t<canvas width="250" height="125"></canvas>\n
</div>\n
\n
### Example usage\n
\n
```javascript\n
new Chart(ctx).PolarArea(data, options);\n
```\n
\n
### Data structure\n
\n
```javascript\n
var data = [\n
\t{\n
\t\tvalue: 300,\n
\t\tcolor:"#F7464A",\n
\t\thighlight: "#FF5A5E",\n
\t\tlabel: "Red"\n
\t},\n
\t{\n
\t\tvalue: 50,\n
\t\tcolor: "#46BFBD",\n
\t\thighlight: "#5AD3D1",\n
\t\tlabel: "Green"\n
\t},\n
\t{\n
\t\tvalue: 100,\n
\t\tcolor: "#FDB45C",\n
\t\thighlight: "#FFC870",\n
\t\tlabel: "Yellow"\n
\t},\n
\t{\n
\t\tvalue: 40,\n
\t\tcolor: "#949FB1",\n
\t\thighlight: "#A8B3C5",\n
\t\tlabel: "Grey"\n
\t},\n
\t{\n
\t\tvalue: 120,\n
\t\tcolor: "#4D5360",\n
\t\thighlight: "#616774",\n
\t\tlabel: "Dark Grey"\n
\t}\n
\n
];\n
```\n
As you can see, for the chart data you pass in an array of objects, with a value and a colour. The value attribute should be a number, while the color attribute should be a string. Similar to CSS, for this string you can use HEX notation, RGB, RGBA or HSL.\n
\n
### Chart options\n
\n
These are the customisation options specific to Polar Area charts. These options are merged with the [global chart configuration options](#getting-started-global-chart-configuration), and form the options of the chart.\n
\n
```javascript\n
{\n
\t//Boolean - Show a backdrop to the scale label\n
\tscaleShowLabelBackdrop : true,\n
\n
\t//String - The colour of the label backdrop\n
\tscaleBackdropColor : "rgba(255,255,255,0.75)",\n
\n
\t// Boolean - Whether the scale should begin at zero\n
\tscaleBeginAtZero : true,\n
\n
\t//Number - The backdrop padding above & below the label in pixels\n
\tscaleBackdropPaddingY : 2,\n
\n
\t//Number - The backdrop padding to the side of the label in pixels\n
\tscaleBackdropPaddingX : 2,\n
\n
\t//Boolean - Show line for each value in the scale\n
\tscaleShowLine : true,\n
\n
\t//Boolean - Stroke a line around each segment in the chart\n
\tsegmentShowStroke : true,\n
\n
\t//String - The colour of the stroke on each segment.\n
\tsegmentStrokeColor : "#fff",\n
\n
\t//Number - The width of the stroke value in pixels\n
\tsegmentStrokeWidth : 2,\n
\n
\t//Number - Amount of animation steps\n
\tanimationSteps : 100,\n
\n
\t//String - Animation easing effect.\n
\tanimationEasing : "easeOutBounce",\n
\n
\t//Boolean - Whether to animate the rotation of the chart\n
\tanimateRotate : true,\n
\n
\t//Boolean - Whether to animate scaling the chart from the centre\n
\tanimateScale : false,\n
\t{% raw %}\n
\t//String - A legend template\n
\tlegendTemplate : "<ul class=\\"<%=name.toLowerCase()%>-legend\\"><% for (var i=0; i<segments.length; i++){%><li><span style=\\"background-color:<%=segments[i].fillColor%>\\"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>"\n
\t{% endraw %}\n
}\n
```\n
\n
You can override these for your `Chart` instance by passing a second argument into the `PolarArea` method as an object with the keys you want to override.\n
\n
For example, we could have a polar area chart with a black stroke on each segment like so:\n
\n
```javascript\n
new Chart(ctx).PolarArea(data, {\n
\tsegmentStrokeColor: "#000000"\n
});\n
// This will create a chart with all of the default options, merged from the global config,\n
// and the PolarArea chart defaults but this particular instance will have `segmentStrokeColor` set to `"#000000"`.\n
```\n
\n
We can also change these defaults values for each PolarArea type that is created, this object is available at `Chart.defaults.PolarArea`.\n
\n
### Prototype methods\n
\n
#### .getSegmentsAtEvent( event )\n
\n
Calling `getSegmentsAtEvent(event)` on your Chart instance passing an argument of an event, or jQuery event, will return the segment elements that are at that the same position of that event.\n
\n
```javascript\n
canvas.onclick = function(evt){\n
\tvar activePoints = myPolarAreaChart.getSegmentsAtEvent(evt);\n
\t// => activePoints is an array of segments on the canvas that are at the same position as the click event.\n
};\n
```\n
\n
This functionality may be useful for implementing DOM based tooltips, or triggering custom behaviour in your application.\n
\n
#### .update( )\n
\n
Calling `update()` on your Chart instance will re-render the chart with any updated values, allowing you to edit the value of multiple existing points, then render those in one animated render loop.\n
\n
```javascript\n
myPolarAreaChart.segments[1].value = 10;\n
// Would update the first dataset\'s value of \'Green\' to be 10\n
myPolarAreaChart.update();\n
// Calling update now animates the position of Green from 50 to 10.\n
```\n
\n
#### .addData( segmentData, index )\n
\n
Calling `addData(segmentData, index)` on your Chart instance passing an object in the same format as in the constructor. There is an option second argument of \'index\', this determines at what index the new segment should be inserted into the chart.\n
\n
```javascript\n
// An object in the same format as the original data source\n
myPolarAreaChart.addData({\n
\tvalue: 130,\n
\tcolor: "#B48EAD",\n
\thighlight: "#C69CBE",\n
\tlabel: "Purple"\n
});\n
// The new segment will now animate in.\n
```\n
\n
#### .removeData( index )\n
\n
Calling `removeData(index)` on your Chart instance will remove segment at that particular index. If none is provided, it will default to the last segment.\n
\n
```javascript\n
myPolarAreaChart.removeData();\n
// Other segments will update to fill the empty space left.\n
```\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>5401</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>04-Polar-Area-Chart.md</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41271310.57</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>05-Pie-Doughnut-Chart.md</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/octet-stream</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
---\n
title: Pie & Doughnut Charts\n
anchor: doughnut-pie-chart\n
---\n
###Introduction\n
Pie and doughnut charts are probably the most commonly used chart there are. They are divided into segments, the arc of each segment shows the proportional value of each piece of data.\n
\n
They are excellent at showing the relational proportions between data.\n
\n
Pie and doughnut charts are effectively the same class in Chart.js, but have one different default value - their `percentageInnerCutout`. This equates what percentage of the inner should be cut out. This defaults to `0` for pie charts, and `50` for doughnuts.\n
\n
They are also registered under two aliases in the `Chart` core. Other than their different default value, and different alias, they are exactly the same.\n
\n
<div class="canvas-holder half">\n
\t<canvas width="250" height="125"></canvas>\n
</div>\n
\n
<div class="canvas-holder half">\n
\t<canvas width="250" height="125"></canvas>\n
</div>\n
\n
\n
### Example usage\n
\n
```javascript\n
// For a pie chart\n
var myPieChart = new Chart(ctx[0]).Pie(data,options);\n
\n
// And for a doughnut chart\n
var myDoughnutChart = new Chart(ctx[1]).Doughnut(data,options);\n
```\n
\n
### Data structure\n
\n
```javascript\n
var data = [\n
\t{\n
\t\tvalue: 300,\n
\t\tcolor:"#F7464A",\n
\t\thighlight: "#FF5A5E",\n
\t\tlabel: "Red"\n
\t},\n
\t{\n
\t\tvalue: 50,\n
\t\tcolor: "#46BFBD",\n
\t\thighlight: "#5AD3D1",\n
\t\tlabel: "Green"\n
\t},\n
\t{\n
\t\tvalue: 100,\n
\t\tcolor: "#FDB45C",\n
\t\thighlight: "#FFC870",\n
\t\tlabel: "Yellow"\n
\t}\n
]\n
```\n
\n
For a pie chart, you must pass in an array of objects with a value and an optional color property. The value attribute should be a number, Chart.js will total all of the numbers and calculate the relative proportion of each. The color attribute should be a string. Similar to CSS, for this string you can use HEX notation, RGB, RGBA or HSL.\n
\n
### Chart options\n
\n
These are the customisation options specific to Pie & Doughnut charts. These options are merged with the [global chart configuration options](#getting-started-global-chart-configuration), and form the options of the chart.\n
\n
```javascript\n
{\n
\t//Boolean - Whether we should show a stroke on each segment\n
\tsegmentShowStroke : true,\n
\n
\t//String - The colour of each segment stroke\n
\tsegmentStrokeColor : "#fff",\n
\n
\t//Number - The width of each segment stroke\n
\tsegmentStrokeWidth : 2,\n
\n
\t//Number - The percentage of the chart that we cut out of the middle\n
\tpercentageInnerCutout : 50, // This is 0 for Pie charts\n
\n
\t//Number - Amount of animation steps\n
\tanimationSteps : 100,\n
\n
\t//String - Animation easing effect\n
\tanimationEasing : "easeOutBounce",\n
\n
\t//Boolean - Whether we animate the rotation of the Doughnut\n
\tanimateRotate : true,\n
\n
\t//Boolean - Whether we animate scaling the Doughnut from the centre\n
\tanimateScale : false,\n
\t{% raw %}\n
\t//String - A legend template\n
\tlegendTemplate : "<ul class=\\"<%=name.toLowerCase()%>-legend\\"><% for (var i=0; i<segments.length; i++){%><li><span style=\\"background-color:<%=segments[i].fillColor%>\\"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>"\n
\t{% endraw %}\n
}\n
```\n
You can override these for your `Chart` instance by passing a second argument into the `Doughnut` method as an object with the keys you want to override.\n
\n
For example, we could have a doughnut chart that animates by scaling out from the centre like so:\n
\n
```javascript\n
new Chart(ctx).Doughnut(data, {\n
\tanimateScale: true\n
});\n
// This will create a chart with all of the default options, merged from the global config,\n
// and the Doughnut chart defaults but this particular instance will have `animateScale` set to `true`.\n
```\n
\n
We can also change these default values for each Doughnut type that is created, this object is available at `Chart.defaults.Doughnut`. Pie charts also have a clone of these defaults available to change at `Chart.defaults.Pie`, with the only difference being `percentageInnerCutout` being set to 0.\n
\n
### Prototype methods\n
\n
#### .getSegmentsAtEvent( event )\n
\n
Calling `getSegmentsAtEvent(event)` on your Chart instance passing an argument of an event, or jQuery event, will return the segment elements that are at the same position of that event.\n
\n
```javascript\n
canvas.onclick = function(evt){\n
\tvar activePoints = myDoughnutChart.getSegmentsAtEvent(evt);\n
\t// => activePoints is an array of segments on the canvas that are at the same position as the click event.\n
};\n
```\n
\n
This functionality may be useful for implementing DOM based tooltips, or triggering custom behaviour in your application.\n
\n
#### .update( )\n
\n
Calling `update()` on your Chart instance will re-render the chart with any updated values, allowing you to edit the value of multiple existing points, then render those in one animated render loop.\n
\n
```javascript\n
myDoughnutChart.segments[1].value = 10;\n
// Would update the first dataset\'s value of \'Green\' to be 10\n
myDoughnutChart.update();\n
// Calling update now animates the circumference of the segment \'Green\' from 50 to 10.\n
// and transitions other segment widths\n
```\n
\n
#### .addData( segmentData, index )\n
\n
Calling `addData(segmentData, index)` on your Chart instance passing an object in the same format as in the constructor. There is an optional second argument of \'index\', this determines at what index the new segment should be inserted into the chart.\n
\n
```javascript\n
// An object in the same format as the original data source\n
myDoughnutChart.addData({\n
\tvalue: 130,\n
\tcolor: "#B48EAD",\n
\thighlight: "#C69CBE",\n
\tlabel: "Purple"\n
});\n
// The new segment will now animate in.\n
```\n
\n
#### .removeData( index )\n
\n
Calling `removeData(index)` on your Chart instance will remove segment at that particular index. If none is provided, it will default to the last segment.\n
\n
```javascript\n
myDoughnutChart.removeData();\n
// Other segments will update to fill the empty space left.\n
```\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>5720</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>05-Pie-Doughnut-Chart.md</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41271310.0</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>06-Advanced.md</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/octet-stream</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
---\n
title: Advanced usage\n
anchor: advanced-usage\n
---\n
\n
\n
### Prototype methods\n
\n
For each chart, there are a set of global prototype methods on the shared `ChartType` which you may find useful. These are available on all charts created with Chart.js, but for the examples, let\'s use a line chart we\'ve made.\n
\n
```javascript\n
// For example:\n
var myLineChart = new Chart(ctx).Line(data);\n
```\n
\n
#### .clear()\n
\n
Will clear the chart canvas. Used extensively internally between animation frames, but you might find it useful.\n
\n
```javascript\n
// Will clear the canvas that myLineChart is drawn on\n
myLineChart.clear();\n
// => returns \'this\' for chainability\n
```\n
\n
#### .stop()\n
\n
Use this to stop any current animation loop. This will pause the chart during any current animation frame. Call `.render()` to re-animate.\n
\n
```javascript\n
// Stops the charts animation loop at its current frame\n
myLineChart.stop();\n
// => returns \'this\' for chainability\n
```\n
\n
#### .resize()\n
\n
Use this to manually resize the canvas element. This is run each time the browser is resized, but you can call this method manually if you change the size of the canvas nodes container element.\n
\n
```javascript\n
// Resizes & redraws to fill its container element\n
myLineChart.resize();\n
// => returns \'this\' for chainability\n
```\n
\n
#### .destroy()\n
\n
Use this to destroy any chart instances that are created. This will clean up any references stored to the chart object within Chart.js, along with any associated event listeners attached by Chart.js.\n
\n
```javascript\n
// Destroys a specific chart instance\n
myLineChart.destroy();\n
```\n
\n
#### .toBase64Image()\n
\n
This returns a base 64 encoded string of the chart in it\'s current state.\n
\n
```javascript\n
myLineChart.toBase64Image();\n
// => returns png data url of the image on the canvas\n
```\n
\n
#### .generateLegend()\n
\n
Returns an HTML string of a legend for that chart. The template for this legend is at `legendTemplate` in the chart options.\n
\n
```javascript\n
myLineChart.generateLegend();\n
// => returns HTML string of a legend for this chart\n
```\n
\n
### External Tooltips\n
\n
You can enable custom tooltips in the global or chart configuration like so:\n
\n
```javascript\n
var myPieChart = new Chart(ctx).Pie(data, {\n
\tcustomTooltips: function(tooltip) {\n
\n
// tooltip will be false if tooltip is not visible or should be hidden\n
if (!tooltip) {\n
return;\n
}\n
\n
// Otherwise, tooltip will be an object with all tooltip properties like:\n
\n
// tooltip.caretHeight\n
// tooltip.caretPadding\n
// tooltip.chart\n
// tooltip.cornerRadius\n
// tooltip.fillColor\n
// tooltip.font...\n
// tooltip.text\n
// tooltip.x\n
// tooltip.y\n
// etc...\n
\n
};\n
});\n
```\n
\n
See files `sample/pie-customTooltips.html` and `sample/line-customTooltips.html` for examples on how to get started.\n
\n
\n
### Writing new chart types\n
\n
Chart.js 1.0 has been rewritten to provide a platform for developers to create their own custom chart types, and be able to share and utilise them through the Chart.js API.\n
\n
The format is relatively simple, there are a set of utility helper methods under `Chart.helpers`, including things such as looping over collections, requesting animation frames, and easing equations.\n
\n
On top of this, there are also some simple base classes of Chart elements, these all extend from `Chart.Element`, and include things such as points, bars and scales.\n
\n
```javascript\n
Chart.Type.extend({\n
\t// Passing in a name registers this chart in the Chart namespace\n
\tname: "Scatter",\n
\t// Providing a defaults will also register the deafults in the chart namespace\n
\tdefaults : {\n
\t\toptions: "Here",\n
\t\tavailable: "at this.options"\n
\t},\n
\t// Initialize is fired when the chart is initialized - Data is passed in as a parameter\n
\t// Config is automatically merged by the core of Chart.js, and is available at this.options\n
\tinitialize: function(data){\n
\t\tthis.chart.ctx // The drawing context for this chart\n
\t\tthis.chart.canvas // the canvas node for this chart\n
\t},\n
\t// Used to draw something on the canvas\n
\tdraw: function() {\n
\t}\n
});\n
\n
// Now we can create a new instance of our chart, using the Chart.js API\n
new Chart(ctx).Scatter(data);\n
// initialize is now run\n
```\n
\n
### Extending existing chart types\n
\n
We can also extend existing chart types, and expose them to the API in the same way. Let\'s say for example, we might want to run some more code when we initialize every Line chart.\n
\n
```javascript\n
// Notice now we\'re extending the particular Line chart type, rather than the base class.\n
Chart.types.Line.extend({\n
\t// Passing in a name registers this chart in the Chart namespace in the same way\n
\tname: "LineAlt",\n
\tinitialize: function(data){\n
\t\tconsole.log(\'My Line chart extension\');\n
\t\tChart.types.Line.prototype.initialize.apply(this, arguments);\n
\t}\n
});\n
\n
// Creates a line chart in the same way\n
new Chart(ctx).LineAlt(data);\n
// but this logs \'My Line chart extension\' in the console.\n
```\n
\n
### Community extensions\n
\n
- <a href="https://github.com/Regaddi/Chart.StackedBar.js" target="_blank">Stacked Bar Chart</a> by <a href="https://twitter.com/Regaddi" target="_blank">@Regaddi</a>\n
- <a href="https://github.com/tannerlinsley/Chart.StackedArea.js" target="_blank">Stacked Bar Chart</a> by <a href="https://twitter.com/tannerlinsley" target="_blank">@tannerlinsley</a>\n
- <a href="https://github.com/CAYdenberg/Chart.js" target="_blank">Error bars (bar and line charts)</a> by <a href="https://twitter.com/CAYdenberg" target="_blank">@CAYdenberg</a>\n
- <a href="http://dima117.github.io/Chart.Scatter/" target="_blank">Scatter chart (number & date scales are supported)</a> by <a href="https://github.com/dima117" target="_blank">@dima117</a>\n
\n
### Creating custom builds\n
\n
Chart.js uses <a href="http://gulpjs.com/" target="_blank">gulp</a> to build the library into a single JavaScript file. We can use this same build script with custom parameters in order to build a custom version.\n
\n
Firstly, we need to ensure development dependencies are installed. With node and npm installed, after cloning the Chart.js repo to a local directory, and navigating to that directory in the command line, we can run the following:\n
\n
```bash\n
npm install\n
npm install -g gulp\n
```\n
\n
This will install the local development dependencies for Chart.js, along with a CLI for the JavaScript task runner <a href="http://gulpjs.com/" target="_blank">gulp</a>.\n
\n
Now, we can run the `gulp build` task, and pass in a comma-separated list of types as an argument to build a custom version of Chart.js with only specified chart types.\n
\n
Here we will create a version of Chart.js with only Line, Radar and Bar charts included:\n
\n
```bash\n
gulp build --types=Line,Radar,Bar\n
```\n
\n
This will output to the `/custom` directory, and write two files, Chart.js, and Chart.min.js with only those chart types included.\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>6803</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>06-Advanced.md</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41271308.52</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>07-Notes.md</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/octet-stream</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
---\n
title: Notes\n
anchor: notes\n
---\n
\n
### Browser support\n
Browser support for the canvas element is available in all modern & major mobile browsers <a href="http://caniuse.com/canvas" target="_blank">(caniuse.com/canvas)</a>.\n
\n
For IE8 & below, I would recommend using the polyfill ExplorerCanvas - available at <a href="https://code.google.com/p/explorercanvas/" target="_blank">https://code.google.com/p/explorercanvas/</a>. It falls back to Internet explorer\'s format VML when canvas support is not available. Example use:\n
\n
```html\n
<head>\n
\t<!--[if lte IE 8]>\n
\t\t<script src="excanvas.js"></script>\n
\t<![endif]-->\n
</head>\n
```\n
\n
Usually I would recommend feature detection to choose whether or not to load a polyfill, rather than IE conditional comments, however in this case, VML is a Microsoft proprietary format, so it will only work in IE.\n
\n
Some important points to note in my experience using ExplorerCanvas as a fallback.\n
\n
- Initialise charts on load rather than DOMContentReady when using the library, as sometimes a race condition will occur, and it will result in an error when trying to get the 2d context of a canvas.\n
- New VML DOM elements are being created for each animation frame and there is no hardware acceleration. As a result animation is usually slow and jerky, with flashing text. It is a good idea to dynamically turn off animation based on canvas support. I recommend using the excellent <a href="http://modernizr.com/" target="_blank">Modernizr</a> to do this.\n
- When declaring fonts, the library explorercanvas requires the font name to be in single quotes inside the string. For example, instead of your scaleFontFamily property being simply "Arial", explorercanvas support, use "\'Arial\'" instead. Chart.js does this for default values.\n
\n
### Bugs & issues\n
\n
Please report these on the GitHub page - at <a href="https://github.com/nnnick/Chart.js" target="_blank">github.com/nnnick/Chart.js</a>. If you could include a link to a simple <a href="http://jsbin.com/" target="_blank">jsbin</a> or similar to demonstrate the issue, that\'d be really helpful.\n
\n
\n
### Contributing\n
New contributions to the library are welcome, just a couple of guidelines:\n
\n
- Tabs for indentation, not spaces please.\n
- Please ensure you\'re changing the individual files in `/src`, not the concatenated output in the `Chart.js` file in the root of the repo.\n
- Please check that your code will pass `jshint` code standards, `gulp jshint` will run this for you.\n
- Please keep pull requests concise, and document new functionality in the relevant `.md` file.\n
- Consider whether your changes are useful for all users, or if creating a Chart.js extension would be more appropriate.\n
\n
### License\n
Chart.js is open source and available under the <a href="http://opensource.org/licenses/MIT" target="_blank">MIT license</a>.
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>2808</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>07-Notes.md</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41271266.67</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>gulpfile.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
var gulp = require(\'gulp\'),\n
\tconcat = require(\'gulp-concat\'),\n
\tuglify = require(\'gulp-uglify\'),\n
\tutil = require(\'gulp-util\'),\n
\tjshint = require(\'gulp-jshint\'),\n
\tsize = require(\'gulp-size\'),\n
\tconnect = require(\'gulp-connect\'),\n
\treplace = require(\'gulp-replace\'),\n
\thtmlv = require(\'gulp-html-validator\'),\n
\tinquirer = require(\'inquirer\'),\n
\tsemver = require(\'semver\'),\n
\texec = require(\'child_process\').exec,\n
\tfs = require(\'fs\'),\n
\tpackage = require(\'./package.json\'),\n
\tbower = require(\'./bower.json\');\n
\n
var srcDir = \'./src/\';\n
/*\n
*\tUsage : gulp build --types=Bar,Line,Doughnut\n
*\tOutput: - A built Chart.js file with Core and types Bar, Line and Doughnut concatenated together\n
*\t\t\t- A minified version of this code, in Chart.min.js\n
*/\n
\n
gulp.task(\'build\', function(){\n
\n
\t// Default to all of the chart types, with Chart.Core first\n
\tvar srcFiles = [FileName(\'Core\')],\n
\t\tisCustom = !!(util.env.types),\n
\t\toutputDir = (isCustom) ? \'custom\' : \'.\';\n
\tif (isCustom){\n
\t\tutil.env.types.split(\',\').forEach(function(type){ return srcFiles.push(FileName(type));});\n
\t}\n
\telse{\n
\t\t// Seems gulp-concat remove duplicates - nice!\n
\t\t// So we can use this to sort out dependency order - aka include Core first!\n
\t\tsrcFiles.push(srcDir+\'*\');\n
\t}\n
\n
\treturn gulp.src(srcFiles)\n
\t\t.pipe(concat(\'Chart.js\'))\n
\t\t.pipe(replace(\'{{ version }}\', package.version))\n
\t\t.pipe(gulp.dest(outputDir))\n
\t\t.pipe(uglify({preserveComments:\'some\'}))\n
\t\t.pipe(concat(\'Chart.min.js\'))\n
\t\t.pipe(gulp.dest(outputDir));\n
\n
\tfunction FileName(moduleName){\n
\t\treturn srcDir+\'Chart.\'+moduleName+\'.js\';\n
\t}\n
});\n
\n
/*\n
*\tUsage : gulp bump\n
*\tPrompts: Version increment to bump\n
*\tOutput: - New version number written into package.json & bower.json\n
*/\n
\n
gulp.task(\'bump\', function(complete){\n
\tutil.log(\'Current version:\', util.colors.cyan(package.version));\n
\tvar choices = [\'major\', \'premajor\', \'minor\', \'preminor\', \'patch\', \'prepatch\', \'prerelease\'].map(function(versionType){\n
\t\treturn versionType + \' (v\' + semver.inc(package.version, versionType) + \')\';\n
\t});\n
\tinquirer.prompt({\n
\t\ttype: \'list\',\n
\t\tname: \'version\',\n
\t\tmessage: \'What version update would you like?\',\n
\t\tchoices: choices\n
\t}, function(res){\n
\t\tvar increment = res.version.split(\' \')[0],\n
\t\t\tnewVersion = semver.inc(package.version, increment);\n
\n
\t\t// Set the new versions into the bower/package object\n
\t\tpackage.version = newVersion;\n
\t\tbower.version = newVersion;\n
\n
\t\t// Write these to their own files, then build the output\n
\t\tfs.writeFileSync(\'package.json\', JSON.stringify(package, null, 2));\n
\t\tfs.writeFileSync(\'bower.json\', JSON.stringify(bower, null, 2));\n
\n
\t\tcomplete();\n
\t});\n
});\n
\n
gulp.task(\'release\', [\'build\'], function(){\n
\texec(\'git tag -a v\' + package.version);\n
});\n
\n
gulp.task(\'jshint\', function(){\n
\treturn gulp.src(srcDir + \'*.js\')\n
\t\t.pipe(jshint())\n
\t\t.pipe(jshint.reporter(\'default\'));\n
});\n
\n
gulp.task(\'valid\', function(){\n
\treturn gulp.src(\'samples/*.html\')\n
.pipe(htmlv());\n
});\n
\n
gulp.task(\'library-size\', function(){\n
\treturn gulp.src(\'Chart.min.js\')\n
\t\t.pipe(size({\n
\t\t\tgzip: true\n
\t\t}));\n
});\n
\n
gulp.task(\'module-sizes\', function(){\n
\treturn gulp.src(srcDir + \'*.js\')\n
\t.pipe(uglify({preserveComments:\'some\'}))\n
\t.pipe(size({\n
\t\tshowFiles: true,\n
\t\tgzip: true\n
\t}));\n
});\n
\n
gulp.task(\'watch\', function(){\n
\tgulp.watch(\'./src/*\', [\'build\']);\n
});\n
\n
gulp.task(\'test\', [\'jshint\', \'valid\']);\n
\n
gulp.task(\'size\', [\'library-size\', \'module-sizes\']);\n
\n
gulp.task(\'default\', [\'build\', \'watch\']);\n
\n
gulp.task(\'server\', function(){\n
\tconnect.server({\n
\t\tport: 8000\n
\t});\n
});\n
\n
// Convenience task for opening the project straight from the command line\n
gulp.task(\'_open\', function(){\n
\texec(\'open http://localhost:8000\');\n
\texec(\'subl .\');\n
});\n
\n
gulp.task(\'dev\', [\'server\', \'default\']);\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>3651</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>gulpfile.js</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41271269.59</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>package.json</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/json</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string>{\n
"name": "chart.js",\n
"homepage": "http://www.chartjs.org",\n
"description": "Simple HTML5 charts using the canvas element.",\n
"version": "1.0.2",\n
"main": "Chart.js",\n
"repository": {\n
"type": "git",\n
"url": "https://github.com/nnnick/Chart.js.git"\n
},\n
"license" : "MIT",\n
"dependences": {},\n
"devDependencies": {\n
"gulp": "3.5.x",\n
"gulp-concat": "~2.1.x",\n
"gulp-connect": "~2.0.5",\n
"gulp-jshint": "~1.5.1",\n
"gulp-replace": "^0.4.0",\n
"gulp-size": "~0.4.0",\n
"gulp-uglify": "~0.2.x",\n
"gulp-util": "~2.2.x",\n
"gulp-html-validator": "^0.0.2",\n
"inquirer": "^0.5.1",\n
"semver": "^3.0.1"\n
},\n
"spm": {\n
"main": "Chart.js"\n
}\n
}\n
</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>686</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>package.json</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>samples</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>samples</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41271274.52</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>bar.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!doctype html>\n
<html>\n
\t<head>\n
\t\t<title>Bar Chart</title>\n
\t\t<script src="../Chart.js"></script>\n
\t</head>\n
\t<body>\n
\t\t<div style="width: 50%">\n
\t\t\t<canvas id="canvas" height="450" width="600"></canvas>\n
\t\t</div>\n
\n
\n
\t<script>\n
\tvar randomScalingFactor = function(){ return Math.round(Math.random()*100)};\n
\n
\tvar barChartData = {\n
\t\tlabels : ["January","February","March","April","May","June","July"],\n
\t\tdatasets : [\n
\t\t\t{\n
\t\t\t\tfillColor : "rgba(220,220,220,0.5)",\n
\t\t\t\tstrokeColor : "rgba(220,220,220,0.8)",\n
\t\t\t\thighlightFill: "rgba(220,220,220,0.75)",\n
\t\t\t\thighlightStroke: "rgba(220,220,220,1)",\n
\t\t\t\tdata : [randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor()]\n
\t\t\t},\n
\t\t\t{\n
\t\t\t\tfillColor : "rgba(151,187,205,0.5)",\n
\t\t\t\tstrokeColor : "rgba(151,187,205,0.8)",\n
\t\t\t\thighlightFill : "rgba(151,187,205,0.75)",\n
\t\t\t\thighlightStroke : "rgba(151,187,205,1)",\n
\t\t\t\tdata : [randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor()]\n
\t\t\t}\n
\t\t]\n
\n
\t}\n
\twindow.onload = function(){\n
\t\tvar ctx = document.getElementById("canvas").getContext("2d");\n
\t\twindow.myBar = new Chart(ctx).Bar(barChartData, {\n
\t\t\tresponsive : true\n
\t\t});\n
\t}\n
\n
\t</script>\n
\t</body>\n
</html>\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>1321</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>bar.html</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41271272.71</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>doughnut.color.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!doctype html>\n
<html>\n
\t<head>\n
\t\t<title>Doughnut Chart</title>\n
\t\t<script src="../src/Chart.Core.js"></script>\n
\t\t<script src="../src/Chart.Doughnut.js"></script>\n
\t\t<style>\n
\t\t\tbody{\n
\t\t\t\tpadding: 0;\n
\t\t\t\tmargin: 0;\n
\t\t\t}\n
\t\t\t#canvas-holder{\n
\t\t\t\twidth:30%;\n
\t\t\t}\n
\t\t</style>\n
\t</head>\n
\t<body>\n
\t\t<div id="canvas-holder">\n
\t\t\t<canvas id="chart-area" width="500" height="500"/>\n
\t\t</div>\n
\n
\n
\t<script>\n
\n
\t\tvar doughnutData = [\n
\t\t\t\t{\n
\t\t\t\t\tvalue: 1,\n
\t\t\t\t\tlabel: "One"\n
\t\t\t\t},\n
\t\t\t\t{\n
\t\t\t\t\tvalue: 2,\n
\t\t\t\t\tlabel: "Two"\n
\t\t\t\t},\n
\t\t\t\t{\n
\t\t\t\t\tvalue: 3,\n
\t\t\t\t\tlabel: "Three"\n
\t\t\t\t},\n
\t\t\t\t{\n
\t\t\t\t\tvalue: 4,\n
\t\t\t\t\tlabel: "Four"\n
\t\t\t\t},\n
\t\t\t\t{\n
\t\t\t\t\tvalue: 5,\n
\t\t\t\t\tlabel: "Five"\n
\t\t\t\t}\n
\n
\t\t\t];\n
\n
\t\t\twindow.onload = function(){\n
\t\t\t\tvar ctx = document.getElementById("chart-area").getContext("2d");\n
\t\t\t\twindow.myDoughnut = new Chart(ctx).Doughnut(doughnutData, {responsive : true});\n
\t\t\t};\n
\n
\n
\n
\t</script>\n
\t</body>\n
</html>\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>872</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>doughnut.color.html</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41271271.89</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>doughnut.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!doctype html>\n
<html>\n
\t<head>\n
\t\t<title>Doughnut Chart</title>\n
\t\t<script src="../Chart.js"></script>\n
\t\t<style>\n
\t\t\tbody{\n
\t\t\t\tpadding: 0;\n
\t\t\t\tmargin: 0;\n
\t\t\t}\n
\t\t\t#canvas-holder{\n
\t\t\t\twidth:30%;\n
\t\t\t}\n
\t\t</style>\n
\t</head>\n
\t<body>\n
\t\t<div id="canvas-holder">\n
\t\t\t<canvas id="chart-area" width="500" height="500"/>\n
\t\t</div>\n
\n
\n
\t<script>\n
\n
\t\tvar doughnutData = [\n
\t\t\t\t{\n
\t\t\t\t\tvalue: 300,\n
\t\t\t\t\tcolor:"#F7464A",\n
\t\t\t\t\thighlight: "#FF5A5E",\n
\t\t\t\t\tlabel: "Red"\n
\t\t\t\t},\n
\t\t\t\t{\n
\t\t\t\t\tvalue: 50,\n
\t\t\t\t\tcolor: "#46BFBD",\n
\t\t\t\t\thighlight: "#5AD3D1",\n
\t\t\t\t\tlabel: "Green"\n
\t\t\t\t},\n
\t\t\t\t{\n
\t\t\t\t\tvalue: 100,\n
\t\t\t\t\tcolor: "#FDB45C",\n
\t\t\t\t\thighlight: "#FFC870",\n
\t\t\t\t\tlabel: "Yellow"\n
\t\t\t\t},\n
\t\t\t\t{\n
\t\t\t\t\tvalue: 40,\n
\t\t\t\t\tcolor: "#949FB1",\n
\t\t\t\t\thighlight: "#A8B3C5",\n
\t\t\t\t\tlabel: "Grey"\n
\t\t\t\t},\n
\t\t\t\t{\n
\t\t\t\t\tvalue: 120,\n
\t\t\t\t\tcolor: "#4D5360",\n
\t\t\t\t\thighlight: "#616774",\n
\t\t\t\t\tlabel: "Dark Grey"\n
\t\t\t\t}\n
\n
\t\t\t];\n
\n
\t\t\twindow.onload = function(){\n
\t\t\t\tvar ctx = document.getElementById("chart-area").getContext("2d");\n
\t\t\t\twindow.myDoughnut = new Chart(ctx).Doughnut(doughnutData, {responsive : true});\n
\t\t\t};\n
\n
\n
\n
\t</script>\n
\t</body>\n
</html>\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>1077</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>doughnut.html</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41271275.53</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>line-customTooltips.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!doctype html>\n
<html>\n
\n
<head>\n
<title>Line Chart with Custom Tooltips</title>\n
<script src="../Chart.js"></script>\n
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>\n
\n
<style>\n
#canvas-holder1 {\n
width: 300px;\n
margin: 20px auto;\n
}\n
#canvas-holder2 {\n
width: 50%;\n
margin: 20px 25%;\n
}\n
#chartjs-tooltip {\n
opacity: 1;\n
position: absolute;\n
background: rgba(0, 0, 0, .7);\n
color: white;\n
padding: 3px;\n
border-radius: 3px;\n
-webkit-transition: all .1s ease;\n
transition: all .1s ease;\n
pointer-events: none;\n
-webkit-transform: translate(-50%, 0);\n
transform: translate(-50%, 0);\n
}\n
\t.chartjs-tooltip-key{\n
\t\tdisplay:inline-block;\n
\t\twidth:10px;\n
\t\theight:10px;\n
\t}\n
</style>\n
</head>\n
\n
<body>\n
<div id="canvas-holder1">\n
<canvas id="chart1" width="300" height="30" />\n
</div>\n
<div id="canvas-holder2">\n
<canvas id="chart2" width="450" height="600" />\n
</div>\n
\n
<div id="chartjs-tooltip"></div>\n
\n
\n
<script>\n
\n
Chart.defaults.global.pointHitDetectionRadius = 1;\n
Chart.defaults.global.customTooltips = function(tooltip) {\n
\n
var tooltipEl = $(\'#chartjs-tooltip\');\n
\n
if (!tooltip) {\n
tooltipEl.css({\n
opacity: 0\n
});\n
return;\n
}\n
\n
tooltipEl.removeClass(\'above below\');\n
tooltipEl.addClass(tooltip.yAlign);\n
\n
var innerHtml = \'\';\n
for (var i = tooltip.labels.length - 1; i >= 0; i--) {\n
\tinnerHtml += [\n
\t\t\'<div class="chartjs-tooltip-section">\',\n
\t\t\'\t<span class="chartjs-tooltip-key" style="background-color:\' + tooltip.legendColors[i].fill + \'"></span>\',\n
\t\t\'\t<span class="chartjs-tooltip-value">\' + tooltip.labels[i] + \'</span>\',\n
\t\t\'</div>\'\n
\t].join(\'\');\n
}\n
tooltipEl.html(innerHtml);\n
\n
tooltipEl.css({\n
opacity: 1,\n
left: tooltip.chart.canvas.offsetLeft + tooltip.x + \'px\',\n
top: tooltip.chart.canvas.offsetTop + tooltip.y + \'px\',\n
fontFamily: tooltip.fontFamily,\n
fontSize: tooltip.fontSize,\n
fontStyle: tooltip.fontStyle,\n
});\n
};\n
var randomScalingFactor = function() {\n
return Math.round(Math.random() * 100);\n
};\n
var lineChartData = {\n
labels: ["January", "February", "March", "April", "May", "June", "July"],\n
datasets: [{\n
label: "My First dataset",\n
fillColor: "rgba(220,220,220,0.2)",\n
strokeColor: "rgba(220,220,220,1)",\n
pointColor: "rgba(220,220,220,1)",\n
pointStrokeColor: "#fff",\n
pointHighlightFill: "#fff",\n
pointHighlightStroke: "rgba(220,220,220,1)",\n
data: [randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor()]\n
}, {\n
label: "My Second dataset",\n
fillColor: "rgba(151,187,205,0.2)",\n
strokeColor: "rgba(151,187,205,1)",\n
pointColor: "rgba(151,187,205,1)",\n
pointStrokeColor: "#fff",\n
pointHighlightFill: "#fff",\n
pointHighlightStroke: "rgba(151,187,205,1)",\n
data: [randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor()]\n
}]\n
};\n
\n
window.onload = function() {\n
var ctx1 = document.getElementById("chart1").getContext("2d");\n
window.myLine = new Chart(ctx1).Line(lineChartData, {\n
\tshowScale: false,\n
\tpointDot : true,\n
responsive: true\n
});\n
\n
var ctx2 = document.getElementById("chart2").getContext("2d");\n
window.myLine = new Chart(ctx2).Line(lineChartData, {\n
responsive: true\n
});\n
};\n
</script>\n
</body>\n
\n
</html>\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>4024</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>line-customTooltips.html</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41271274.01</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>line.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!doctype html>\n
<html>\n
\t<head>\n
\t\t<title>Line Chart</title>\n
\t\t<script src="../Chart.js"></script>\n
\t</head>\n
\t<body>\n
\t\t<div style="width:30%">\n
\t\t\t<div>\n
\t\t\t\t<canvas id="canvas" height="450" width="600"></canvas>\n
\t\t\t</div>\n
\t\t</div>\n
\n
\n
\t<script>\n
\t\tvar randomScalingFactor = function(){ return Math.round(Math.random()*100)};\n
\t\tvar lineChartData = {\n
\t\t\tlabels : ["January","February","March","April","May","June","July"],\n
\t\t\tdatasets : [\n
\t\t\t\t{\n
\t\t\t\t\tlabel: "My First dataset",\n
\t\t\t\t\tfillColor : "rgba(220,220,220,0.2)",\n
\t\t\t\t\tstrokeColor : "rgba(220,220,220,1)",\n
\t\t\t\t\tpointColor : "rgba(220,220,220,1)",\n
\t\t\t\t\tpointStrokeColor : "#fff",\n
\t\t\t\t\tpointHighlightFill : "#fff",\n
\t\t\t\t\tpointHighlightStroke : "rgba(220,220,220,1)",\n
\t\t\t\t\tdata : [randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor()]\n
\t\t\t\t},\n
\t\t\t\t{\n
\t\t\t\t\tlabel: "My Second dataset",\n
\t\t\t\t\tfillColor : "rgba(151,187,205,0.2)",\n
\t\t\t\t\tstrokeColor : "rgba(151,187,205,1)",\n
\t\t\t\t\tpointColor : "rgba(151,187,205,1)",\n
\t\t\t\t\tpointStrokeColor : "#fff",\n
\t\t\t\t\tpointHighlightFill : "#fff",\n
\t\t\t\t\tpointHighlightStroke : "rgba(151,187,205,1)",\n
\t\t\t\t\tdata : [randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor()]\n
\t\t\t\t}\n
\t\t\t]\n
\n
\t\t}\n
\n
\twindow.onload = function(){\n
\t\tvar ctx = document.getElementById("canvas").getContext("2d");\n
\t\twindow.myLine = new Chart(ctx).Line(lineChartData, {\n
\t\t\tresponsive: true\n
\t\t});\n
\t}\n
\n
\n
\t</script>\n
\t</body>\n
</html>\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>1558</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>line.html</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41271271.42</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>pie-customTooltips.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!doctype html>\n
<html>\n
\n
<head>\n
<title>Pie Chart with Custom Tooltips</title>\n
<script src="../Chart.js"></script>\n
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>\n
\n
<style>\n
#canvas-holder {\n
width: 100%;\n
margin-top: 50px;\n
text-align: center;\n
}\n
#chartjs-tooltip {\n
opacity: 1;\n
position: absolute;\n
background: rgba(0, 0, 0, .7);\n
color: white;\n
padding: 3px;\n
border-radius: 3px;\n
-webkit-transition: all .1s ease;\n
transition: all .1s ease;\n
pointer-events: none;\n
-webkit-transform: translate(-50%, 0);\n
transform: translate(-50%, 0);\n
}\n
#chartjs-tooltip.below {\n
-webkit-transform: translate(-50%, 0);\n
transform: translate(-50%, 0);\n
}\n
#chartjs-tooltip.below:before {\n
border: solid;\n
border-color: #111 transparent;\n
border-color: rgba(0, 0, 0, .8) transparent;\n
border-width: 0 8px 8px 8px;\n
bottom: 1em;\n
content: "";\n
display: block;\n
left: 50%;\n
position: absolute;\n
z-index: 99;\n
-webkit-transform: translate(-50%, -100%);\n
transform: translate(-50%, -100%);\n
}\n
#chartjs-tooltip.above {\n
-webkit-transform: translate(-50%, -100%);\n
transform: translate(-50%, -100%);\n
}\n
#chartjs-tooltip.above:before {\n
border: solid;\n
border-color: #111 transparent;\n
border-color: rgba(0, 0, 0, .8) transparent;\n
border-width: 8px 8px 0 8px;\n
bottom: 1em;\n
content: "";\n
display: block;\n
left: 50%;\n
top: 100%;\n
position: absolute;\n
z-index: 99;\n
-webkit-transform: translate(-50%, 0);\n
transform: translate(-50%, 0);\n
}\n
</style>\n
</head>\n
\n
<body>\n
<div id="canvas-holder">\n
<canvas id="chart-area1" width="50" height="50" />\n
</div>\n
<div id="canvas-holder">\n
<canvas id="chart-area2" width="300" height="300" />\n
</div>\n
\n
<div id="chartjs-tooltip"></div>\n
\n
\n
<script>\n
Chart.defaults.global.customTooltips = function(tooltip) {\n
\n
\t// Tooltip Element\n
var tooltipEl = $(\'#chartjs-tooltip\');\n
\n
// Hide if no tooltip\n
if (!tooltip) {\n
tooltipEl.css({\n
opacity: 0\n
});\n
return;\n
}\n
\n
// Set caret Position\n
tooltipEl.removeClass(\'above below\');\n
tooltipEl.addClass(tooltip.yAlign);\n
\n
// Set Text\n
tooltipEl.html(tooltip.text);\n
\n
// Find Y Location on page\n
var top;\n
if (tooltip.yAlign == \'above\') {\n
top = tooltip.y - tooltip.caretHeight - tooltip.caretPadding;\n
} else {\n
top = tooltip.y + tooltip.caretHeight + tooltip.caretPadding;\n
}\n
\n
// Display, position, and set styles for font\n
tooltipEl.css({\n
opacity: 1,\n
left: tooltip.chart.canvas.offsetLeft + tooltip.x + \'px\',\n
top: tooltip.chart.canvas.offsetTop + top + \'px\',\n
fontFamily: tooltip.fontFamily,\n
fontSize: tooltip.fontSize,\n
fontStyle: tooltip.fontStyle,\n
});\n
};\n
\n
var pieData = [{\n
value: 300,\n
color: "#F7464A",\n
highlight: "#FF5A5E",\n
label: "Red"\n
}, {\n
value: 50,\n
color: "#46BFBD",\n
highlight: "#5AD3D1",\n
label: "Green"\n
}, {\n
value: 100,\n
color: "#FDB45C",\n
highlight: "#FFC870",\n
label: "Yellow"\n
}, {\n
value: 40,\n
color: "#949FB1",\n
highlight: "#A8B3C5",\n
label: "Grey"\n
}, {\n
value: 120,\n
color: "#4D5360",\n
highlight: "#616774",\n
label: "Dark Grey"\n
}];\n
\n
window.onload = function() {\n
var ctx1 = document.getElementById("chart-area1").getContext("2d");\n
window.myPie = new Chart(ctx1).Pie(pieData);\n
\n
var ctx2 = document.getElementById("chart-area2").getContext("2d");\n
window.myPie = new Chart(ctx2).Pie(pieData);\n
};\n
</script>\n
</body>\n
\n
</html>\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>4110</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>pie-customTooltips.html</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41271273.17</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>pie.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!doctype html>\n
<html>\n
\t<head>\n
\t\t<title>Pie Chart</title>\n
\t\t<script src="../Chart.js"></script>\n
\t</head>\n
\t<body>\n
\t\t<div id="canvas-holder">\n
\t\t\t<canvas id="chart-area" width="300" height="300"/>\n
\t\t</div>\n
\n
\n
\t<script>\n
\n
\t\tvar pieData = [\n
\t\t\t\t{\n
\t\t\t\t\tvalue: 300,\n
\t\t\t\t\tcolor:"#F7464A",\n
\t\t\t\t\thighlight: "#FF5A5E",\n
\t\t\t\t\tlabel: "Red"\n
\t\t\t\t},\n
\t\t\t\t{\n
\t\t\t\t\tvalue: 50,\n
\t\t\t\t\tcolor: "#46BFBD",\n
\t\t\t\t\thighlight: "#5AD3D1",\n
\t\t\t\t\tlabel: "Green"\n
\t\t\t\t},\n
\t\t\t\t{\n
\t\t\t\t\tvalue: 100,\n
\t\t\t\t\tcolor: "#FDB45C",\n
\t\t\t\t\thighlight: "#FFC870",\n
\t\t\t\t\tlabel: "Yellow"\n
\t\t\t\t},\n
\t\t\t\t{\n
\t\t\t\t\tvalue: 40,\n
\t\t\t\t\tcolor: "#949FB1",\n
\t\t\t\t\thighlight: "#A8B3C5",\n
\t\t\t\t\tlabel: "Grey"\n
\t\t\t\t},\n
\t\t\t\t{\n
\t\t\t\t\tvalue: 120,\n
\t\t\t\t\tcolor: "#4D5360",\n
\t\t\t\t\thighlight: "#616774",\n
\t\t\t\t\tlabel: "Dark Grey"\n
\t\t\t\t}\n
\n
\t\t\t];\n
\n
\t\t\twindow.onload = function(){\n
\t\t\t\tvar ctx = document.getElementById("chart-area").getContext("2d");\n
\t\t\t\twindow.myPie = new Chart(ctx).Pie(pieData);\n
\t\t\t};\n
\n
\n
\n
\t</script>\n
\t</body>\n
</html>\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>926</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>pie.html</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41271270.91</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>polar-area.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!doctype html>\n
<html>\n
\t<head>\n
\t\t<title>Polar Area Chart</title>\n
\t\t<script src="../Chart.js"></script>\n
\t</head>\n
\t<body>\n
\t\t<div id="canvas-holder" style="width:30%">\n
\t\t\t<canvas id="chart-area" width="300" height="300"/>\n
\t\t</div>\n
\n
\n
\t<script>\n
\n
\t\tvar polarData = [\n
\t\t\t\t{\n
\t\t\t\t\tvalue: 300,\n
\t\t\t\t\tcolor:"#F7464A",\n
\t\t\t\t\thighlight: "#FF5A5E",\n
\t\t\t\t\tlabel: "Red"\n
\t\t\t\t},\n
\t\t\t\t{\n
\t\t\t\t\tvalue: 50,\n
\t\t\t\t\tcolor: "#46BFBD",\n
\t\t\t\t\thighlight: "#5AD3D1",\n
\t\t\t\t\tlabel: "Green"\n
\t\t\t\t},\n
\t\t\t\t{\n
\t\t\t\t\tvalue: 100,\n
\t\t\t\t\tcolor: "#FDB45C",\n
\t\t\t\t\thighlight: "#FFC870",\n
\t\t\t\t\tlabel: "Yellow"\n
\t\t\t\t},\n
\t\t\t\t{\n
\t\t\t\t\tvalue: 40,\n
\t\t\t\t\tcolor: "#949FB1",\n
\t\t\t\t\thighlight: "#A8B3C5",\n
\t\t\t\t\tlabel: "Grey"\n
\t\t\t\t},\n
\t\t\t\t{\n
\t\t\t\t\tvalue: 120,\n
\t\t\t\t\tcolor: "#4D5360",\n
\t\t\t\t\thighlight: "#616774",\n
\t\t\t\t\tlabel: "Dark Grey"\n
\t\t\t\t}\n
\n
\t\t\t];\n
\n
\t\t\twindow.onload = function(){\n
\t\t\t\tvar ctx = document.getElementById("chart-area").getContext("2d");\n
\t\t\t\twindow.myPolarArea = new Chart(ctx).PolarArea(polarData, {\n
\t\t\t\t\tresponsive:true\n
\t\t\t\t});\n
\t\t\t};\n
\n
\n
\n
\t</script>\n
\t</body>\n
</html>\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>997</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>polar-area.html</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41271275.11</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>radar.html</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!doctype html>\n
<html>\n
\t<head>\n
\t\t<title>Radar Chart</title>\n
\t\t<script src="../Chart.js"></script>\n
\t\t<meta name = "viewport" content = "initial-scale = 1, user-scalable = no">\n
\t\t<style>\n
\t\t\tcanvas{\n
\t\t\t}\n
\t\t</style>\n
\t</head>\n
\t<body>\n
\t\t<div style="width:30%">\n
\t\t\t<canvas id="canvas" height="450" width="450"></canvas>\n
\t\t</div>\n
\n
\n
\t<script>\n
\tvar radarChartData = {\n
\t\tlabels: ["Eating", "Drinking", "Sleeping", "Designing", "Coding", "Cycling", "Running"],\n
\t\tdatasets: [\n
\t\t\t{\n
\t\t\t\tlabel: "My First dataset",\n
\t\t\t\tfillColor: "rgba(220,220,220,0.2)",\n
\t\t\t\tstrokeColor: "rgba(220,220,220,1)",\n
\t\t\t\tpointColor: "rgba(220,220,220,1)",\n
\t\t\t\tpointStrokeColor: "#fff",\n
\t\t\t\tpointHighlightFill: "#fff",\n
\t\t\t\tpointHighlightStroke: "rgba(220,220,220,1)",\n
\t\t\t\tdata: [65,59,90,81,56,55,40]\n
\t\t\t},\n
\t\t\t{\n
\t\t\t\tlabel: "My Second dataset",\n
\t\t\t\tfillColor: "rgba(151,187,205,0.2)",\n
\t\t\t\tstrokeColor: "rgba(151,187,205,1)",\n
\t\t\t\tpointColor: "rgba(151,187,205,1)",\n
\t\t\t\tpointStrokeColor: "#fff",\n
\t\t\t\tpointHighlightFill: "#fff",\n
\t\t\t\tpointHighlightStroke: "rgba(151,187,205,1)",\n
\t\t\t\tdata: [28,48,40,19,96,27,100]\n
\t\t\t}\n
\t\t]\n
\t};\n
\n
\twindow.onload = function(){\n
\t\twindow.myRadar = new Chart(document.getElementById("canvas").getContext("2d")).Radar(radarChartData, {\n
\t\t\tresponsive: true\n
\t\t});\n
\t}\n
\n
\t</script>\n
\t</body>\n
</html>\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>1275</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>radar.html</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>src</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>src</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41271278.62</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Chart.Bar.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
(function(){\n
\t"use strict";\n
\n
\tvar root = this,\n
\t\tChart = root.Chart,\n
\t\thelpers = Chart.helpers;\n
\n
\n
\tvar defaultConfig = {\n
\t\t//Boolean - Whether the scale should start at zero, or an order of magnitude down from the lowest value\n
\t\tscaleBeginAtZero : true,\n
\n
\t\t//Boolean - Whether grid lines are shown across the chart\n
\t\tscaleShowGridLines : true,\n
\n
\t\t//String - Colour of the grid lines\n
\t\tscaleGridLineColor : "rgba(0,0,0,.05)",\n
\n
\t\t//Number - Width of the grid lines\n
\t\tscaleGridLineWidth : 1,\n
\n
\t\t//Boolean - Whether to show horizontal lines (except X axis)\n
\t\tscaleShowHorizontalLines: true,\n
\n
\t\t//Boolean - Whether to show vertical lines (except Y axis)\n
\t\tscaleShowVerticalLines: true,\n
\n
\t\t//Boolean - If there is a stroke on each bar\n
\t\tbarShowStroke : true,\n
\n
\t\t//Number - Pixel width of the bar stroke\n
\t\tbarStrokeWidth : 2,\n
\n
\t\t//Number - Spacing between each of the X value sets\n
\t\tbarValueSpacing : 5,\n
\n
\t\t//Number - Spacing between data sets within X values\n
\t\tbarDatasetSpacing : 1,\n
\n
\t\t//String - A legend template\n
\t\tlegendTemplate : "<ul class=\\"<%=name.toLowerCase()%>-legend\\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\\"background-color:<%=datasets[i].fillColor%>\\"><%if(datasets[i].label){%><%=datasets[i].label%><%}%></span></li><%}%></ul>"\n
\n
\t};\n
\n
\n
\tChart.Type.extend({\n
\t\tname: "Bar",\n
\t\tdefaults : defaultConfig,\n
\t\tinitialize: function(data){\n
\n
\t\t\t//Expose options as a scope variable here so we can access it in the ScaleClass\n
\t\t\tvar options = this.options;\n
\n
\t\t\tthis.ScaleClass = Chart.Scale.extend({\n
\t\t\t\toffsetGridLines : true,\n
\t\t\t\tcalculateBarX : function(datasetCount, datasetIndex, barIndex){\n
\t\t\t\t\t//Reusable method for calculating the xPosition of a given bar based on datasetIndex & width of the bar\n
\t\t\t\t\tvar xWidth = this.calculateBaseWidth(),\n
\t\t\t\t\t\txAbsolute = this.calculateX(barIndex) - (xWidth/2),\n
\t\t\t\t\t\tbarWidth = this.calculateBarWidth(datasetCount);\n
\n
\t\t\t\t\treturn xAbsolute + (barWidth * datasetIndex) + (datasetIndex * options.barDatasetSpacing) + barWidth/2;\n
\t\t\t\t},\n
\t\t\t\tcalculateBaseWidth : function(){\n
\t\t\t\t\treturn (this.calculateX(1) - this.calculateX(0)) - (2*options.barValueSpacing);\n
\t\t\t\t},\n
\t\t\t\tcalculateBarWidth : function(datasetCount){\n
\t\t\t\t\t//The padding between datasets is to the right of each bar, providing that there are more than 1 dataset\n
\t\t\t\t\tvar baseWidth = this.calculateBaseWidth() - ((datasetCount - 1) * options.barDatasetSpacing);\n
\n
\t\t\t\t\treturn (baseWidth / datasetCount);\n
\t\t\t\t}\n
\t\t\t});\n
\n
\t\t\tthis.datasets = [];\n
\n
\t\t\t//Set up tooltip events on the chart\n
\t\t\tif (this.options.showTooltips){\n
\t\t\t\thelpers.bindEvents(this, this.options.tooltipEvents, function(evt){\n
\t\t\t\t\tvar activeBars = (evt.type !== \'mouseout\') ? this.getBarsAtEvent(evt) : [];\n
\n
\t\t\t\t\tthis.eachBars(function(bar){\n
\t\t\t\t\t\tbar.restore([\'fillColor\', \'strokeColor\']);\n
\t\t\t\t\t});\n
\t\t\t\t\thelpers.each(activeBars, function(activeBar){\n
\t\t\t\t\t\tactiveBar.fillColor = activeBar.highlightFill;\n
\t\t\t\t\t\tactiveBar.strokeColor = activeBar.highlightStroke;\n
\t\t\t\t\t});\n
\t\t\t\t\tthis.showTooltip(activeBars);\n
\t\t\t\t});\n
\t\t\t}\n
\n
\t\t\t//Declare the extension of the default point, to cater for the options passed in to the constructor\n
\t\t\tthis.BarClass = Chart.Rectangle.extend({\n
\t\t\t\tstrokeWidth : this.options.barStrokeWidth,\n
\t\t\t\tshowStroke : this.options.barShowStroke,\n
\t\t\t\tctx : this.chart.ctx\n
\t\t\t});\n
\n
\t\t\t//Iterate through each of the datasets, and build this into a property of the chart\n
\t\t\thelpers.each(data.datasets,function(dataset,datasetIndex){\n
\n
\t\t\t\tvar datasetObject = {\n
\t\t\t\t\tlabel : dataset.label || null,\n
\t\t\t\t\tfillColor : dataset.fillColor,\n
\t\t\t\t\tstrokeColor : dataset.strokeColor,\n
\t\t\t\t\tbars : []\n
\t\t\t\t};\n
\n
\t\t\t\tthis.datasets.push(datasetObject);\n
\n
\t\t\t\thelpers.each(dataset.data,function(dataPoint,index){\n
\t\t\t\t\t//Add a new point for each piece of data, passing any required data to draw.\n
\t\t\t\t\tdatasetObject.bars.push(new this.BarClass({\n
\t\t\t\t\t\tvalue : dataPoint,\n
\t\t\t\t\t\tlabel : data.labels[index],\n
\t\t\t\t\t\tdatasetLabel: dataset.label,\n
\t\t\t\t\t\tstrokeColor : dataset.strokeColor,\n
\t\t\t\t\t\tfillColor : dataset.fillColor,\n
\t\t\t\t\t\thighlightFill : dataset.highlightFill || dataset.fillColor,\n
\t\t\t\t\t\thighlightStroke : dataset.highlightStroke || dataset.strokeColor\n
\t\t\t\t\t}));\n
\t\t\t\t},this);\n
\n
\t\t\t},this);\n
\n
\t\t\tthis.buildScale(data.labels);\n
\n
\t\t\tthis.BarClass.prototype.base = this.scale.endPoint;\n
\n
\t\t\tthis.eachBars(function(bar, index, datasetIndex){\n
\t\t\t\thelpers.extend(bar, {\n
\t\t\t\t\twidth : this.scale.calculateBarWidth(this.datasets.length),\n
\t\t\t\t\tx: this.scale.calculateBarX(this.datasets.length, datasetIndex, index),\n
\t\t\t\t\ty: this.scale.endPoint\n
\t\t\t\t});\n
\t\t\t\tbar.save();\n
\t\t\t}, this);\n
\n
\t\t\tthis.render();\n
\t\t},\n
\t\tupdate : function(){\n
\t\t\tthis.scale.update();\n
\t\t\t// Reset any highlight colours before updating.\n
\t\t\thelpers.each(this.activeElements, function(activeElement){\n
\t\t\t\tactiveElement.restore([\'fillColor\', \'strokeColor\']);\n
\t\t\t});\n
\n
\t\t\tthis.eachBars(function(bar){\n
\t\t\t\tbar.save();\n
\t\t\t});\n
\t\t\tthis.render();\n
\t\t},\n
\t\teachBars : function(callback){\n
\t\t\thelpers.each(this.datasets,function(dataset, datasetIndex){\n
\t\t\t\thelpers.each(dataset.bars, callback, this, datasetIndex);\n
\t\t\t},this);\n
\t\t},\n
\t\tgetBarsAtEvent : function(e){\n
\t\t\tvar barsArray = [],\n
\t\t\t\teventPosition = helpers.getRelativePosition(e),\n
\t\t\t\tdatasetIterator = function(dataset){\n
\t\t\t\t\tbarsArray.push(dataset.bars[barIndex]);\n
\t\t\t\t},\n
\t\t\t\tbarIndex;\n
\n
\t\t\tfor (var datasetIndex = 0; datasetIndex < this.datasets.length; datasetIndex++) {\n
\t\t\t\tfor (barIndex = 0; barIndex < this.datasets[datasetIndex].bars.length; barIndex++) {\n
\t\t\t\t\tif (this.datasets[datasetIndex].bars[barIndex].inRange(eventPosition.x,eventPosition.y)){\n
\t\t\t\t\t\thelpers.each(this.datasets, datasetIterator);\n
\t\t\t\t\t\treturn barsArray;\n
\t\t\t\t\t}\n
\t\t\t\t}\n
\t\t\t}\n
\n
\t\t\treturn barsArray;\n
\t\t},\n
\t\tbuildScale : function(labels){\n
\t\t\tvar self = this;\n
\n
\t\t\tvar dataTotal = function(){\n
\t\t\t\tvar values = [];\n
\t\t\t\tself.eachBars(function(bar){\n
\t\t\t\t\tvalues.push(bar.value);\n
\t\t\t\t});\n
\t\t\t\treturn values;\n
\t\t\t};\n
\n
\t\t\tvar scaleOptions = {\n
\t\t\t\ttemplateString : this.options.scaleLabel,\n
\t\t\t\theight : this.chart.height,\n
\t\t\t\twidth : this.chart.width,\n
\t\t\t\tctx : this.chart.ctx,\n
\t\t\t\ttextColor : this.options.scaleFontColor,\n
\t\t\t\tfontSize : this.options.scaleFontSize,\n
\t\t\t\tfontStyle : this.options.scaleFontStyle,\n
\t\t\t\tfontFamily : this.options.scaleFontFamily,\n
\t\t\t\tvaluesCount : labels.length,\n
\t\t\t\tbeginAtZero : this.options.scaleBeginAtZero,\n
\t\t\t\tintegersOnly : this.options.scaleIntegersOnly,\n
\t\t\t\tcalculateYRange: function(currentHeight){\n
\t\t\t\t\tvar updatedRanges = helpers.calculateScaleRange(\n
\t\t\t\t\t\tdataTotal(),\n
\t\t\t\t\t\tcurrentHeight,\n
\t\t\t\t\t\tthis.fontSize,\n
\t\t\t\t\t\tthis.beginAtZero,\n
\t\t\t\t\t\tthis.integersOnly\n
\t\t\t\t\t);\n
\t\t\t\t\thelpers.extend(this, updatedRanges);\n
\t\t\t\t},\n
\t\t\t\txLabels : labels,\n
\t\t\t\tfont : helpers.fontString(this.options.scaleFontSize, this.options.scaleFontStyle, this.options.scaleFontFamily),\n
\t\t\t\tlineWidth : this.options.scaleLineWidth,\n
\t\t\t\tlineColor : this.options.scaleLineColor,\n
\t\t\t\tshowHorizontalLines : this.options.scaleShowHorizontalLines,\n
\t\t\t\tshowVerticalLines : this.options.scaleShowVerticalLines,\n
\t\t\t\tgridLineWidth : (this.options.scaleShowGridLines) ? this.options.scaleGridLineWidth : 0,\n
\t\t\t\tgridLineColor : (this.options.scaleShowGridLines) ? this.options.scaleGridLineColor : "rgba(0,0,0,0)",\n
\t\t\t\tpadding : (this.options.showScale) ? 0 : (this.options.barShowStroke) ? this.options.barStrokeWidth : 0,\n
\t\t\t\tshowLabels : this.options.scaleShowLabels,\n
\t\t\t\tdisplay : this.options.showScale\n
\t\t\t};\n
\n
\t\t\tif (this.options.scaleOverride){\n
\t\t\t\thelpers.extend(scaleOptions, {\n
\t\t\t\t\tcalculateYRange: helpers.noop,\n
\t\t\t\t\tsteps: this.options.scaleSteps,\n
\t\t\t\t\tstepValue: this.options.scaleStepWidth,\n
\t\t\t\t\tmin: this.options.scaleStartValue,\n
\t\t\t\t\tmax: this.options.scaleStartValue + (this.options.scaleSteps * this.options.scaleStepWidth)\n
\t\t\t\t});\n
\t\t\t}\n
\n
\t\t\tthis.scale = new this.ScaleClass(scaleOptions);\n
\t\t},\n
\t\taddData : function(valuesArray,label){\n
\t\t\t//Map the values array for each of the datasets\n
\t\t\thelpers.each(valuesArray,function(value,datasetIndex){\n
\t\t\t\t//Add a new point for each piece of data, passing any required data to draw.\n
\t\t\t\tthis.datasets[datasetIndex].bars.push(new this.BarClass({\n
\t\t\t\t\tvalue : value,\n
\t\t\t\t\tlabel : label,\n
\t\t\t\t\tdatasetLabel: this.datasets[datasetIndex].label,\n
\t\t\t\t\tx: this.scale.calculateBarX(this.datasets.length, datasetIndex, this.scale.valuesCount+1),\n
\t\t\t\t\ty: this.scale.endPoint,\n
\t\t\t\t\twidth : this.scale.calculateBarWidth(this.datasets.length),\n
\t\t\t\t\tbase : this.scale.endPoint,\n
\t\t\t\t\tstrokeColor : this.datasets[datasetIndex].strokeColor,\n
\t\t\t\t\tfillColor : this.datasets[datasetIndex].fillColor\n
\t\t\t\t}));\n
\t\t\t},this);\n
\n
\t\t\tthis.scale.addXLabel(label);\n
\t\t\t//Then re-render the chart.\n
\t\t\tthis.update();\n
\t\t},\n
\t\tremoveData : function(){\n
\t\t\tthis.scale.removeXLabel();\n
\t\t\t//Then re-render the chart.\n
\t\t\thelpers.each(this.datasets,function(dataset){\n
\t\t\t\tdataset.bars.shift();\n
\t\t\t},this);\n
\t\t\tthis.update();\n
\t\t},\n
\t\treflow : function(){\n
\t\t\thelpers.extend(this.BarClass.prototype,{\n
\t\t\t\ty: this.scale.endPoint,\n
\t\t\t\tbase : this.scale.endPoint\n
\t\t\t});\n
\t\t\tvar newScaleProps = helpers.extend({\n
\t\t\t\theight : this.chart.height,\n
\t\t\t\twidth : this.chart.width\n
\t\t\t});\n
\t\t\tthis.scale.update(newScaleProps);\n
\t\t},\n
\t\tdraw : function(ease){\n
\t\t\tvar easingDecimal = ease || 1;\n
\t\t\tthis.clear();\n
\n
\t\t\tvar ctx = this.chart.ctx;\n
\n
\t\t\tthis.scale.draw(easingDecimal);\n
\n
\t\t\t//Draw all the bars for each dataset\n
\t\t\thelpers.each(this.datasets,function(dataset,datasetIndex){\n
\t\t\t\thelpers.each(dataset.bars,function(bar,index){\n
\t\t\t\t\tif (bar.hasValue()){\n
\t\t\t\t\t\tbar.base = this.scale.endPoint;\n
\t\t\t\t\t\t//Transition then draw\n
\t\t\t\t\t\tbar.transition({\n
\t\t\t\t\t\t\tx : this.scale.calculateBarX(this.datasets.length, datasetIndex, index),\n
\t\t\t\t\t\t\ty : this.scale.calculateY(bar.value),\n
\t\t\t\t\t\t\twidth : this.scale.calculateBarWidth(this.datasets.length)\n
\t\t\t\t\t\t}, easingDecimal).draw();\n
\t\t\t\t\t}\n
\t\t\t\t},this);\n
\n
\t\t\t},this);\n
\t\t}\n
\t});\n
\n
\n
}).call(this);\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>9743</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Chart.Bar.js</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41271282.53</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Chart.Core.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>69614</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Chart.Core.js</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Pdata" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
/*!\n
* Chart.js\n
* http://chartjs.org/\n
* Version: {{ version }}\n
*\n
* Copyright 2015 Nick Downie\n
* Released under the MIT license\n
* https://github.com/nnnick/Chart.js/blob/master/LICENSE.md\n
*/\n
\n
\n
(function(){\n
\n
\t"use strict";\n
\n
\t//Declare root variable - window in the browser, global on the server\n
\tvar root = this,\n
\t\tprevious = root.Chart;\n
\n
\t//Occupy the global variable of Chart, and create a simple base class\n
\tvar Chart = function(context){\n
\t\tvar chart = this;\n
\t\tthis.canvas = context.canvas;\n
\n
\t\tthis.ctx = context;\n
\n
\t\t//Variables global to the chart\n
\t\tvar computeDimension = function(element,dimension)\n
\t\t{\n
\t\t\tif (element[\'offset\'+dimension])\n
\t\t\t{\n
\t\t\t\treturn element[\'offset\'+dimension];\n
\t\t\t}\n
\t\t\telse\n
\t\t\t{\n
\t\t\t\treturn document.defaultView.getComputedStyle(element).getPropertyValue(dimension);\n
\t\t\t}\n
\t\t};\n
\n
\t\tvar width = this.width = computeDimension(context.canvas,\'Width\') || context.canvas.width;\n
\t\tvar height = this.height = computeDimension(context.canvas,\'Height\') || context.canvas.height;\n
\n
\t\t// Firefox requires this to work correctly\n
\t\tcontext.canvas.width = width;\n
\t\tcontext.canvas.height = height;\n
\n
\t\twidth = this.width = context.canvas.width;\n
\t\theight = this.height = context.canvas.height;\n
\t\tthis.aspectRatio = this.width / this.height;\n
\t\t//High pixel density displays - multiply the size of the canvas height/width by the device pixel ratio, then scale.\n
\t\thelpers.retinaScale(this);\n
\n
\t\treturn this;\n
\t};\n
\t//Globally expose the defaults to allow for user updating/changing\n
\tChart.defaults = {\n
\t\tglobal: {\n
\t\t\t// Boolean - Whether to animate the chart\n
\t\t\tanimation: true,\n
\n
\t\t\t// Number - Number of animation steps\n
\t\t\tanimationSteps: 60,\n
\n
\t\t\t// String - Animation easing effect\n
\t\t\tanimationEasing: "easeOutQuart",\n
\n
\t\t\t// Boolean - If we should show the scale at all\n
\t\t\tshowScale: true,\n
\n
\t\t\t// Boolean - If we want to override with a hard coded scale\n
\t\t\tscaleOverride: false,\n
\n
\t\t\t// ** Required if scaleOverride is true **\n
\t\t\t// Number - The number of steps in a hard coded scale\n
\t\t\tscaleSteps: null,\n
\t\t\t// Number - The value jump in the hard coded scale\n
\t\t\tscaleStepWidth: null,\n
\t\t\t// Number - The scale starting value\n
\t\t\tscaleStartValue: null,\n
\n
\t\t\t// String - Colour of the scale line\n
\t\t\tscaleLineColor: "rgba(0,0,0,.1)",\n
\n
\t\t\t// Number - Pixel width of the scale line\n
\t\t\tscaleLineWidth: 1,\n
\n
\t\t\t// Boolean - Whether to show labels on the scale\n
\t\t\tscaleShowLabels: true,\n
\n
\t\t\t// Interpolated JS string - can access value\n
\t\t\tscaleLabel: "<%=value%>",\n
\n
\t\t\t// Boolean - Whether the scale should stick to integers, and not show any floats even if drawing space is there\n
\t\t\tscaleIntegersOnly: true,\n
\n
\t\t\t// Boolean - Whether the scale should start at zero, or an order of magnitude down from the lowest value\n
\t\t\tscaleBeginAtZero: false,\n
\n
\t\t\t// String - Scale label font declaration for the scale label\n
\t\t\tscaleFontFamily: "\'Helvetica Neue\', \'Helvetica\', \'Arial\', sans-serif",\n
\n
\t\t\t// Number - Scale label font size in pixels\n
\t\t\tscaleFontSize: 12,\n
\n
\t\t\t// String - Scale label font weight style\n
\t\t\tscaleFontStyle: "normal",\n
\n
\t\t\t// String - Scale label font colour\n
\t\t\tscaleFontColor: "#666",\n
\n
\t\t\t// Boolean - whether or not the chart should be responsive and resize when the browser does.\n
\t\t\tresponsive: false,\n
\n
\t\t\t// Boolean - whether to maintain the starting aspect ratio or not when responsive, if set to false, will take up entire container\n
\t\t\tmaintainAspectRatio: true,\n
\n
\t\t\t// Boolean - Determines whether to draw tooltips on the canvas or not - attaches events to touchmove & mousemove\n
\t\t\tshowTooltips: true,\n
\n
\t\t\t// Boolean - Determines whether to draw built-in tooltip or call custom tooltip function\n
\t\t\tcustomTooltips: false,\n
\n
\t\t\t// Array - Array of string names to attach tooltip events\n
\t\t\ttooltipEvents: ["mousemove", "touchstart", "touchmove", "mouseout"],\n
\n
\t\t\t// String - Tooltip background colour\n
\t\t\ttooltipFillColor: "rgba(0,0,0,0.8)",\n
\n
\t\t\t// String - Tooltip label font declaration for the scale label\n
\t\t\ttooltipFontFamily: "\'Helvetica Neue\', \'Helvetica\', \'Arial\', sans-serif",\n
\n
\t\t\t// Number - Tooltip label font size in pixels\n
\t\t\ttooltipFontSize: 14,\n
\n
\t\t\t// String - Tooltip font weight style\n
\t\t\ttooltipFontStyle: "normal",\n
\n
\t\t\t// String - Tooltip label font colour\n
\t\t\ttooltipFontColor: "#fff",\n
\n
\t\t\t// String - Tooltip title font declaration for the scale label\n
\t\t\ttooltipTitleFontFamily: "\'Helvetica Neue\', \'Helvetica\', \'Arial\', sans-serif",\n
\n
\t\t\t// Number - Tooltip title font size in pixels\n
\t\t\ttooltipTitleFontSize: 14,\n
\n
\t\t\t// String - Tooltip title font weight style\n
\t\t\ttooltipTitleFontStyle: "bold",\n
\n
\t\t\t// String - Tooltip title font colour\n
\t\t\ttooltipTitleFontColor: "#fff",\n
\n
\t\t\t// String - Tooltip title template\n
\t\t\ttooltipTitleTemplate: "<%= label%>",\n
\n
\t\t\t// Number - pixel width of padding around tooltip text\n
\t\t\ttooltipYPadding: 6,\n
\n
\t\t\t// Number - pixel width of padding around tooltip text\n
\t\t\ttooltipXPadding: 6,\n
\n
\t\t\t// Number - Size of the caret on the tooltip\n
\t\t\ttooltipCaretSize: 8,\n
\n
\t\t\t// Number - Pixel radius of the tooltip border\n
\t\t\ttooltipCornerRadius: 6,\n
\n
\t\t\t// Number - Pixel offset from point x to tooltip edge\n
\t\t\ttooltipXOffset: 10,\n
\n
\t\t\t// String - Template string for single tooltips\n
\t\t\ttooltipTemplate: "<%if (label){%><%=label%>: <%}%><%= value %>",\n
\n
\t\t\t// String - Template string for single tooltips\n
\t\t\tmultiTooltipTemplate: "<%= value %>",\n
\n
\t\t\t// String - Colour behind the legend colour block\n
\t\t\tmultiTooltipKeyBackground: \'#fff\',\n
\n
\t\t\t// Function - Will fire on animation progression.\n
\t\t\tonAnimationProgress: function(){},\n
\n
\t\t\t// Function - Will fire on animation completion.\n
\t\t\tonAnimationComplete: function(){}\n
\n
\t\t}\n
\t};\n
\n
\t//Create a dictionary of chart types, to allow for extension of existing types\n
\tChart.types = {};\n
\n
\t//Global Chart helpers object for utility methods and classes\n
\tvar helpers = Chart.helpers = {};\n
\n
\t\t//-- Basic js utility methods\n
\tvar each = helpers.each = function(loopable,callback,self){\n
\t\t\tvar additionalArgs = Array.prototype.slice.call(arguments, 3);\n
\t\t\t// Check to see if null or undefined firstly.\n
\t\t\tif (loopable){\n
\t\t\t\tif (loopable.length === +loopable.length){\n
\t\t\t\t\tvar i;\n
\t\t\t\t\tfor (i=0; i<loopable.length; i++){\n
\t\t\t\t\t\tcallback.apply(self,[loopable[i], i].concat(additionalArgs));\n
\t\t\t\t\t}\n
\t\t\t\t}\n
\t\t\t\telse{\n
\t\t\t\t\tfor (var item in loopable){\n
\t\t\t\t\t\tcallback.apply(self,[loopable[item],item].concat(additionalArgs));\n
\t\t\t\t\t}\n
\t\t\t\t}\n
\t\t\t}\n
\t\t},\n
\t\tclone = helpers.clone = function(obj){\n
\t\t\tvar objClone = {};\n
\t\t\teach(obj,function(value,key){\n
\t\t\t\tif (obj.hasOwnProperty(key)){\n
\t\t\t\t\tobjClone[key] = value;\n
\t\t\t\t}\n
\t\t\t});\n
\t\t\treturn objClone;\n
\t\t},\n
\t\textend = helpers.extend = function(base){\n
\t\t\teach(Array.prototype.slice.call(arguments,1), function(extensionObject) {\n
\t\t\t\teach(extensionObject,function(value,key){\n
\t\t\t\t\tif (extensionObject.hasOwnProperty(key)){\n
\t\t\t\t\t\tbase[key] = value;\n
\t\t\t\t\t}\n
\t\t\t\t});\n
\t\t\t});\n
\t\t\treturn base;\n
\t\t},\n
\t\tmerge = helpers.merge = function(base,master){\n
\t\t\t//Merge properties in left object over to a shallow clone of object right.\n
\t\t\tvar args = Array.prototype.slice.call(arguments,0);\n
\t\t\targs.unshift({});\n
\t\t\treturn extend.apply(null, args);\n
\t\t},\n
\t\tindexOf = helpers.indexOf = function(arrayToSearch, item){\n
\t\t\tif (Array.prototype.indexOf) {\n
\t\t\t\treturn arrayToSearch.indexOf(item);\n
\t\t\t}\n
\t\t\telse{\n
\t\t\t\tfor (var i = 0; i < arrayToSearch.length; i++) {\n
\t\t\t\t\tif (arrayToSearch[i] === item) return i;\n
\t\t\t\t}\n
\t\t\t\treturn -1;\n
\t\t\t}\n
\t\t},\n
\t\twhere = helpers.where = function(collection, filterCallback){\n
\t\t\tvar filtered = [];\n
\n
\t\t\thelpers.each(collection, function(item){\n
\t\t\t\tif (filterCallback(item)){\n
\t\t\t\t\tfiltered.push(item);\n
\t\t\t\t}\n
\t\t\t});\n
\n
\t\t\treturn filtered;\n
\t\t},\n
\t\tfindNextWhere = helpers.findNextWhere = function(arrayToSearch, filterCallback, startIndex){\n
\t\t\t// Default to start of the array\n
\t\t\tif (!startIndex){\n
\t\t\t\tstartIndex = -1;\n
\t\t\t}\n
\t\t\tfor (var i = startIndex + 1; i < arrayToSearch.length; i++) {\n
\t\t\t\tvar currentItem = arrayToSearch[i];\n
\t\t\t\tif (filterCallback(currentItem)){\n
\t\t\t\t\treturn currentItem;\n
\t\t\t\t}\n
\t\t\t}\n
\t\t},\n
\t\tfindPreviousWhere = helpers.findPreviousWhere = function(arrayToSearch, filterCallback, startIndex){\n
\t\t\t// Default to end of the array\n
\t\t\tif (!startIndex){\n
\t\t\t\tstartIndex = arrayToSearch.length;\n
\t\t\t}\n
\t\t\tfor (var i = startIndex - 1; i >= 0; i--) {\n
\t\t\t\tvar currentItem = arrayToSearch[i];\n
\t\t\t\tif (filterCallback(currentItem)){\n
\t\t\t\t\treturn currentItem;\n
\t\t\t\t}\n
\t\t\t}\n
\t\t},\n
\t\tinherits = helpers.inherits = function(extensions){\n
\t\t\t//Basic javascript inheritance based on the model created in Backbone.js\n
\t\t\tvar parent = this;\n
\t\t\tvar ChartElement = (extensions && extensions.hasOwnProperty("constructor")) ? extensions.constructor : function(){ return parent.apply(this, arguments); };\n
\n
\t\t\tvar Surrogate = function(){ this.constructor = ChartElement;};\n
\t\t\tSurrogate.prototype = parent.prototype;\n
\t\t\tChartElement.prototype = new Surrogate();\n
\n
\t\t\tChartElement.extend = inherits;\n
\n
\t\t\tif (extensions) extend(ChartElement.prototype, extensions);\n
\n
\t\t\tChartElement.__super__ = parent.prototype;\n
\n
\t\t\treturn ChartElement;\n
\t\t},\n
\t\tnoop = helpers.noop = function(){},\n
\t\tuid = helpers.uid = (function(){\n
\t\t\tvar id=0;\n
\t\t\treturn function(){\n
\t\t\t\treturn "chart-" + id++;\n
\t\t\t};\n
\t\t})(),\n
\t\twarn = helpers.warn = function(str){\n
\t\t\t//Method for warning of errors\n
\t\t\tif (window.console && typeof window.console.warn === "function") console.warn(str);\n
\t\t},\n
\t\tamd = helpers.amd = (typeof define === \'function\' && define.amd),\n
\t\t//-- Math methods\n
\t\tisNumber = helpers.isNumber = function(n){\n
\t\t\treturn !isNaN(parseFloat(n)) && isFinite(n);\n
\t\t},\n
\t\tmax = helpers.max = function(array){\n
\t\t\treturn Math.max.apply( Math, array );\n
\t\t},\n
\t\tmin = helpers.min = function(array){\n
\t\t\treturn Math.min.apply( Math, array );\n
\t\t},\n
\t\tcap = helpers.cap = function(valueToCap,maxValue,minValue){\n
\t\t\tif(isNumber(maxValue)) {\n
\t\t\t\tif( valueToCap > maxValue ) {\n
\t\t\t\t\treturn maxValue;\n
\t\t\t\t}\n
\t\t\t}\n
\t\t\telse if(isNumber(minValue)){\n
\t\t\t\tif ( valueToCap < minValue ){\n
\t\t\t\t\treturn minValue;\n
\t\t\t\t}\n
\t\t\t}\n
\t\t\treturn valueToCap;\n
\t\t},\n
\t\tgetDecimalPlaces = helpers.getDecimalPlaces = function(num){\n
\t\t\tif (num%1!==0 && isNumber(num)){\n
\t\t\t\tvar s = num.toString();\n
\t\t\t\tif(s.indexOf("e-") < 0){\n
\t\t\t\t\t// no exponent, e.g. 0.01\n
\t\t\t\t\treturn s.split(".")[1].length;\n
\t\t\t\t}\n
\t\t\t\telse if(s.indexOf(".") < 0) {\n
\t\t\t\t\t// no decimal point, e.g. 1e-9\n
\t\t\t\t\treturn parseInt(s.split("e-")[1]);\n
\t\t\t\t}\n
\t\t\t\telse {\n
\t\t\t\t\t// exponent and decimal point, e.g. 1.23e-9\n
\t\t\t\t\tvar parts = s.split(".")[1].split("e-");\n
\t\t\t\t\treturn parts[0].length + parseInt(parts[1]);\n
\t\t\t\t}\n
\t\t\t}\n
\t\t\telse {\n
\t\t\t\treturn 0;\n
\t\t\t}\n
\t\t},\n
\t\ttoRadians = helpers.radians = function(degrees){\n
\t\t\treturn degrees * (Math.PI/180);\n
\t\t},\n
\t\t// Gets the angle from vertical upright to the point about a centre.\n
\t\tgetAngleFromPoint = helpers.getAngleFromPoint = function(centrePoint, anglePoint){\n
\t\t\tvar distanceFromXCenter = anglePoint.x - centrePoint.x,\n
\t\t\t\tdistanceFromYCenter = anglePoint.y - centrePoint.y,\n
\t\t\t\tradialDistanceFromCenter = Math.sqrt( distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);\n
\n
\n
\t\t\tvar angle = Math.PI * 2 + Math.atan2(distanceFromYCenter, distanceFromXCenter);\n
\n
\t\t\t//If the segment is in the top left quadrant, we need to add another rotation to the angle\n
\t\t\tif (distanceFromXCenter < 0 && distanceFromYCenter < 0){\n
\t\t\t\tangle += Math.PI*2;\n
\t\t\t}\n
\n
\t\t\treturn {\n
\t\t\t\tangle: angle,\n
\t\t\t\tdistance: radialDistanceFromCenter\n
\t\t\t};\n
\t\t},\n
\t\taliasPixel = helpers.aliasPixel = function(pixelWidth){\n
\t\t\treturn (pixelWidth % 2 === 0) ? 0 : 0.5;\n
\t\t},\n
\t\tsplineCurve = helpers.splineCurve = function(FirstPoint,MiddlePoint,AfterPoint,t){\n
\t\t\t//Props to Rob Spencer at scaled innovation for his post on splining between points\n
\t\t\t//http://scaledinnovation.com/analytics/splines/aboutSplines.html\n
\t\t\tvar d01=Math.sqrt(Math.pow(MiddlePoint.x-FirstPoint.x,2)+Math.pow(MiddlePoint.y-FirstPoint.y,2)),\n
\t\t\t\td12=Math.sqrt(Math.pow(AfterPoint.x-MiddlePoint.x,2)+Math.pow(AfterPoint.y-MiddlePoint.y,2)),\n
\t\t\t\tfa=t*d01/(d01+d12),// scaling factor for triangle Ta\n
\t\t\t\tfb=t*d12/(d01+d12);\n
\t\t\treturn {\n
\t\t\t\tinner : {\n
\t\t\t\t\tx : MiddlePoint.x-fa*(AfterPoint.x-FirstPoint.x),\n
\t\t\t\t\ty : MiddlePoint.y-fa*(AfterPoint.y-FirstPoint.y)\n
\t\t\t\t},\n
\t\t\t\touter : {\n
\t\t\t\t\tx: MiddlePoint.x+fb*(AfterPoint.x-FirstPoint.x),\n
\t\t\t\t\ty : MiddlePoint.y+fb*(AfterPoint.y-FirstPoint.y)\n
\t\t\t\t}\n
\t\t\t};\n
\t\t},\n
\t\tcalculateOrderOfMagnitude = helpers.calculateOrderOfMagnitude = function(val){\n
\t\t\treturn Math.floor(Math.log(val) / Math.LN10);\n
\t\t},\n
\t\tcalculateScaleRange = helpers.calculateScaleRange = function(valuesArray, drawingSize, textSize, startFromZero, integersOnly){\n
\n
\t\t\t//Set a minimum step of two - a point at the top of the graph, and a point at the base\n
\t\t\tvar minSteps = 2,\n
\t\t\t\tmaxSteps = Math.floor(drawingSize/(textSize * 1.5)),\n
\t\t\t\tskipFitting = (minSteps >= maxSteps);\n
\n
\t\t\tvar maxValue = max(valuesArray),\n
\t\t\t\tminValue = min(valuesArray);\n
\n
\t\t\t// We need some degree of separation here to calculate the scales if all the values are the same\n
\t\t\t// Adding/minusing 0.5 will give us a range of 1.\n
\t\t\tif (maxValue === minValue){\n
\t\t\t\tmaxValue += 0.5;\n
\t\t\t\t// So we don\'t end up with a graph with a negative start value if we\'ve said always start from zero\n
\t\t\t\tif (minValue >= 0.5 && !startFromZero){\n
\t\t\t\t\tminValue -= 0.5;\n
\t\t\t\t}\n
\t\t\t\telse{\n
\t\t\t\t\t// Make up a whole number above the values\n
\t\t\t\t\tmaxValue += 0.5;\n
\t\t\t\t}\n
\t\t\t}\n
\n
\t\t\tvar\tvalueRange = Math.abs(maxValue - minValue),\n
\t\t\t\trangeOrderOfMagnitude = calculateOrderOfMagnitude(valueRange),\n
\t\t\t\tgraphMax = Math.ceil(maxValue / (1 * Math.pow(10, rangeOrderOfMagnitude))) * Math.pow(10, rangeOrderOfMagnitude),\n
\t\t\t\tgraphMin = (startFromZero) ? 0 : Math.floor(minValue / (1 * Math.pow(10, rangeOrderOfMagnitude))) * Math.pow(10, rangeOrderOfMagnitude),\n
\t\t\t\tgraphRange = graphMax - graphMin,\n
\t\t\t\tstepValue = Math.pow(10, rangeOrderOfMagnitude),\n
\t\t\t\tnumberOfSteps = Math.round(graphRange / stepValue);\n
\n
\t\t\t//If we have more space on the graph we\'ll use it to give more definition to the data\n
\t\t\twhile((numberOfSteps > maxSteps || (numberOfSteps * 2) < maxSteps) && !skipFitting) {\n
\t\t\t\tif(numberOfSteps > maxSteps){\n
\t\t\t\t\tstepValue *=2;\n
\t\t\t\t\tnumberOfSteps = Math.round(graphRange/stepValue);\n
\t\t\t\t\t// Don\'t ever deal with a decimal number of steps - cancel fitting and just use the minimum number of steps.\n
\t\t\t\t\tif (numberOfSteps % 1 !== 0){\n
\t\t\t\t\t\tskipFitting = true;\n
\t\t\t\t\t}\n
\t\t\t\t}\n
\t\t\t\t//We can fit in double the amount of scale points on the scale\n
\t\t\t\telse{\n
\t\t\t\t\t//If user has declared ints only, and the step value isn\'t a decimal\n
\t\t\t\t\tif (integersOnly && rangeOrderOfMagnitude >= 0){\n
\t\t\t\t\t\t//If the user has said integers only, we need to check that making the scale more granular wouldn\'t make it a float\n
\t\t\t\t\t\tif(stepValue/2 % 1 === 0){\n
\t\t\t\t\t\t\tstepValue /=2;\n
\t\t\t\t\t\t\tnumberOfSteps = Math.round(graphRange/stepValue);\n
\t\t\t\t\t\t}\n
\t\t\t\t\t\t//If it would make it a float break out of the loop\n
\t\t\t\t\t\telse{\n
\t\t\t\t\t\t\tbreak;\n
\t\t\t\t\t\t}\n
\t\t\t\t\t}\n
\t\t\t\t\t//If the scale doesn\'t have to be an int, make the scale more granular anyway.\n
\t\t\t\t\telse{\n
\t\t\t\t\t\tstepValue /=2;\n
\t\t\t\t\t\tnumberOfSteps = Math.round(graphRange/stepValue);\n
\t\t\t\t\t}\n
\n
\t\t\t\t}\n
\t\t\t}\n
\n
\t\t\tif (skipFitting){\n
\t\t\t\tnumberOfSteps = minSteps;\n
\t\t\t\tstepValue = graphRange / numberOfSteps;\n
\t\t\t}\n
\n
\t\t\treturn {\n
\t\t\t\tsteps : numberOfSteps,\n
\t\t\t\tstepValue : stepValue,\n
\t\t\t\tmin : graphMin,\n
\t\t\t\tmax\t: graphMin + (numberOfSteps * stepValue)\n
\t\t\t};\n
\n
\t\t},\n
\t\t/* jshint ignore:start */\n
\t\t// Blows up jshint errors based on the new Function constructor\n
\t\t//Templating methods\n
\t\t//Javascript micro templating by John Resig - source at http://ejohn.org/blog/javascript-micro-templating/\n
\t\ttemplate = helpers.template = function(templateString, valuesObject){\n
\n
\t\t\t// If templateString is function rather than string-template - call the function for valuesObject\n
\n
\t\t\tif(templateString instanceof Function){\n
\t\t\t \treturn templateString(valuesObject);\n
\t\t \t}\n
\n
\t\t\tvar cache = {};\n
\t\t\tfunction tmpl(str, data){\n
\t\t\t\t// Figure out if we\'re getting a template, or if we need to\n
\t\t\t\t// load the template - and be sure to cache the result.\n
\t\t\t\tvar fn = !/\\W/.test(str) ?\n
\t\t\t\tcache[str] = cache[str] :\n
\n
\t\t\t\t// Generate a reusable function that will serve as a template\n
\t\t\t\t// generator (and which will be cached).\n
\t\t\t\tnew Function("obj",\n
\t\t\t\t\t"var p=[],print=function(){p.push.apply(p,arguments);};" +\n
\n
\t\t\t\t\t// Introduce the data as local variables using with(){}\n
\t\t\t\t\t"with(obj){p.push(\'" +\n
\n
\t\t\t\t\t// Convert the template into pure JavaScript\n
\t\t\t\t\tstr\n
\t\t\t\t\t\t.replace(/[\\r\\t\\n]/g, " ")\n
\t\t\t\t\t\t.split("<%").join("\\t")\n
\t\t\t\t\t\t.replace(/((^|%>)[^\\t]*)\'/g, "$1\\r")\n
\t\t\t\t\t\t.replace(/\\t=(.*?)%>/g, "\',$1,\'")\n
\t\t\t\t\t\t.split("\\t").join("\');")\n
\t\t\t\t\t\t.split("%>").join("p.push(\'")\n
\t\t\t\t\t\t.split("\\r").join("\\\\\'") +\n
\t\t\t\t\t"\');}return p.join(\'\');"\n
\t\t\t\t);\n
\n
\t\t\t\t// Provide some basic currying to the user\n
\t\t\t\treturn data ? fn( data ) : fn;\n
\t\t\t}\n
\t\t\treturn tmpl(templateString,valuesObject);\n
\t\t},\n
\t\t/* jshint ignore:end */\n
\t\tgenerateLabels = helpers.generateLabels = function(templateString,numberOfSteps,graphMin,stepValue){\n
\t\t\tvar labelsArray = new Array(numberOfSteps);\n
\t\t\tif (templateString){\n
\t\t\t\teach(labelsArray,function(val,index){\n
\t\t\t\t\tlabelsArray[index] = template(templateString,{value: (graphMin + (stepValue*(index+1)))});\n
\t\t\t\t});\n
\t\t\t}\n
\t\t\treturn labelsArray;\n
\t\t},\n
\t\t//--Animation methods\n
\t\t//Easing functions adapted from Robert Penner\'s easing equations\n
\t\t//http://www.robertpenner.com/easing/\n
\t\teasingEffects = helpers.easingEffects = {\n
\t\t\tlinear: function (t) {\n
\t\t\t\treturn t;\n
\t\t\t},\n
\t\t\teaseInQuad: function (t) {\n
\t\t\t\treturn t * t;\n
\t\t\t},\n
\t\t\teaseOutQuad: function (t) {\n
\t\t\t\treturn -1 * t * (t - 2);\n
\t\t\t},\n
\t\t\teaseInOutQuad: function (t) {\n
\t\t\t\tif ((t /= 1 / 2) < 1){\n
\t\t\t\t\treturn 1 / 2 * t * t;\n
\t\t\t\t}\n
\t\t\t\treturn -1 / 2 * ((--t) * (t - 2) - 1);\n
\t\t\t},\n
\t\t\teaseInCubic: function (t) {\n
\t\t\t\treturn t * t * t;\n
\t\t\t},\n
\t\t\teaseOutCubic: function (t) {\n
\t\t\t\treturn 1 * ((t = t / 1 - 1) * t * t + 1);\n
\t\t\t},\n
\t\t\teaseInOutCubic: function (t) {\n
\t\t\t\tif ((t /= 1 / 2) < 1){\n
\t\t\t\t\treturn 1 / 2 * t * t * t;\n
\t\t\t\t}\n
\t\t\t\treturn 1 / 2 * ((t -= 2) * t * t + 2);\n
\t\t\t},\n
\t\t\teaseInQuart: function (t) {\n
\t\t\t\treturn t * t * t * t;\n
\t\t\t},\n
\t\t\teaseOutQuart: function (t) {\n
\t\t\t\treturn -1 * ((t = t / 1 - 1) * t * t * t - 1);\n
\t\t\t},\n
\t\t\teaseInOutQuart: function (t) {\n
\t\t\t\tif ((t /= 1 / 2) < 1){\n
\t\t\t\t\treturn 1 / 2 * t * t * t * t;\n
\t\t\t\t}\n
\t\t\t\treturn -1 / 2 * ((t -= 2) * t * t * t - 2);\n
\t\t\t},\n
\t\t\teaseInQuint: function (t) {\n
\t\t\t\treturn 1 * (t /= 1) * t * t * t * t;\n
\t\t\t},\n
\t\t\teaseOutQuint: function (t) {\n
\t\t\t\treturn 1 * ((t = t / 1 - 1) * t * t * t * t + 1);\n
\t\t\t},\n
\t\t\teaseInOutQuint: function (t) {\n
\t\t\t\tif ((t /= 1 / 2) < 1){\n
\t\t\t\t\treturn 1 / 2 * t * t * t * t * t;\n
\t\t\t\t}\n
\t\t\t\treturn 1 / 2 * ((t -= 2) * t * t * t * t + 2);\n
\t\t\t},\n
\t\t\teaseInSine: function (t) {\n
\t\t\t\treturn -1 * Math.cos(t / 1 * (Math.PI / 2)) + 1;\n
\t\t\t},\n
\t\t\teaseOutSine: function (t) {\n
\t\t\t\treturn 1 * Math.sin(t / 1 * (Math.PI / 2));\n
\t\t\t},\n
\t\t\teaseInOutSine: function (t) {\n
\t\t\t\treturn -1 / 2 * (Math.cos(Math.PI * t / 1) - 1);\n
\t\t\t},\n
\t\t\teaseInExpo: function (t) {\n
\t\t\t\treturn (t === 0) ? 1 : 1 * Math.pow(2, 10 * (t / 1 - 1));\n
\t\t\t},\n
\t\t\teaseOutExpo: function (t) {\n
\t\t\t\treturn (t === 1) ? 1 : 1 * (-Math.pow(2, -10 * t / 1) + 1);\n
\t\t\t},\n
\t\t\teaseInOutExpo: function (t) {\n
\t\t\t\tif (t === 0){\n
\t\t\t\t\treturn 0;\n
\t\t\t\t}\n
\t\t\t\tif (t === 1){\n
\t\t\t\t\treturn 1;\n
\t\t\t\t}\n
\t\t\t\tif ((t /= 1 / 2) < 1){\n
\t\t\t\t\treturn 1 / 2 * Math.pow(2, 10 * (t - 1));\n
\t\t\t\t}\n
\t\t\t\treturn 1 / 2 * (-Math.pow(2, -10 * --t) + 2);\n
\t\t\t},\n
\t\t\teaseInCirc: function (t) {\n
\t\t\t\tif (t >= 1){\n
\t\t\t\t\treturn t;\n
\t\t\t\t}\n
\t\t\t\treturn -1 * (Math.sqrt(1 - (t /= 1) * t) - 1);\n
\t\t\t},\n
\t\t\teaseOutCirc: function (t) {\n
\t\t\t\treturn 1 * Math.sqrt(1 - (t = t / 1 - 1) * t);\n
\t\t\t},\n
\t\t\teaseInOutCirc: function (t) {\n
\t\t\t\tif ((t /= 1 / 2) < 1){\n
\t\t\t\t\treturn -1 / 2 * (Math.sqrt(1 - t * t) - 1);\n
\t\t\t\t}\n
\t\t\t\treturn 1 / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1);\n
\t\t\t},\n
\t\t\teaseInElastic: function (t) {\n
\t\t\t\tvar s = 1.70158;\n
\t\t\t\tvar p = 0;\n
\t\t\t\tvar a = 1;\n
\t\t\t\tif (t === 0){\n
\t\t\t\t\treturn 0;\n
\t\t\t\t}\n
\t\t\t\tif ((t /= 1) == 1){\n
\t\t\t\t\treturn 1;\n
\t\t\t\t}\n
\t\t\t\tif (!p){\n
\t\t\t\t\tp = 1 * 0.3;\n
\t\t\t\t}\n
\t\t\t\tif (a < Math.abs(1)) {\n
\t\t\t\t\ta = 1;\n
\t\t\t\t\ts = p / 4;\n
\t\t\t\t} else{\n
\t\t\t\t\ts = p / (2 * Math.PI) * Math.asin(1 / a);\n
\t\t\t\t}\n
\t\t\t\treturn -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * 1 - s) * (2 * Math.PI) / p));\n
\t\t\t},\n
\t\t\teaseOutElastic: function (t) {\n
\t\t\t\tvar s = 1.70158;\n
\t\t\t\tvar p = 0;\n
\t\t\t\tvar a = 1;\n
\t\t\t\tif (t === 0){\n
\t\t\t\t\treturn 0;\n
\t\t\t\t}\n
\t\t\t\tif ((t /= 1) == 1){\n
\t\t\t\t\treturn 1;\n
\t\t\t\t}\n
\t\t\t\tif (!p){\n
\t\t\t\t\tp = 1 * 0.3;\n
\t\t\t\t}\n
\t\t\t\tif (a < Math.abs(1)) {\n
\t\t\t\t\ta = 1;\n
\t\t\t\t\ts = p / 4;\n
\t\t\t\t} else{\n
\t\t\t\t\ts = p / (2 * Math.PI) * Math.asin(1 / a);\n
\t\t\t\t}\n
\t\t\t\treturn a * Math.pow(2, -10 * t) * Math.sin((t * 1 - s) * (2 * Math.PI) / p) + 1;\n
\t\t\t},\n
\t\t\teaseInOutElastic: function (t) {\n
\t\t\t\tvar s = 1.70158;\n
\t\t\t\tvar p = 0;\n
\t\t\t\tvar a = 1;\n
\t\t\t\tif (t === 0){\n
\t\t\t\t\treturn 0;\n
\t\t\t\t}\n
\t\t\t\tif ((t /= 1 / 2) == 2){\n
\t\t\t\t\treturn 1;\n
\t\t\t\t}\n
\t\t\t\tif (!p){\n
\t\t\t\t\tp = 1 * (0.3 * 1.5);\n
\t\t\t\t}\n
\t\t\t\tif (a < Math.abs(1)) {\n
\t\t\t\t\ta = 1;\n
\t\t\t\t\ts = p / 4;\n
\t\t\t\t} else {\n
\t\t\t\t\ts = p / (2 * Math.PI) * Math.asin(1 / a);\n
\t\t\t\t}\n
\t\t\t\tif (t < 1){\n
\t\t\t\t\treturn -0.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * 1 - s) * (2 * Math.PI) / p));}\n
\t\t\t\treturn a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * 1 - s) * (2 * Math.PI) / p) * 0.5 + 1;\n
\t\t\t},\n
\t\t\teaseInBack: function (t) {\n
\t\t\t\tvar s = 1.70158;\n
\t\t\t\treturn 1 * (t /= 1) * t * ((s + 1) * t - s);\n
\t\t\t},\n
\t\t\teaseOutBack: function (t) {\n
\t\t\t\tvar s = 1.70158;\n
\t\t\t\treturn 1 * ((t = t / 1 - 1) * t * ((s + 1) * t + s) + 1);\n
\t\t\t},\n
\t\t\teaseInOutBack: function (t) {\n
\t\t\t\tvar s = 1.70158;\n
\t\t\t\tif ((t /= 1 / 2) < 1){\n
\t\t\t\t\treturn 1 / 2 * (t * t * (((s *= (1.525)) + 1) * t - s));\n
\t\t\t\t}\n
\t\t\t\treturn 1 / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2);\n
\t\t\t},\n
\t\t\teaseInBounce: function (t) {\n
\t\t\t\treturn 1 - easingEffects.easeOutBounce(1 - t);\n
\t\t\t},\n
\t\t\teaseOutBounce: function (t) {\n
\t\t\t\tif ((t /= 1) < (1 / 2.75)) {\n
\t\t\t\t\treturn 1 * (7.5625 * t * t);\n
\t\t\t\t} else if (t < (2 / 2.75)) {\n
\t\t\t\t\treturn 1 * (7.5625 * (t -= (1.5 / 2.75)) * t + 0.75);\n
\t\t\t\t} else if (t < (2.5 / 2.75)) {\n
\t\t\t\t\treturn 1 * (7.5625 * (t -= (2.25 / 2.75)) * t + 0.9375);\n
\t\t\t\t} else {\n
\t\t\t\t\treturn 1 * (7.5625 * (t -= (2.625 / 2.75)) * t + 0.984375);\n
\t\t\t\t}\n
\t\t\t},\n
\t\t\teaseInOutBounce: function (t) {\n
\t\t\t\tif (t < 1 / 2){\n
\t\t\t\t\treturn easingEffects.easeInBounce(t * 2) * 0.5;\n
\t\t\t\t}\n
\t\t\t\treturn easingEffects.easeOutBounce(t * 2 - 1) * 0.5 + 1 * 0.5;\n
\t\t\t}\n
\t\t},\n
\t\t//Request animation polyfill - http://www.paulirish.com/2011/requestanimationframe-for-smart-animating/\n
\t\trequestAnimFrame = helpers.requestAnimFrame = (function(){\n
\t\t\treturn window.requestAnimationFrame ||\n
\t\t\t\twindow.webkitRequestAnimationFrame ||\n
\t\t\t\twindow.mozRequestAnimationFrame ||\n
\t\t\t\twindow.oRequestAnimationFrame ||\n
\t\t\t\twindow.msRequestAnimationFrame ||\n
\t\t\t\tfunction(callback) {\n
\t\t\t\t\treturn window.setTimeout(callback, 1000 / 60);\n
\t\t\t\t};\n
\t\t})(),\n
\t\tcancelAnimFrame = helpers.cancelAnimFrame = (function(){\n
\t\t\treturn window.cancelAnimationFrame ||\n
\t\t\t\twindow.webkitCancelAnimationFrame ||\n
\t\t\t\twindow.mozCancelAnimationFrame ||\n
\t\t\t\twindow.oCancelAnimationFrame ||\n
\t\t\t\twindow.msCancelAnimationFrame ||\n
\t\t\t\tfunction(callback) {\n
\t\t\t\t\treturn window.clearTimeout(callback, 1000 / 60);\n
\t\t\t\t};\n
\t\t})(),\n
\t\tanimationLoop = helpers.animationLoop = function(callback,totalSteps,easingString,onProgress,onComplete,chartInstance){\n
\n
\t\t\tvar currentStep = 0,\n
\t\t\t\teasingFunction = easingEffects[easingString] || easingEffects.linear;\n
\n
\t\t\tvar animationFrame = function(){\n
\t\t\t\tcurrentStep++;\n
\t\t\t\tvar stepDecimal = currentStep/totalSteps;\n
\t\t\t\tvar easeDecimal = easingFunction(stepDecimal);\n
\n
\t\t\t\tcallback.call(chartInstance,easeDecimal,stepDecimal, currentStep);\n
\t\t\t\tonProgress.call(chartInstance,easeDecimal,stepDecimal);\n
\t\t\t\tif (currentStep < totalSteps){\n
\t\t\t\t\tchartInstance.animationFrame = requestAnimFrame(animationFrame);\n
\t\t\t\t} else{\n
\t\t\t\t\tonComplete.apply(chartInstance);\n
\t\t\t\t}\n
\t\t\t};\n
\t\t\trequestAnimFrame(animationFrame);\n
\t\t},\n
\t\t//-- DOM methods\n
\t\tgetRelativePosition = helpers.getRelativePosition = function(evt){\n
\t\t\tvar mouseX, mouseY;\n
\t\t\tvar e = evt.originalEvent || evt,\n
\t\t\t\tcanvas = evt.currentTarget || evt.srcElement,\n
\t\t\t\tboundingRect = canvas.getBoundingClientRect();\n
\n
\t\t\tif (e.touches){\n
\t\t\t\tmouseX = e.touches[0].clientX - boundingRect.left;\n
\t\t\t\tmouseY = e.touches[0].clientY - boundingRect.top;\n
\n
\t\t\t}\n
\t\t\telse{\n
\t\t\t\tmouseX = e.clientX - boundingRect.left;\n
\t\t\t\tmouseY = e.clientY - boundingRect.top;\n
\t\t\t}\n
\n
\t\t\treturn {\n
\t\t\t\tx : mouseX,\n
\t\t\t\ty : mouseY\n
\t\t\t};\n
\n
\t\t},\n
\t\taddEvent = helpers.addEvent = function(node,eventType,method){\n
\t\t\tif (node.addEventListener){\n
\t\t\t\tnode.addEventListener(eventType,method);\n
\t\t\t} else if (node.attachEvent){\n
\t\t\t\tnode.attachEvent("on"+eventType, method);\n
\t\t\t} else {\n
\t\t\t\tnode["on"+eventType] = method;\n
\t\t\t}\n
\t\t},\n
\t\tremoveEvent = helpers.removeEvent = function(node, eventType, handler){\n
\t\t\tif (node.removeEventListener){\n
\t\t\t\tnode.removeEventListener(eventType, handler, false);\n
\t\t\t} else if (node.detachEvent){\n
\t\t\t\tnode.detachEvent("on"+eventType,handler);\n
\t\t\t} else{\n
\t\t\t\tnode["on" + eventType] = noop;\n
\t\t\t}\n
\t\t},\n
\t\tbindEvents = helpers.bindEvents = function(chartInstance, arrayOfEvents, handler){\n
\t\t\t// Create the events object if it\'s not already present\n
\t\t\tif (!chartInstance.events) chartInstance.events = {};\n
\n
\t\t\teach(arrayOfEvents,function(eventName){\n
\t\t\t\tchartInstance.events[eventName] = function(){\n
\t\t\t\t\thandler.apply(chartInstance, arguments);\n
\t\t\t\t};\n
\t\t\t\taddEvent(chartInstance.chart.canvas,eventName,chartInstance.events[eventName]);\n
\t\t\t});\n
\t\t},\n
\t\tunbindEvents = helpers.unbindEvents = function (chartInstance, arrayOfEvents) {\n
\t\t\teach(arrayOfEvents, function(handler,eventName){\n
\t\t\t\tremoveEvent(chartInstance.chart.canvas, eventName, handler);\n
\t\t\t});\n
\t\t},\n
\t\tgetMaximumWidth = helpers.getMaximumWidth = function(domNode){\n
\t\t\tvar container = domNode.parentNode,\n
\t\t\t padding = parseInt(getStyle(container, \'padding-left\')) + parseInt(getStyle(container, \'padding-right\'));\n
\t\t\t// TODO = check cross browser stuff with this.\n
\t\t\treturn container.clientWidth - padding;\n
\t\t},\n
\t\tgetMaximumHeight = helpers.getMaximumHeight = function(domNode){\n
\t\t\tvar container = domNode.parentNode,\n
\t\t\t padding = parseInt(getStyle(container, \'padding-bottom\')) + parseInt(getStyle(container, \'padding-top\'));\n
\t\t\t// TODO = check cross browser stuff with this.\n
\t\t\treturn container.clientHeight - padding;\n
\t\t},\n
\t\tgetStyle = helpers.getStyle = function (el, property) {\n
\t\t\treturn el.currentStyle ?\n
\t\t\t\tel.currentStyle[property] :\n
\t\t\t\tdocument.defaultView.getComputedStyle(el, null).getPropertyValue(property);\n
\t\t},\n
\t\tgetMaximumSize = helpers.getMaximumSize = helpers.getMaximumWidth, // legacy support\n
\t\tretinaScale = helpers.retinaScale = function(chart){\n
\t\t\tvar ctx = chart.ctx,\n
\t\t\t\twidth = chart.canvas.width,\n
\t\t\t\theight = chart.canvas.height;\n
\n
\t\t\tif (window.devicePixelRatio) {\n
\t\t\t\tctx.canvas.style.width = width + "px";\n
\t\t\t\tctx.canvas.style.height = height + "px";\n
\t\t\t\tctx.canvas.height = height * window.devicePixelRatio;\n
\t\t\t\tctx.canvas.width = width * window.devicePixelRatio;\n
\t\t\t\tctx.scale(window.devicePixelRatio, window.devicePixelRatio);\n
\t\t\t}\n
\t\t},\n
\t\t//-- Canvas methods\n
\t\tclear = helpers.clear = function(chart){\n
\t\t\tchart.ctx.clearRect(0,0,chart.width,chart.height);\n
\t\t},\n
\t\tfontString = helpers.fontString = function(pixelSize,fontStyle,fontFamily){\n
\t\t\treturn fontStyle + " " + pixelSize+"px " + fontFamily;\n
\t\t},\n
\t\tlongestText = helpers.longestText = function(ctx,font,arrayOfStrings){\n
\t\t\tctx.font = font;\n
\t\t\tvar longest = 0;\n
\t\t\teach(arrayOfStrings,function(string){\n
\t\t\t\tvar textWidth = ctx.measureText(string).width;\n
\t\t\t\tlongest = (textWidth > longest) ? textWidth : longest;\n
\t\t\t});\n
\t\t\treturn longest;\n
\t\t},\n
\t\tdrawRoundedRectangle = helpers.drawRoundedRectangle = function(ctx,x,y,width,height,radius){\n
\t\t\tctx.beginPath();\n
\t\t\tctx.moveTo(x + radius, y);\n
\t\t\tctx.lineTo(x + width - radius, y);\n
\t\t\tctx.quadraticCurveTo(x + width, y, x + width, y + radius);\n
\t\t\tctx.lineTo(x + width, y + height - radius);\n
\t\t\tctx.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);\n
\t\t\tctx.lineTo(x + radius, y + height);\n
\t\t\tctx.quadraticCurveTo(x, y + height, x, y + height - radius);\n
\t\t\tctx.lineTo(x, y + radius);\n
\t\t\tctx.quadraticCurveTo(x, y, x + radius, y);\n
\t\t\tctx.closePath();\n
\t\t};\n
\n
\n
\t//Store a reference to each instance - allowing us to globally resize chart instances on window resize.\n
\t//Destroy method on the chart will remove the instance of the chart from this reference.\n
\tChart.instances = {};\n
\n
\tChart.Type = function(data,options,chart){\n
\t\tthis.options = options;\n
\t\tthis.chart = chart;\n
\t\tthis.id = uid();\n
\t\t//Add the chart instance to the global namespace\n
\t\tChart.instances[this.id] = this;\n
\n
\t\t// Initialize is always called when a chart type is created\n
\t\t// By default it is a no op, but it should be extended\n
\t\tif (options.responsive){\n
\t\t\tthis.resize();\n
\t\t}\n
\t\tthis.initialize.call(this,data);\n
\t};\n
\n
\t//Core methods that\'ll be a part of every chart type\n
\textend(Chart.Type.prototype,{\n
\t\tinitialize : function(){return this;},\n
\t\tclear : function(){\n
\t\t\tclear(this.chart);\n
\t\t\treturn this;\n
\t\t},\n
\t\tstop : function(){\n
\t\t\t// Stops any current animation loop occuring\n
\t\t\tChart.animationService.cancelAnimation(this);\n
\t\t\treturn this;\n
\t\t},\n
\t\tresize : function(callback){\n
\t\t\tthis.stop();\n
\t\t\tvar canvas = this.chart.canvas,\n
\t\t\t\tnewWidth = getMaximumWidth(this.chart.canvas),\n
\t\t\t\tnewHeight = this.options.maintainAspectRatio ? newWidth / this.chart.aspectRatio : getMaximumHeight(this.chart.canvas);\n
\n
\t\t\tcanvas.width = this.chart.width = newWidth;\n
\t\t\tcanvas.height = this.chart.height = newHeight;\n
\n
\t\t\tretinaScale(this.chart);\n
\n
\t\t\tif (typeof callback === "function"){\n
\t\t\t\tcallback.apply(this, Array.prototype.slice.call(arguments, 1));\n
\t\t\t}\n
\t\t\treturn this;\n
\t\t},\n
\t\treflow : noop,\n
\t\trender : function(reflow){\n
\t\t\tif (reflow){\n
\t\t\t\tthis.reflow();\n
\t\t\t}\n
\t\t\t\n
\t\t\tif (this.options.animation && !reflow){\n
\t\t\t\tvar animation = new Chart.Animation();\n
\t\t\t\tanimation.numSteps = this.options.animationSteps;\n
\t\t\t\tanimation.easing = this.options.animationEasing;\n
\t\t\t\t\n
\t\t\t\t// render function\n
\t\t\t\tanimation.render = function(chartInstance, animationObject) {\n
\t\t\t\t\tvar easingFunction = helpers.easingEffects[animationObject.easing];\n
\t\t\t\t\tvar stepDecimal = animationObject.currentStep / animationObject.numSteps;\n
\t\t\t\t\tvar easeDecimal = easingFunction(stepDecimal);\n
\t\t\t\t\t\n
\t\t\t\t\tchartInstance.draw(easeDecimal, stepDecimal, animationObject.currentStep);\n
\t\t\t\t};\n
\t\t\t\t\n
\t\t\t\t// user events\n
\t\t\t\tanimation.onAnimationProgress = this.options.onAnimationProgress;\n
\t\t\t\tanimation.onAnimationComplete = this.options.onAnimationComplete;\n
\t\t\t\t\n
\t\t\t\tChart.animationService.addAnimation(this, animation);\n
\t\t\t}\n
\t\t\telse{\n
\t\t\t\tthis.draw();\n
\t\t\t\tthis.options.onAnimationComplete.call(this);\n
\t\t\t}\n
\t\t\treturn this;\n
\t\t},\n
\t\tgenerateLegend : function(){\n
\t\t\treturn template(this.options.legendTemplate,this);\n
\t\t},\n
\t\tdestroy : function(){\n
\t\t\tthis.clear();\n
\t\t\tunbindEvents(this, this.events);\n
\t\t\tvar canvas = this.chart.canvas;\n
\n
\t\t\t// Reset canvas height/width attributes starts a fresh with the canvas context\n
\t\t\tcanvas.width = this.chart.width;\n
\t\t\tcanvas.height = this.chart.height;\n
\n
\t\t\t// < IE9 doesn\'t support removeProperty\n
\t\t\tif (canvas.style.removeProperty) {\n
\t\t\t\tcanvas.style.removeProperty(\'width\');\n
\t\t\t\tcanvas.style.removeProperty(\'height\');\n
\t\t\t} else {\n
\t\t\t\tcanvas.style.removeAttribute(\'width\');\n
\t\t\t\tcanvas.style.removeAttribute(\'height\');\n
\t\t\t}\n
\n
\t\t\tdelete Chart.instances[this.id];\n
\t\t},\n
\t\tshowTooltip : function(ChartElements, forceRedraw){\n
\t\t\t// Only redraw the chart if we\'ve actually changed what we\'re hovering on.\n
\t\t\tif (typeof this.activeElements === \'undefined\') this.activeElements = [];\n
\n
\t\t\tvar isChanged = (function(Elements){\n
\t\t\t\tvar changed = false;\n
\n
\t\t\t\tif (Elements.length !== this.activeElements.length){\n
\t\t\t\t\tchanged = true;\n
\t\t\t\t\treturn changed;\n
\t\t\t\t}\n
\n
\t\t\t\teach(Elements, function(element, index){\n
\t\t\t\t\tif (element !== this.activeElements[index]){\n
\t\t\t\t\t\tchanged = true;\n
\t\t\t\t\t}\n
\t\t\t\t}, this);\n
\t\t\t\treturn changed;\n
\t\t\t}).call(this, ChartElements);\n
\n
\t\t\tif (!isChanged && !forceRedraw){\n
\t\t\t\treturn;\n
\t\t\t}\n
\t\t\telse{\n
\t\t\t\tthis.activeElements = ChartElements;\n
\t\t\t}\n
\t\t\tthis.draw();\n
\t\t\tif(this.options.customTooltips){\n
\t\t\t\tthis.options.customTooltips(false);\n
\t\t\t}\n
\t\t\tif (ChartElements.length > 0){\n
\t\t\t\t// If we have multiple datasets, show a MultiTooltip for all of the data points at that index\n
\t\t\t\tif (this.datasets && this.datasets.length > 1) {\n
\t\t\t\t\tvar dataArray,\n
\t\t\t\t\t\tdataIndex;\n
\n
\t\t\t\t\tfor (var i = this.datasets.length - 1; i >= 0; i--) {\n
\t\t\t\t\t\tdataArray = this.datasets[i].points || this.datasets[i].bars || this.datasets[i].segments;\n
\t\t\t\t\t\tdataIndex = indexOf(dataArray, ChartElements[0]);\n
\t\t\t\t\t\tif (dataIndex !== -1){\n
\t\t\t\t\t\t\tbreak;\n
\t\t\t\t\t\t}\n
\t\t\t\t\t}\n
\t\t\t\t\tvar tooltipLabels = [],\n
\t\t\t\t\t\ttooltipColors = [],\n
\t\t\t\t\t\tmedianPosition = (function(index) {\n
\n
\t\t\t\t\t\t\t// Get all the points at that particular index\n
\t\t\t\t\t\t\tvar Elements = [],\n
\t\t\t\t\t\t\t\tdataCollection,\n
\t\t\t\t\t\t\t\txPositions = [],\n
\t\t\t\t\t\t\t\tyPositions = [],\n
\t\t\t\t\t\t\t\txMax,\n
\t\t\t\t\t\t\t\tyMax,\n
\t\t\t\t\t\t\t\txMin,\n
\t\t\t\t\t\t\t\tyMin;\n
\t\t\t\t\t\t\thelpers.each(this.datasets, function(dataset){\n
\t\t\t\t\t\t\t\tdataCollection = dataset.points || dataset.bars || dataset.segments;\n
\t\t\t\t\t\t\t\tif (dataCollection[dataIndex] && dataCollection[dataIndex].hasValue()){\n
\t\t\t\t\t\t\t\t\tElements.push(dataCollection[dataIndex]);\n
\t\t\t\t\t\t\t\t}\n
\t\t\t\t\t\t\t});\n
\n
\t\t\t\t\t\t\thelpers.each(Elements, function(element) {\n
\t\t\t\t\t\t\t\txPositions.push(element.x);\n
\t\t\t\t\t\t\t\tyPositions.push(element.y);\n
\n
\n
\t\t\t\t\t\t\t\t//Include any colour information about the element\n
\t\t\t\t\t\t\t\ttooltipLabels.push(helpers.template(this.options.multiTooltipTemplate, element));\n
\t\t\t\t\t\t\t\ttooltipColors.push({\n
\t\t\t\t\t\t\t\t\tfill: element._saved.fillColor || element.fillColor,\n
\t\t\t\t\t\t\t\t\tstroke: element._saved.strokeColor || element.strokeColor\n
\t\t\t\t\t\t\t\t});\n
\n
\t\t\t\t\t\t\t}, this);\n
\n
\t\t\t\t\t\t\tyMin = min(yPositions);\n
\t\t\t\t\t\t\tyMax = max(yPositions);\n
\n
\t\t\t\t\t\t\txMin = min(xPositions);\n
\t\t\t\t\t\t\txMax = max(xPositions);\n
\n
\t\t\t\t\t\t\treturn {\n
\t\t\t\t\t\t\t\tx: (xMin > this.chart.width/2) ? xMin : xMax,\n
\t\t\t\t\t\t\t\ty: (yMin + yMax)/2\n
\t\t\t\t\t\t\t};\n
\t\t\t\t\t\t}).call(this, dataIndex);\n
\n
\t\t\t\t\tnew Chart.MultiTooltip({\n
\t\t\t\t\t\tx: medianPosition.x,\n
\t\t\t\t\t\ty: medianPosition.y,\n
\t\t\t\t\t\txPadding: this.options.tooltipXPadding,\n
\t\t\t\t\t\tyPadding: this.options.tooltipYPadding,\n
\t\t\t\t\t\txOffset: this.options.tooltipXOffset,\n
\t\t\t\t\t\tfillColor: this.options.tooltipFillColor,\n
\t\t\t\t\t\ttextColor: this.options.tooltipFontColor,\n
\t\t\t\t\t\tfontFamily: this.options.tooltipFontFamily,\n
\t\t\t\t\t\tfontStyle: this.options.tooltipFontStyle,\n
\t\t\t\t\t\tfontSize: this.options.tooltipFontSize,\n
\t\t\t\t\t\ttitleTextColor: this.options.tooltipTitleFontColor,\n
\t\t\t\t\t\ttitleFontFamily: this.options.tooltipTitleFontFamily,\n
\t\t\t\t\t\ttitleFontStyle: this.options.tooltipTitleFontStyle,\n
\t\t\t\t\t\ttitleFontSize: this.options.tooltipTitleFontSize,\n
\t\t\t\t\t\tcornerRadius: this.options.tooltipCornerRadius,\n
\t\t\t\t\t\tlabels: tooltipLabels,\n
\t\t\t\t\t\tlegendColors: tooltipColors,\n
\t\t\t\t\t\tlegendColorBackground : this.options.multiTooltipKeyBackground,\n
\t\t\t\t\t\ttitle: template(this.options.tooltipTitleTemplate,ChartElements[0]),\n
\t\t\t\t\t\tchart: this.chart,\n
\t\t\t\t\t\tctx: this.chart.ctx,\n
\t\t\t\t\t\tcustom: this.options.customTooltips\n
\t\t\t\t\t}).draw();\n
\n
\t\t\t\t} else {\n
\t\t\t\t\teach(ChartElements, function(Element) {\n
\t\t\t\t\t\tvar tooltipPosition = Element.tooltipPosition();\n
\t\t\t\t\t\tnew Chart.Tooltip({\n
\t\t\t\t\t\t\tx: Math.round(tooltipPosition.x),\n
\t\t\t\t\t\t\ty: Math.round(tooltipPosition.y),\n
\t\t\t\t\t\t\txPadding: this.options.tooltipXPadding,\n
\t\t\t\t\t\t\tyPadding: this.options.tooltipYPadding,\n
\t\t\t\t\t\t\tfillColor: this.options.tooltipFillColor,\n
\t\t\t\t\t\t\ttextColor: this.options.tooltipFontColor,\n
\t\t\t\t\t\t\tfontFamily: this.options.tooltipFontFamily,\n
\t\t\t\t\t\t\tfontStyle: this.options.tooltipFontStyle,\n
\t\t\t\t\t\t\tfontSize: this.options.tooltipFontSize,\n
\t\t\t\t\t\t\tcaretHeight: this.options.tooltipCaretSize,\n
\t\t\t\t\t\t\tcornerRadius: this.options.tooltipCornerRadius,\n
\t\t\t\t\t\t\ttext: template(this.options.tooltipTemplate, Element),\n
\t\t\t\t\t\t\tchart: this.chart,\n
\t\t\t\t\t\t\tcustom: this.options.customTooltips\n
\t\t\t\t\t\t}).draw();\n
\t\t\t\t\t}, this);\n
\t\t\t\t}\n
\t\t\t}\n
\t\t\treturn this;\n
\t\t},\n
\t\ttoBase64Image : function(){\n
\t\t\treturn this.chart.canvas.toDataURL.apply(this.chart.canvas, arguments);\n
\t\t}\n
\t});\n
\n
\tChart.Type.extend = function(extensions){\n
\n
\t\tvar parent = this;\n
\n
\t\tvar ChartType = function(){\n
\t\t\treturn parent.apply(this,arguments);\n
\t\t};\n
\n
\t\t//Copy the prototype object of the this class\n
\t\tChartType.prototype = clone(parent.prototype);\n
\t\t//Now overwrite some of the properties in the base class with the new extensions\n
\t\textend(ChartType.prototype, extensions);\n
\n
\t\tChartType.extend = Chart.Type.extend;\n
\n
\t\tif (extensions.name || parent.prototype.name){\n
\n
\t\t\tvar chartName = extensions.name || parent.prototype.name;\n
\t\t\t//Assign any potential default values of the new chart type\n
\n
\t\t\t//If none are defined, we\'ll use a clone of the chart type this is being extended from.\n
\t\t\t//I.e. if we extend a line chart, we\'ll use the defaults from the line chart if our new chart\n
\t\t\t//doesn\'t define some defaults of their own.\n
\n
\t\t\tvar baseDefaults = (Chart.defaults[parent.prototype.name]) ? clone(Chart.defaults[parent.prototype.name]) : {};\n
\n
\t\t\tChart.defaults[chartName] = extend(baseDefaults,extensions.defaults);\n
\n
\t\t\tChart.types[chartName] = ChartType;\n
\n
\t\t\t//Register this new chart type in the Chart prototype\n
\t\t\tChart.prototype[chartName] = function(data,options){\n
\t\t\t\tvar config = merge(Chart.defaults.global, Chart.defaults[chartName], options || {});\n
\t\t\t\treturn new ChartType(data,config,this);\n
\t\t\t};\n
\t\t} else{\n
\t\t\twarn("Name not provided for this chart, so it hasn\'t been registered");\n
\t\t}\n
\t\treturn parent;\n
\t};\n
\n
\tChart.Element = function(configuration){\n
\t\textend(this,configuration);\n
\t\tthis.initialize.apply(this,arguments);\n
\t\tthis.save();\n
\t};\n
\textend(Chart.Element.prototype,{\n
\t\tinitialize : function(){},\n
\t\trestore : function(props){\n
\t\t\tif (!props){\n
\t\t\t\textend(this,this._saved);\n
\t\t\t} else {\n
\t\t\t\teach(props,function(key){\n
\t\t\t\t\tthis[key] = this._saved[key];\n
\t\t\t\t},this);\n
\t\t\t}\n
\t\t\treturn this;\n
\t\t},\n
\t\tsave : function(){\n
\t\t\tthis._saved = clone(this);\n
\t\t\tdelete this._saved._saved;\n
\t\t\treturn this;\n
\t\t},\n
\t\tupdate : function(newProps){\n
\t\t\teach(newProps,function(value,key){\n
\t\t\t\tthis._saved[key] = this[key];\n
\t\t\t\tthis[key] = value;\n
\t\t\t},this);\n
\t\t\treturn this;\n
\t\t},\n
\t\ttransition : function(props,ease){\n
\t\t\teach(props,function(value,key){\n
\t\t\t\tthis[key] = ((value - this._saved[key]) * ease) + this._saved[key];\n
\t\t\t},this);\n
\t\t\treturn this;\n
\t\t},\n
\t\ttooltipPosition : function(){\n
\t\t\treturn {\n
\t\t\t\tx : this.x,\n
\t\t\t\ty : this.y\n
\t\t\t};\n
\t\t},\n
\t\thasValue: function(){\n
\t\t\treturn isNumber(this.value);\n
\t\t}\n
\t});\n
\n
\tChart.Element.extend = inherits;\n
\n
\n
\tChart.Point = Chart.Element.extend({\n
\t\tdisplay: true,\n
\t\tinRange: function(chartX,chartY){\n
\t\t\tvar hitDetectionRange = this.hitDetectionRadius + this.radius;\n
\t\t\treturn ((Math.pow(chartX-this.x, 2)+Math.pow(chartY-this.y, 2)) < Math.pow(hitDetectionRange,2));\n
\t\t},\n
\t\tdraw : function(){\n
\t\t\tif (this.display){\n
\t\t\t\tvar ctx = this.ctx;\n
\t\t\t\tctx.beginPath();\n
\n
\t\t\t\tctx.arc(this.x, this.y, this.radius, 0, Math.PI*2);\n
\t\t\t\tctx.closePath();\n
\n
\t\t\t\tctx.strokeStyle = this.strokeColor;\n
\t\t\t\tctx.lineWidth = this.strokeWidth;\n
\n
\t\t\t\tctx.fillStyle = this.fillColor;\n
\n
\t\t\t\tctx.fill();\n
\t\t\t\tctx.stroke();\n
\t\t\t}\n
\n
\n
\t\t\t//Quick debug for bezier curve splining\n
\t\t\t//Highlights control points and the line between them.\n
\t\t\t//Handy for dev - stripped in the min version.\n
\n
\t\t\t// ctx.save();\n
\t\t\t// ctx.fillStyle = "black";\n
\t\t\t// ctx.strokeStyle = "black"\n
\t\t\t// ctx.beginPath();\n
\t\t\t// ctx.arc(this.controlPoints.inner.x,this.controlPoints.inner.y, 2, 0, Math.PI*2);\n
\t\t\t// ctx.fill();\n
\n
\t\t\t// ctx.beginPath();\n
\t\t\t// ctx.arc(this.controlPoints.outer.x,this.controlPoints.outer.y, 2, 0, Math.PI*2);\n
\t\t\t// ctx.fill();\n
\n
\t\t\t// ctx.moveTo(this.controlPoints.inner.x,this.controlPoints.inner.y);\n
\t\t\t// ctx.lineTo(this.x, this.y);\n
\t\t\t// ctx.lineTo(this.controlPoints.outer.x,this.controlPoints.outer.y);\n
\t\t\t// ctx.stroke();\n
\n
\t\t\t// ctx.restore();\n
\n
\n
\n
\t\t}\n
\t});\n
\n
\tChart.Arc = Chart.Element.extend({\n
\t\tinRange : function(chartX,chartY){\n
\n
\t\t\tvar pointRelativePosition = helpers.getAngleFromPoint(this, {\n
\t\t\t\tx: chartX,\n
\t\t\t\ty: chartY\n
\t\t\t});\n
\n
\t\t\t//Check if within the range of the open/close angle\n
\t\t\tvar betweenAngles = (pointRelativePosition.angle >= this.startAngle && pointRelativePosition.angle <= this.endAngle),\n
\t\t\t\twithinRadius = (pointRelativePosition.distance >= this.innerRadius && pointRelativePosition.distance <= this.outerRadius);\n
\n
\t\t\treturn (betweenAngles && withinRadius);\n
\t\t\t//Ensure within the outside of the arc centre, but inside arc outer\n
\t\t},\n
\t\ttooltipPosition : function(){\n
\t\t\tvar centreAngle = this.startAngle + ((this.endAngle - this.startAngle) / 2),\n
\t\t\t\trangeFromCentre = (this.outerRadius - this.innerRadius) / 2 + this.innerRadius;\n
\t\t\treturn {\n
\t\t\t\tx : this.x + (Math.cos(centreAngle) * rangeFromCentre),\n
\t\t\t\ty : this.y + (Math.sin(centreAngle) * rangeFromCentre)\n
\t\t\t};\n
\t\t},\n
\t\tdraw : function(animationPercent){\n
\n
\t\t\tvar easingDecimal = animationPercent || 1;\n
\n
\t\t\tvar ctx = this.ctx;\n
\n
\t\t\tctx.beginPath();\n
\n
\t\t\tctx.arc(this.x, this.y, this.outerRadius, this.startAngle, this.endAngle);\n
\n
\t\t\tctx.arc(this.x, this.y, this.innerRadius, this.endAngle, this.startAngle, true);\n
\n
\t\t\tctx.closePath();\n
\t\t\tctx.strokeStyle = this.strokeColor;\n
\t\t\tctx.lineWidth = this.strokeWidth;\n
\n
\t\t\tctx.fillStyle = this.fillColor;\n
\n
\t\t\tctx.fill();\n
\t\t\tctx.lineJoin = \'bevel\';\n
\n
\t\t\tif (this.showStroke){\n
\t\t\t\tctx.stroke();\n
\t\t\t}\n
\t\t}\n
\t});\n
\n
\tChart.Rectangle = Chart.Element.extend({\n
\t\tdraw : function(){\n
\t\t\tvar ctx = this.ctx,\n
\t\t\t\thalfWidth = this.width/2,\n
\t\t\t\tleftX = this.x - halfWidth,\n
\t\t\t\trightX = this.x + halfWidth,\n
\t\t\t\ttop = this.base - (this.base - this.y),\n
\t\t\t\thalfStroke = this.strokeWidth / 2;\n
\n
\t\t\t// Canvas doesn\'t allow us to stroke inside the width so we can\n
\t\t\t// adjust the sizes to fit if we\'re setting a stroke on the line\n
\t\t\tif (this.showStroke){\n
\t\t\t\tleftX += halfStroke;\n
\t\t\t\trightX -= halfStroke;\n
\t\t\t\ttop += halfStroke;\n
\t\t\t}\n
\n
\t\t\tctx.beginPath();\n
\n
\t\t\tctx.fillStyle = this.fillColor;\n
\t\t\tctx.strokeStyle = this.strokeColor;\n
\t\t\tctx.lineWidth = this.strokeWidth;\n
\n
\t\t\t// It\'d be nice to keep this class totally generic to any rectangle\n
\t\t\t// and simply specify which border to miss out.\n
\t\t\tctx.moveTo(leftX, this.base);\n
\t\t\tctx.lineTo(leftX, top);\n
\t\t\tctx.lineTo(rightX, top);\n
\t\t\tctx.lineTo(rightX, this.base);\n
\t\t\tctx.fill();\n
\t\t\tif (this.showStroke){\n
\t\t\t\tctx.stroke();\n
\t\t\t}\n
\t\t},\n
\t\theight : function(){\n
\t\t\treturn this.base - this.y;\n
\t\t},\n
\t\tinRange : function(chartX,chartY){\n
\t\t\treturn (chartX >= this.x - this.width/2 && chartX <= this.x + this.width/2) && (chartY >= this.y && chartY <= this.base);\n
\t\t}\n
\t});\n
\n
\tChart.Animation = Chart.Element.extend({\n
\t\tcurrentStep: null, // the current animation step\n
\t\tnumSteps: 60, // default number of steps\n
\t\teasing: "", // the easing to use for this animation\n
\t\trender: null, // render function used by the animation service\n
\t\t\n
\t\tonAnimationProgress: null, // user specified callback to fire on each step of the animation \n
\t\tonAnimationComplete: null, // user specified callback to fire when the animation finishes\n
\t});\n
\t\n
\tChart.Tooltip = Chart.Element.extend({\n
\t\tdraw : function(){\n
\n
\t\t\tvar ctx = this.chart.ctx;\n
\n
\t\t\tctx.font = fontString(this.fontSize,this.fontStyle,this.fontFamily);\n
\n
\t\t\tthis.xAlign = "center";\n
\t\t\tthis.yAlign = "above";\n
\n
\t\t\t//Distance between the actual element.y position and the start of the tooltip caret\n
\t\t\tvar caretPadding = this.caretPadding = 2;\n
\n
\t\t\tvar tooltipWidth = ctx.measureText(this.text).width + 2*this.xPadding,\n
\t\t\t\ttooltipRectHeight = this.fontSize + 2*this.yPadding,\n
\t\t\t\ttooltipHeight = tooltipRectHeight + this.caretHeight + caretPadding;\n
\n
\t\t\tif (this.x + tooltipWidth/2 >this.chart.width){\n
\t\t\t\tthis.xAlign = "left";\n
\t\t\t} else if (this.x - tooltipWidth/2 < 0){\n
\t\t\t\tthis.xAlign = "right";\n
\t\t\t}\n
\n
\t\t\tif (this.y - tooltipHeight < 0){\n
\t\t\t\tthis.yAlign = "below";\n
\t\t\t}\n
\n
\n
\t\t\tvar tooltipX = this.x - tooltipWidth/2,\n
\t\t\t\ttooltipY = this.y - tooltipHeight;\n
\n
\t\t\tctx.fillStyle = this.fillColor;\n
\n
\t\t\t// Custom Tooltips\n
\t\t\tif(this.custom){\n
\t\t\t\tthis.custom(this);\n
\t\t\t}\n
\t\t\telse{\n
\t\t\t\tswitch(this.yAlign)\n
\t\t\t\t{\n
\t\t\t\tcase "above":\n
\t\t\t\t\t//Draw a caret above the x/y\n
\t\t\t\t\tctx.beginPath();\n
\t\t\t\t\tctx.moveTo(this.x,this.y - caretPadding);\n
\t\t\t\t\tctx.lineTo(this.x + this.caretHeight, this.y - (caretPadding + this.caretHeight));\n
\t\t\t\t\tctx.lineTo(this.x - this.caretHeight, this.y - (caretPadding + this.caretHeight));\n
\t\t\t\t\tctx.closePath();\n
\t\t\t\t\tctx.fill();\n
\t\t\t\t\tbreak;\n
\t\t\t\tcase "below":\n
\t\t\t\t\ttooltipY = this.y + caretPadding + this.caretHeight;\n
\t\t\t\t\t//Draw a caret below the x/y\n
\t\t\t\t\tctx.beginPath();\n
\t\t\t\t\tctx.moveTo(this.x, this.y + caretPadding);\n
\t\t\t\t\tctx.lineTo(this.x + this.caretHeight, this.y + caretPadding + this.caretHeight);\n
\t\t\t\t\tctx.lineTo(this.x - this.caretHeight, this.y + caretPadding + this.caretHeight);\n
\t\t\t\t\tctx.closePath();\n
\t\t\t\t\tctx.fill();\n
\t\t\t\t\tbreak;\n
\t\t\t\t}\n
\n
\t\t\t\tswitch(this.xAlign)\n
\t\t\t\t{\n
\t\t\t\tcase "left":\n
\t\t\t\t\ttooltipX = this.x - tooltipWidth + (this.cornerRadius + this.caretHeight);\n
\t\t\t\t\tbreak;\n
\t\t\t\tcase "right":\n
\t\t\t\t\ttooltipX = this.x - (this.cornerRadius + this.caretHeight);\n
\t\t\t\t\tbreak;\n
\t\t\t\t}\n
\n
\t\t\t\tdrawRoundedRectangle(ctx,tooltipX,tooltipY,tooltipWidth,tooltipRectHeight,this.cornerRadius);\n
\n
\t\t\t\tctx.fill();\n
\n
\t\t\t\tctx.fillStyle = this.textColor;\n
\t\t\t\tctx.textAlign = "center";\n
\t\t\t\tctx.textBaseline = "middle";\n
\t\t\t\tctx.fillText(this.text, tooltipX + tooltipWidth/2, tooltipY + tooltipRectHeight/2);\n
\t\t\t}\n
\t\t}\n
\t});\n
\n
\tChart.MultiTooltip = Chart.Element.extend({\n
\t\tinitialize : function(){\n
\t\t\tthis.font = fontString(this.fontSize,this.fontStyle,this.fontFamily);\n
\n
\t\t\tthis.titleFont = fontString(this.titleFontSize,this.titleFontStyle,this.titleFontFamily);\n
\n
\t\t\tthis.height = (this.labels.length * this.fontSize) + ((this.labels.length-1) * (this.fontSize/2)) + (this.yPadding*2) + this.titleFontSize *1.5;\n
\n
\t\t\tthis.ctx.font = this.titleFont;\n
\n
\t\t\tvar titleWidth = this.ctx.measureText(this.title).width,\n
\t\t\t\t//Label has a legend square as well so account for this.\n
\t\t\t\tlabelWidth = longestText(this.ctx,this.font,this.labels) + this.fontSize + 3,\n
\t\t\t\tlongestTextWidth = max([labelWidth,titleWidth]);\n
\n
\t\t\tthis.width = longestTextWidth + (this.xPadding*2);\n
\n
\n
\t\t\tvar halfHeight = this.height/2;\n
\n
\t\t\t//Check to ensure the height will fit on the canvas\n
\t\t\tif (this.y - halfHeight < 0 ){\n
\t\t\t\tthis.y = halfHeight;\n
\t\t\t} else if (this.y + halfHeight > this.chart.height){\n
\t\t\t\tthis.y = this.chart.height - halfHeight;\n
\t\t\t}\n
\n
\t\t\t//Decide whether to align left or right based on position on canvas\n
\t\t\tif (this.x > this.chart.width/2){\n
\t\t\t\tthis.x -= this.xOffset + this.width;\n
\t\t\t} else {\n
\t\t\t\tthis.x += this.xOffset;\n
\t\t\t}\n
\n
\n
\t\t},\n
\t\tgetLineHeight : function(index){\n
\t\t\tvar baseLineHeight = this.y - (this.height/2) + this.yPadding,\n
\t\t\t\tafterTitleIndex = index-1;\n
\n
\t\t\t//If the index is zero, we\'re getting the title\n
\t\t\tif (index === 0){\n
\t\t\t\treturn baseLineHeight + this.titleFontSize/2;\n
\t\t\t} else{\n
\t\t\t\treturn baseLineHeight + ((this.fontSize*1.5*afterTitleIndex) + this.fontSize/2) + this.titleFontSize * 1.5;\n
\t\t\t}\n
\n
\t\t},\n
\t\tdraw : function(){\n
\t\t\t// Custom Tooltips\n
\t\t\tif(this.custom){\n
\t\t\t\tthis.custom(this);\n
\t\t\t}\n
\t\t\telse{\n
\t\t\t\tdrawRoundedRectangle(this.ctx,this.x,this.y - this.height/2,this.width,this.height,this.cornerRadius);\n
\t\t\t\tvar ctx = this.ctx;\n
\t\t\t\tctx.fillStyle = this.fillColor;\n
\t\t\t\tctx.fill();\n
\t\t\t\tctx.closePath();\n
\n
\t\t\t\tctx.textAlign = "left";\n
\t\t\t\tctx.textBaseline = "middle";\n
\t\t\t\tctx.fillStyle = this.titleTextColor;\n
\t\t\t\tctx.font = this.titleFont;\n
\n
\t\t\t\tctx.fillText(this.title,this.x + this.xPadding, this.getLineHeight(0));\n
\n
\t\t\t\tctx.font = this.font;\n
\t\t\t\thelpers.each(this.labels,function(label,index){\n
\t\t\t\t\tctx.fillStyle = this.textColor;\n
\t\t\t\t\tctx.fillText(label,this.x + this.xPadding + this.fontSize + 3, this.getLineHeight(index + 1));\n
\n
\t\t\t\t\t//A bit gnarly, but clearing this rectangle breaks when using explorercanvas (clears whole canvas)\n
\t\t\t\t\t//ctx.clearRect(this.x + this.xPadding, this.getLineHeight(index + 1) - this.fontSize/2, this.fontSize, this.fontSize);\n
\t\t\t\t\t//Instead we\'ll make a white filled block to put the legendColour palette over.\n
\n
\t\t\t\t\tctx.fillStyle = this.legendColorBackground;\n
\t\t\t\t\tctx.fillRect(this.x + this.xPadding, this.getLineHeight(index + 1) - this.fontSize/2, this.fontSize, this.fontSize);\n
\n
\t\t\t\t\tctx.fillStyle = this.legendColors[index].fill;\n
\t\t\t\t\tctx.fillRect(this.x + this.xPadding, this.getLineHeight(index + 1) - this.fontSize/2, this.fontSize, this.fontSize);\n
\n
\n
\t\t\t\t},this);\n
\t\t\t}\n
\t\t}\n
\t});\n
\n
\tChart.Scale = Chart.Element.extend({\n
\t\tinitialize : function(){\n
\t\t\tthis.fit();\n
\t\t},\n
\t\tbuildYLabels : function(){\n
\t\t\tthis.yLabels = [];\n
\n
\t\t\tvar stepDecimalPlaces = getDecimalPlaces(this.stepValue);\n
\n
\t\t\tfor (var i=0; i<=this.steps; i++){\n
\t\t\t\tthis.yLabels.push(template(this.templateString,{value:(this.min + (i * this.stepValue)).toFixed(stepDecimalPlaces)}));\n
\t\t\t}\n
\t\t\tthis.yLabelWidth = (this.display && this.showLabels) ? longestText(this.ctx,this.font,this.yLabels) + 10 : 0;\n
\t\t},\n
\t\taddXLabel : function(label){\n
\t\t\tthis.xLabels.push(label);\n
\t\t\tthis.valuesCount++;\n
\t\t\tthis.fit();\n
\t\t},\n
\t\tremoveXLabel : function(){\n
\t\t\tthis.xLabels.shift();\n
\t\t\tthis.valuesCount--;\n
\t\t\tthis.fit();\n
\t\t},\n
\t\t// Fitting loop to rotate x Labels and figure out what fits there, and also calculate how many Y steps to use\n
\t\tfit: function(){\n
\t\t\t// First we need the width of the yLabels, assuming the xLabels aren\'t rotated\n
\n
\t\t\t// To do that we need the base line at the top and base of the chart, assuming there is no x label rotation\n
\t\t\tthis.startPoint = (this.display) ? this.fontSize : 0;\n
\t\t\tthis.endPoint = (this.display) ? this.height - (this.fontSize * 1.5) - 5 : this.height; // -5 to pad labels\n
\n
\t\t\t// Apply padding settings to the start and end point.\n
\t\t\tthis.startPoint += this.padding;\n
\t\t\tthis.endPoint -= this.padding;\n
\n
\t\t\t// Cache the starting endpoint, excluding the space for x labels\n
\t\t\tvar cachedEndPoint = this.endPoint;\n
\n
\t\t\t// Cache the starting height, so can determine if we need to recalculate the scale yAxis\n
\t\t\tvar cachedHeight = this.endPoint - this.startPoint,\n
\t\t\t\tcachedYLabelWidth;\n
\n
\t\t\t// Build the current yLabels so we have an idea of what size they\'ll be to start\n
\t\t\t/*\n
\t\t\t *\tThis sets what is returned from calculateScaleRange as static properties of this class:\n
\t\t\t *\n
\t\t\t\tthis.steps;\n
\t\t\t\tthis.stepValue;\n
\t\t\t\tthis.min;\n
\t\t\t\tthis.max;\n
\t\t\t *\n
\t\t\t */\n
\t\t\tthis.calculateYRange(cachedHeight);\n
\n
\t\t\t// With these properties set we can now build the array of yLabels\n
\t\t\t// and also the width of the largest yLabel\n
\t\t\tthis.buildYLabels();\n
\n
\t\t\tthis.calculateXLabelRotation();\n
\n
\t\t\twhile((cachedHeight > this.endPoint - this.startPoint)){\n
\t\t\t\tcachedHeight = this.endPoint - this.startPoint;\n
\t\t\t\tcachedYLabelWidth = this.yLabelWidth;\n
\n
\t\t\t\tthis.calculateYRange(cachedHeight);\n
\t\t\t\tthis.buildYLabels();\n
\n
\t\t\t\t// Only go through the xLabel loop again if the yLabel width has changed\n
\t\t\t\tif (cachedYLabelWidth < this.yLabelWidth){\n
\t\t\t\t\tthis.endPoint = cachedEndPoint;\n
\t\t\t\t\tthis.calculateXLabelRotation();\n
\t\t\t\t}\n
\t\t\t}\n
\n
\t\t},\n
\t\tcalculateXLabelRotation : function(){\n
\t\t\t//Get the width of each grid by calculating the difference\n
\t\t\t//between x offsets between 0 and 1.\n
\n
\t\t\tthis.ctx.font = this.font;\n
\n
\t\t\tvar firstWidth = this.ctx.measureText(this.xLabels[0]).width,\n
\t\t\t\tlastWidth = this.ctx.measureText(this.xLabels[this.xLabels.length - 1]).width,\n
\t\t\t\tfirstRotated,\n
\t\t\t\tlastRotated;\n
\n
\n
\t\t\tthis.xScalePaddingRight = lastWidth/2 + 3;\n
\t\t\tthis.xScalePaddingLeft = (firstWidth/2 > this.yLabelWidth) ? firstWidth/2 : this.yLabelWidth;\n
\n
\t\t\tthis.xLabelRotation = 0;\n
\t\t\tif (this.display){\n
\t\t\t\tvar originalLabelWidth = longestText(this.ctx,this.font,this.xLabels),\n
\t\t\t\t\tcosRotation,\n
\t\t\t\t\tfirstRotatedWidth;\n
\t\t\t\tthis.xLabelWidth = originalLabelWidth;\n
\t\t\t\t//Allow 3 pixels x2 padding either side for label readability\n
\t\t\t\tvar xGridWidth = Math.floor(this.calculateX(1) - this.calculateX(0)) - 6;\n
\n
\t\t\t\t//Max label rotate should be 90 - also act as a loop counter\n
\t\t\t\twhile ((this.xLabelWidth > xGridWidth && this.xLabelRotation === 0) || (this.xLabelWidth > xGridWidth && this.xLabelRotation <= 90 && this.xLabelRotation > 0)){\n
\t\t\t\t\tcosRotation = Math.cos(toRadians(this.xLabelRotation));\n
\n
\t\t\t\t\tfirstRotated = cosRotation * firstWidth;\n
\t\t\t\t\tlastRotated = cosRotation * lastWidth;\n
\n
\t\t\t\t\t// We\'re right aligning the text now.\n
\t\t\t\t\tif (firstRotated + this.fontSize / 2 > this.yLabelWidth){\n
\t\t\t\t\t\tthis.xScalePaddingLeft = firstRotated + this.fontSize / 2;\n
\t\t\t\t\t}\n
\t\t\t\t\tthis.xScalePaddingRight = this.fontSize/2;\n
\n
\n
\t\t\t\t\tthis.xLabelRotation++;\n
\t\t\t\t\tthis.xLabelWidth = cosRotation * originalLabelWidth;\n
\n
\t\t\t\t}\n
\t\t\t\tif (this.xLabelRotation > 0){\n
\t\t\t\t\tthis.endPoint -= Math.sin(toRadians(this.xLabelRotation))*originalLabelWidth + 3;\n
\t\t\t\t}\n
\t\t\t}\n
\t\t\telse{\n
\t\t\t\tthis.xLabelWidth = 0;\n
\t\t\t\tthis.xScalePaddingRight = this.padding;\n
\t\t\t\tthis.xScalePaddingLeft = this.padding;\n
\t\t\t}\n
\n
\t\t},\n
\t\t// Needs to be overidden in each Chart type\n
\t\t// Otherwise we need to pass all the data into the scale class\n
\t\tcalculateYRange: noop,\n
\t\tdrawingArea: function(){\n
\t\t\treturn this.startPoint - this.endPoint;\n
\t\t},\n
\t\tcalculateY : function(value){\n
\t\t\tvar scalingFactor = this.drawingArea() / (this.min - this.max);\n
\t\t\treturn this.endPoint - (scalingFactor * (value - this.min));\n
\t\t},\n
\t\tcalculateX : function(index){\n
\t\t\tvar isRotated = (this.xLabelRotation > 0),\n
\t\t\t\t// innerWidth = (this.offsetGridLines) ? this.width - offsetLeft - this.padding : this.width - (offsetLeft + halfLabelWidth * 2) - this.padding,\n
\t\t\t\tinnerWidth = this.width - (this.xScalePaddingLeft + this.xScalePaddingRight),\n
\t\t\t\tvalueWidth = innerWidth/Math.max((this.valuesCount - ((this.offsetGridLines) ? 0 : 1)), 1),\n
\t\t\t\tvalueOffset = (valueWidth * index) + this.xScalePaddingLeft;\n
\n
\t\t\tif (this.offsetGridLines){\n
\t\t\t\tvalueOffset += (valueWidth/2);\n
\t\t\t}\n
\n
\t\t\treturn Math.round(valueOffset);\n
\t\t},\n
\t\tupdate : function(newProps){\n
\t\t\thelpers.extend(this, newProps);\n
\t\t\tthis.fit();\n
\t\t},\n
\t\tdraw : function(){\n
\t\t\tvar ctx = this.ctx,\n
\t\t\t\tyLabelGap = (this.endPoint - this.startPoint) / this.steps,\n
\t\t\t\txStart = Math.round(this.xScalePaddingLeft);\n
\t\t\tif (this.display){\n
\t\t\t\tctx.fillStyle = this.textColor;\n
\t\t\t\tctx.font = this.font;\n
\t\t\t\teach(this.yLabels,function(labelString,index){\n
\t\t\t\t\tvar yLabelCenter = this.endPoint - (yLabelGap * index),\n
\t\t\t\t\t\tlinePositionY = Math.round(yLabelCenter),\n
\t\t\t\t\t\tdrawHorizontalLine = this.showHorizontalLines;\n
\n
\t\t\t\t\tctx.textAlign = "right";\n
\t\t\t\t\tctx.textBaseline = "middle";\n
\t\t\t\t\tif (this.showLabels){\n
\t\t\t\t\t\tctx.fillText(labelString,xStart - 10,yLabelCenter);\n
\t\t\t\t\t}\n
\n
\t\t\t\t\t// This is X axis, so draw it\n
\t\t\t\t\tif (index === 0 && !drawHorizontalLine){\n
\t\t\t\t\t\tdrawHorizontalLine = true;\n
\t\t\t\t\t}\n
\n
\t\t\t\t\tif (drawHorizontalLine){\n
\t\t\t\t\t\tctx.beginPath();\n
\t\t\t\t\t}\n
\n
\t\t\t\t\tif (index > 0){\n
\t\t\t\t\t\t// This is a grid line in the centre, so drop that\n
\t\t\t\t\t\tctx.lineWidth = this.gridLineWidth;\n
\t\t\t\t\t\tctx.strokeStyle = this.gridLineColor;\n
\t\t\t\t\t} else {\n
\t\t\t\t\t\t// This is the first line on the scale\n
\t\t\t\t\t\tctx.lineWidth = this.lineWidth;\n
\t\t\t\t\t\tctx.strokeStyle = this.lineColor;\n
\t\t\t\t\t}\n
\n
\t\t\t\t\tlinePositionY += helpers.aliasPixel(ctx.lineWidth);\n
\n
\t\t\t\t\tif(drawHorizontalLine){\n
\t\t\t\t\t\tctx.moveTo(xStart, linePositionY);\n
\t\t\t\t\t\tctx.lineTo(this.width, linePositionY);\n
\t\t\t\t\t\tctx.stroke();\n
\t\t\t\t\t\tctx.closePath();\n
\t\t\t\t\t}\n
\n
\t\t\t\t\tctx.lineWidth = this.lineWidth;\n
\t\t\t\t\tctx.strokeStyle = this.lineColor;\n
\t\t\t\t\tctx.beginPath();\n
\t\t\t\t\tctx.moveTo(xStart - 5, linePositionY);\n
\t\t\t\t\tctx.lineTo(xStart, linePositionY);\n
\t\t\t\t\tctx.stroke();\n
\t\t\t\t\tctx.closePath();\n
\n
\t\t\t\t},this);\n
\n
\t\t\t\teach(this.xLabels,function(label,index){\n
\t\t\t\t\tvar xPos = this.calculateX(index) + aliasPixel(this.lineWidth),\n
\t\t\t\t\t\t// Check to see if line/bar here and decide where to place the line\n
\t\t\t\t\t\tlinePos = this.calculateX(index - (this.offsetGridLines ? 0.5 : 0)) + aliasPixel(this.lineWidth),\n
\t\t\t\t\t\tisRotated = (this.xLabelRotation > 0),\n
\t\t\t\t\t\tdrawVerticalLine = this.showVerticalLines;\n
\n
\t\t\t\t\t// This is Y axis, so draw it\n
\t\t\t\t\tif (index === 0 && !drawVerticalLine){\n
\t\t\t\t\t\tdrawVerticalLine = true;\n
\t\t\t\t\t}\n
\n
\t\t\t\t\tif (drawVerticalLine){\n
\t\t\t\t\t\tctx.beginPath();\n
\t\t\t\t\t}\n
\n
\t\t\t\t\tif (index > 0){\n
\t\t\t\t\t\t// This is a grid line in the centre, so drop that\n
\t\t\t\t\t\tctx.lineWidth = this.gridLineWidth;\n
\t\t\t\t\t\tctx.strokeStyle = this.gridLineColor;\n
\t\t\t\t\t} else {\n
\t\t\t\t\t\t// This is the first line on the scale\n
\t\t\t\t\t\tctx.lineWidth = this.lineWidth;\n
\t\t\t\t\t\tctx.strokeStyle = this.lineColor;\n
\t\t\t\t\t}\n
\n
\t\t\t\t\tif (drawVerticalLine){\n
\t\t\t\t\t\tctx.moveTo(linePos,this.endPoint);\n
\t\t\t\t\t\tctx.lineTo(linePos,this.startPoint - 3);\n
\t\t\t\t\t\tctx.stroke();\n
\t\t\t\t\t\tctx.closePath();\n
\t\t\t\t\t}\n
\n
\n
\t\t\t\t\tctx.lineWidth = this.lineWidth;\n
\t\t\t\t\tctx.strokeStyle = this.lineColor;\n
\n
\n
\t\t\t\t\t// Small lines at the bottom of the base grid line\n
\t\t\t\t\tctx.beginPath();\n
\t\t\t\t\tctx.moveTo(linePos,this.endPoint);\n
\t\t\t\t\tctx.lineTo(linePos,this.endPoint + 5);\n
\t\t\t\t\tctx.stroke();\n
\t\t\t\t\tctx.closePath();\n
\n
\t\t\t\t\tctx.save();\n
\t\t\t\t\tctx.translate(xPos,(isRotated) ? this.endPoint + 12 : this.endPoint + 8);\n
\t\t\t\t\tctx.rotate(toRadians(this.xLabelRotation)*-1);\n
\t\t\t\t\tctx.font = this.font;\n
\t\t\t\t\tctx.textAlign = (isRotated) ? "right" : "center";\n
\t\t\t\t\tctx.textBaseline = (isRotated) ? "middle" : "top";\n
\t\t\t\t\tctx.fillText(label, 0, 0);\n
\t\t\t\t\tctx.restore();\n
\t\t\t\t},this);\n
\n
\t\t\t}\n
\t\t}\n
\n
\t});\n
\n
\tChart.RadialScale = Chart.Element.extend({\n
\t\tinitialize: function(){\n
\t\t\tthis.size = min([this.height, this.width]);\n
\t\t\tthis.drawingArea = (this.display) ? (this.size/2) - (this.fontSize/2 + this.backdropPaddingY) : (this.size/2);\n
\t\t},\n
\t\tcalculateCenterOffset: function(value){\n
\t\t\t// Take into account half font size + the yPadding of the top value\n
\t\t\tvar scalingFactor = this.drawingArea / (this.max - this.min);\n
\n
\t\t\treturn (value - this.min) * scalingFactor;\n
\t\t},\n
\t\tupdate : function(){\n
\t\t\tif (!this.lineArc){\n
\t\t\t\tthis.setScaleSize();\n
\t\t\t} else {\n
\t\t\t\tthis.drawingArea = (this.display) ? (this.size/2) - (this.fontSize/2 + this.backdropPaddingY) : (this.size/2);\n
\t\t\t}\n
\t\t\tthis.buildYLabels();\n
\t\t},\n
\t\tbuildYLabels: function(){\n
\t\t\tthis.yLabels = [];\n
\n
\t\t\tvar stepDecimalPlaces = getDecimalPlaces(this.stepValue);\n
\n
\t\t\tfor (var i=0; i<=this.steps; i++){\n
\t\t\t\tthis.yLabels.push(template(this.templateString,{value:(this.min + (i * this.stepValue)).toFixed(stepDecimalPlaces)}));\n
\t\t\t}\n
\t\t},\n
\t\tgetCircumference : function(){\n
\t\t\treturn ((Math.PI*2) / this.valuesCount);\n
\t\t},\n
\t\tsetScaleSize: function(){\n
\t\t\t/*\n
\t\t\t * Right, this is really confusing and there is a lot of maths going on here\n
\t\t\t * The gist of the problem is here: https://gist.github.com/nnnick/696cc9c55f4b0beb8fe9\n
\t\t\t *\n
\t\t\t * Reaction: https://dl.dropboxusercontent.com/u/34601363/toomuchscience.gif\n
\t\t\t *\n
\t\t\t * Solution:\n
\t\t\t *\n
\t\t\t * We assume the radius of the polygon is half the size of the canvas at first\n
\t\t\t * at each index we check if the text overlaps.\n
\t\t\t *\n
\t\t\t * Where it does, we store that angle and that index.\n
\t\t\t *\n
\t\t\t * After finding the largest index and angle we calculate how much we need to remove\n
\t\t\t * from the shape radius to move the point inwards by that x.\n
\t\t\t *\n
\t\t\t * We average the left and right distances to get the maximum shape radius that can fit in the box\n
\t\t\t * along with labels.\n
\t\t\t *\n
\t\t\t * Once we have that, we can find the centre point for the chart, by taking the x text protrusion\n
\t\t\t * on each side, removing that from the size, halving it and adding the left x protrusion width.\n
\t\t\t *\n
\t\t\t * This will mean we have a shape fitted to the canvas, as large as it can be with the labels\n
\t\t\t * and position it in the most space efficient manner\n
\t\t\t *\n
\t\t\t * https://dl.dropboxusercontent.com/u/34601363/yeahscience.gif\n
\t\t\t */\n
\n
\n
\t\t\t// Get maximum radius of the polygon. Either half the height (minus the text width) or half the width.\n
\t\t\t// Use this to calculate the offset + change. - Make sure L/R protrusion is at least 0 to stop issues with centre points\n
\t\t\tvar largestPossibleRadius = min([(this.height/2 - this.pointLabelFontSize - 5), this.width/2]),\n
\t\t\t\tpointPosition,\n
\t\t\t\ti,\n
\t\t\t\ttextWidth,\n
\t\t\t\thalfTextWidth,\n
\t\t\t\tfurthestRight = this.width,\n
\t\t\t\tfurthestRightIndex,\n
\t\t\t\tfurthestRightAngle,\n
\t\t\t\tfurthestLeft = 0,\n
\t\t\t\tfurthestLeftIndex,\n
\t\t\t\tfurthestLeftAngle,\n
\t\t\t\txProtrusionLeft,\n
\t\t\t\txProtrusionRight,\n
\t\t\t\tradiusReductionRight,\n
\t\t\t\tradiusReductionLeft,\n
\t\t\t\tmaxWidthRadius;\n
\t\t\tthis.ctx.font = fontString(this.pointLabelFontSize,this.pointLabelFontStyle,this.pointLabelFontFamily);\n
\t\t\tfor (i=0;i<this.valuesCount;i++){\n
\t\t\t\t// 5px to space the text slightly out - similar to what we do in the draw function.\n
\t\t\t\tpointPosition = this.getPointPosition(i, largestPossibleRadius);\n
\t\t\t\ttextWidth = this.ctx.measureText(template(this.templateString, { value: this.labels[i] })).width + 5;\n
\t\t\t\tif (i === 0 || i === this.valuesCount/2){\n
\t\t\t\t\t// If we\'re at index zero, or exactly the middle, we\'re at exactly the top/bottom\n
\t\t\t\t\t// of the radar chart, so text will be aligned centrally, so we\'ll half it and compare\n
\t\t\t\t\t// w/left and right text sizes\n
\t\t\t\t\thalfTextWidth = textWidth/2;\n
\t\t\t\t\tif (pointPosition.x + halfTextWidth > furthestRight) {\n
\t\t\t\t\t\tfurthestRight = pointPosition.x + halfTextWidth;\n
\t\t\t\t\t\tfurthestRightIndex = i;\n
\t\t\t\t\t}\n
\t\t\t\t\tif (pointPosition.x - halfTextWidth < furthestLeft) {\n
\t\t\t\t\t\tfurthestLeft = pointPosition.x - halfTextWidth;\n
\t\t\t\t\t\tfurthestLeftIndex = i;\n
\t\t\t\t\t}\n
\t\t\t\t}\n
\t\t\t\telse if (i < this.valuesCount/2) {\n
\t\t\t\t\t// Less than half the values means we\'ll left align the text\n
\t\t\t\t\tif (pointPosition.x + textWidth > furthestRight) {\n
\t\t\t\t\t\tfurthestRight = pointPosition.x + textWidth;\n
\t\t\t\t\t\tfurthestRightIndex = i;\n
\t\t\t\t\t}\n
\t\t\t\t}\n
\t\t\t\telse if (i > this.valuesCount/2){\n
\t\t\t\t\t// More than half the values means we\'ll right align the text\n
\t\t\t\t\tif (pointPosition.x - textWidth < furthestLeft) {\n
\t\t\t\t\t\tfurthestLeft = pointPosition.x - textWidth;\n
\t\t\t\t\t\tfurthestLeftIndex = i;\n
\t\t\t\t\t}\n
\t\t\t\t}\n
\t\t\t}\n
\n
\t\t\txProtrusionLeft = furthestLeft;\n
\n
\t\t\txProtrusionRight = Math.ceil(furthestRight - this.width);\n
\n
\t\t\tfurthestRightAngle = this.getIndexAngle(furthestRightIndex);\n
\n
\t\t\tfurthestLeftAngle = this.getIndexAngle(furthestLeftIndex);\n
\n
\t\t\tradiusReductionRight = xProtrusionRight / Math.sin(furthestRightAngle + Math.PI/2);\n
\n
\t\t\tradiusReductionLeft = xProtrusionLeft / Math.sin(furthestLeftAngle + Math.PI/2);\n
\n
\t\t\t// Ensure we actually need to reduce the size of the chart\n
\t\t\tradiusReductionRight = (isNumber(radiusReductionRight)) ? radiusReductionRight : 0;\n
\t\t\tradiusReductionLeft = (isNumber(radiusReductionLeft)) ? radiusReductionLeft : 0;\n
\n
\t\t\tthis.drawingArea = largestPossibleRadius - (radiusReductionLeft + radiusReductionRight)/2;\n
\n
\t\t\t//this.drawingArea = min([maxWidthRadius, (this.height - (2 * (this.pointLabelFontSize + 5)))/2])\n
\t\t\tthis.setCenterPoint(radiusReductionLeft, radiusReductionRight);\n
\n
\t\t},\n
\t\tsetCenterPoint: function(leftMovement, rightMovement){\n
\n
\t\t\tvar maxRight = this.width - rightMovement - this.drawingArea,\n
\t\t\t\tmaxLeft = leftMovement + this.drawingArea;\n
\n
\t\t\tthis.xCenter = (maxLeft + maxRight)/2;\n
\t\t\t// Always vertically in the centre as the text height doesn\'t change\n
\t\t\tthis.yCenter = (this.height/2);\n
\t\t},\n
\n
\t\tgetIndexAngle : function(index){\n
\t\t\tvar angleMultiplier = (Math.PI * 2) / this.valuesCount;\n
\t\t\t// Start from the top instead of right, so remove a quarter of the circle\n
\n
\t\t\treturn index * angleMultiplier - (Math.PI/2);\n
\t\t},\n
\t\tgetPointPosition : function(index, distanceFromCenter){\n
\t\t\tvar thisAngle = this.getIndexAngle(index);\n
\t\t\treturn {\n
\t\t\t\tx : (Math.cos(thisAngle) * distanceFromCenter) + this.xCenter,\n
\t\t\t\ty : (Math.sin(thisAngle) * distanceFromCenter) + this.yCenter\n
\t\t\t};\n
\t\t},\n
\t\tdraw: function(){\n
\t\t\tif (this.display){\n
\t\t\t\tvar ctx = this.ctx;\n
\t\t\t\teach(this.yLabels, function(label, index){\n
\t\t\t\t\t// Don\'t draw a centre value\n
\t\t\t\t\tif (index > 0){\n
\t\t\t\t\t\tvar yCenterOffset = index * (this.drawingArea/this.steps),\n
\t\t\t\t\t\t\tyHeight = this.yCenter - yCenterOffset,\n
\t\t\t\t\t\t\tpointPosition;\n
\n
\t\t\t\t\t\t// Draw circular lines around the scale\n
\t\t\t\t\t\tif (this.lineWidth > 0){\n
\t\t\t\t\t\t\tctx.strokeStyle = this.lineColor;\n
\t\t\t\t\t\t\tctx.lineWidth = this.lineWidth;\n
\n
\t\t\t\t\t\t\tif(this.lineArc){\n
\t\t\t\t\t\t\t\tctx.beginPath();\n
\t\t\t\t\t\t\t\tctx.arc(this.xCenter, this.yCenter, yCenterOffset, 0, Math.PI*2);\n
\t\t\t\t\t\t\t\tctx.closePath();\n
\t\t\t\t\t\t\t\tctx.stroke();\n
\t\t\t\t\t\t\t} else{\n
\t\t\t\t\t\t\t\tctx.beginPath();\n
\t\t\t\t\t\t\t\tfor (var i=0;i<this.valuesCount;i++)\n
\t\t\t\t\t\t\t\t{\n
\t\t\t\t\t\t\t\t\tpointPosition = this.getPointPosition(i, this.calculateCenterOffset(this.min + (index * this.stepValue)));\n
\t\t\t\t\t\t\t\t\tif (i === 0){\n
\t\t\t\t\t\t\t\t\t\tctx.moveTo(pointPosition.x, pointPosition.y);\n
\t\t\t\t\t\t\t\t\t} else {\n
\t\t\t\t\t\t\t\t\t\tctx.lineTo(pointPosition.x, pointPosition.y);\n
\t\t\t\t\t\t\t\t\t}\n
\t\t\t\t\t\t\t\t}\n
\t\t\t\t\t\t\t\tctx.closePath();\n
\t\t\t\t\t\t\t\tctx.stroke();\n
\t\t\t\t\t\t\t}\n
\t\t\t\t\t\t}\n
\t\t\t\t\t\tif(this.showLabels){\n
\t\t\t\t\t\t\tctx.font = fontString(this.fontSize,this.fontStyle,this.fontFamily);\n
\t\t\t\t\t\t\tif (this.showLabelBackdrop){\n
\t\t\t\t\t\t\t\tvar labelWidth = ctx.measureText(label).width;\n
\t\t\t\t\t\t\t\tctx.fillStyle = this.backdropColor;\n
\t\t\t\t\t\t\t\tctx.fillRect(\n
\t\t\t\t\t\t\t\t\tthis.xCenter - labelWidth/2 - this.backdropPaddingX,\n
\t\t\t\t\t\t\t\t\tyHeight - this.fontSize/2 - this.backdropPaddingY,\n
\t\t\t\t\t\t\t\t\tlabelWidth + this.backdropPaddingX*2,\n
\t\t\t\t\t\t\t\t\tthis.fontSize + this.backdropPaddingY*2\n
\t\t\t\t\t\t\t\t);\n
\t\t\t\t\t\t\t}\n
\t\t\t\t\t\t\tctx.textAlign = \'center\';\n
\t\t\t\t\t\t\tctx.textBaseline = "middle";\n
\t\t\t\t\t\t\tctx.fillStyle = this.fontColor;\n
\t\t\t\t\t\t\tctx.fillText(label, this.xCenter, yHeight);\n
\t\t\t\t\t\t}\n
\t\t\t\t\t}\n
\t\t\t\t}, this);\n
\n
\t\t\t\tif (!this.lineArc){\n
\t\t\t\t\tctx.lineWidth = this.angleLineWidth;\n
\t\t\t\t\tctx.strokeStyle = this.angleLineColor;\n
\t\t\t\t\tfor (var i = this.valuesCount - 1; i >= 0; i--) {\n
\t\t\t\t\t\tif (this.angleLineWidth > 0){\n
\t\t\t\t\t\t\tvar outerPosition = this.getPointPosition(i, this.calculateCenterOffset(this.max));\n
\t\t\t\t\t\t\tctx.beginPath();\n
\t\t\t\t\t\t\tctx.moveTo(this.xCenter, this.yCenter);\n
\t\t\t\t\t\t\tctx.lineTo(outerPosition.x, outerPosition.y);\n
\t\t\t\t\t\t\tctx.stroke();\n
\t\t\t\t\t\t\tctx.closePath();\n
\t\t\t\t\t\t}\n
\t\t\t\t\t\t// Extra 3px out for some label spacing\n
\t\t\t\t\t\tvar pointLabelPosition = this.getPointPosition(i, this.calculateCenterOffset(this.max) + 5);\n
\t\t\t\t\t\tctx.font = fontString(this.pointLabelFontSize,this.pointLabelFontStyle,this.pointLabelFontFamily);\n
\t\t\t\t\t\tctx.fillStyle = this.pointLabelFontColor;\n
\n
\t\t\t\t\t\tvar labelsCount = this.labels.length,\n
\t\t\t\t\t\t\thalfLabelsCount = this.labels.length/2,\n
\t\t\t\t\t\t\tquarterLabelsCount = halfLabelsCount/2,\n
\t\t\t\t\t\t\tupperHalf = (i < quarterLabelsCount || i > labelsCount - quarterLabelsCount),\n
\t\t\t\t\t\t\texactQuarter = (i === quarterLabelsCount || i === labelsCount - quarterLabelsCount);\n
\t\t\t\t\t\tif (i === 0){\n
\t\t\t\t\t\t\tctx.textAlign = \'center\';\n
\t\t\t\t\t\t} else if(i === halfLabelsCount){\n
\t\t\t\t\t\t\tctx.textAlign = \'center\';\n
\t\t\t\t\t\t} else if (i < halfLabelsCount){\n
\t\t\t\t\t\t\tctx.textAlign = \'left\';\n
\t\t\t\t\t\t} else {\n
\t\t\t\t\t\t\tctx.textAlign = \'right\';\n
\t\t\t\t\t\t}\n
\n
\t\t\t\t\t\t// Set the correct text baseline based on outer positioning\n
\t\t\t\t\t\tif (exactQuarter){\n
\t\t\t\t\t\t\tctx.textBaseline = \'middle\';\n
\t\t\t\t\t\t} else if (upperHalf){\n
\t\t\t\t\t\t\tctx.textBaseline = \'bottom\';\n
\t\t\t\t\t\t} else {\n
\t\t\t\t\t\t\tctx.textBaseline = \'top\';\n
\t\t\t\t\t\t}\n
\n
\t\t\t\t\t\tctx.fillText(this.labels[i], pointLabelPosition.x, pointLabelPosition.y);\n
\t\t\t\t\t}\n
\t\t\t\t}\n
\t\t\t}\n
\t\t}\n
\t});\n
\n
\tChart.animationService = {\n
\t\tframeDuration: 17,\n
\t\tanimations: [],\n
\t\tdropFrames: 0,\n
\t\taddAnimation: function(chartInstance, animationObject) {\n
\t\t\tfor (var index = 0; index < this.animations.length; ++ index){\n
\t\t\t\tif (this.animations[index].chartInstance === chartInstance){\n
\t\t\t\t\t// replacing an in progress animation\n
\t\t\t\t\tthis.animations[index].animationObject = animationObject;\n
\t\t\t\t\treturn;\n
\t\t\t\t}\n
\t\t\t}\n
\t\t\t\n
\t\t\tthis.animations.push({\n
\t\t\t\tchartInstance: chartInstance,\n
\t\t\t\tanimationObject: animationObject\n
\t\t\t});\n
\n
\t\t\t// If there are no animations queued, manually kickstart a digest, for lack of a better word\n
\t\t\tif (this.animations.length == 1) {\n
\t\t\t\thelpers.requestAnimFrame.call(window, this.digestWrapper);\n
\t\t\t}\n
\t\t},\n
\t\t// Cancel the animation for a given chart instance\n
\t\tcancelAnimation: function(chartInstance) {\n
\t\t\tvar index = helpers.findNextWhere(this.animations, function(animationWrapper) {\n
\t\t\t\treturn animationWrapper.chartInstance === chartInstance;\n
\t\t\t});\n
\t\t\t\n
\t\t\tif (index)\n
\t\t\t{\n
\t\t\t\tthis.animations.splice(index, 1);\n
\t\t\t}\n
\t\t},\n
\t\t// calls startDigest with the proper context\n
\t\tdigestWrapper: function() {\n
\t\t\tChart.animationService.startDigest.call(Chart.animationService);\n
\t\t},\n
\t\tstartDigest: function() {\n
\n
\t\t\tvar startTime = Date.now();\n
\t\t\tvar framesToDrop = 0;\n
\n
\t\t\tif(this.dropFrames > 1){\n
\t\t\t\tframesToDrop = Math.floor(this.dropFrames);\n
\t\t\t\tthis.dropFrames -= framesToDrop;\n
\t\t\t}\n
\n
\t\t\tfor (var i = 0; i < this.animations.length; i++) {\n
\n
\t\t\t\tif (this.animations[i].animationObject.currentStep === null){\n
\t\t\t\t\tthis.animations[i].animationObject.currentStep = 0;\n
\t\t\t\t}\n
\n
\t\t\t\tthis.animations[i].animationObject.currentStep += 1 + framesToDrop;\n
\t\t\t\tif(this.animations[i].animationObject.currentStep > this.animations[i].animationObject.numSteps){\n
\t\t\t\t\tthis.animations[i].animationObject.currentStep = this.animations[i].animationObject.numSteps;\n
\t\t\t\t}\n
\t\t\t\t\n
\t\t\t\tthis.animations[i].animationObject.render(this.animations[i].chartInstance, this.animations[i].animationObject);\n
\t\t\t\t\n
\t\t\t\tif (this.animations[i].animationObject.currentStep == this.animations[i].animationObject.numSteps){\n
\t\t\t\t\t// executed the last frame. Remove the animation.\n
\t\t\t\t\tthis.animations.splice(i, 1);\n
\t\t\t\t\t// Keep the index in place to offset the splice\n
\t\t\t\t\ti--;\n
\t\t\t\t}\n
\t\t\t}\n
\n
\t\t\tvar endTime = Date.now();\n
\t\t\tvar delay = endTime - startTime - this.frameDuration;\n
\t\t\tvar frameDelay = delay / this.frameDuration;\n
\n
\t\t\tif(frameDelay > 1){\n
\t\t\t\tthis.dropFrames += frameDelay;\n
\t\t\t}\n
\n
\t\t\t// Do we have more stuff to animate?\n
\t\t\tif (this.animations.length > 0){\n
\t\t\t\thelpers.requestAnimFrame.call(window, this.digestWrapper);\n
\t\t\t}\n
\t\t}\n
\t};\n
\n
\t// Attach global event to resize each chart instance when the browser resizes\n
\thelpers.addEvent(window, "resize", (function(){\n
\t\t// Basic debounce of resize function so it doesn\'t hurt performance when resizing browser.\n
\t\tvar timeout;\n
\t\treturn function(){\n
\t\t\tclearTimeout(timeout);\n
\t\t\ttimeout = setTimeout(function(){\n
\t\t\t\teach(Chart.instances,function(instance){\n
\t\t\t\t\t// If the responsive flag is set in the chart instance config\n
\t\t\t\t\t// Cascade the resize event down to the chart.\n
\t\t\t\t\tif (instance.options.responsive){\n
\t\t\t\t\t\tinstance.resize(instance.render, true);\n
\t\t\t\t\t}\n
\t\t\t\t});\n
\t\t\t}, 50);\n
\t\t};\n
\t})());\n
\n
\n
\tif (amd) {\n
\t\tdefine(function(){\n
\t\t\treturn Chart;\n
\t\t});\n
\t} else if (typeof module === \'object\' && module.exports) {\n
\t\tmodule.exports = Chart;\n
\t}\n
\n
\troot.Chart = Chart;\n
\n
\tChart.noConflict = function(){\n
\t\troot.Chart = previous;\n
\t\treturn Chart;\n
\t};\n
\n
}).call(this);\n
]]></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41271278.02</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Chart.Doughnut.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
(function(){\n
\t"use strict";\n
\n
\tvar root = this,\n
\t\tChart = root.Chart,\n
\t\t//Cache a local reference to Chart.helpers\n
\t\thelpers = Chart.helpers;\n
\n
\tvar defaultConfig = {\n
\t\t//Boolean - Whether we should show a stroke on each segment\n
\t\tsegmentShowStroke : true,\n
\n
\t\t//String - The colour of each segment stroke\n
\t\tsegmentStrokeColor : "#fff",\n
\n
\t\t//Number - The width of each segment stroke\n
\t\tsegmentStrokeWidth : 2,\n
\n
\t\t//The percentage of the chart that we cut out of the middle.\n
\t\tpercentageInnerCutout : 50,\n
\n
\t\t//Number - Amount of animation steps\n
\t\tanimationSteps : 100,\n
\n
\t\t//String - Animation easing effect\n
\t\tanimationEasing : "easeOutBounce",\n
\n
\t\t//Boolean - Whether we animate the rotation of the Doughnut\n
\t\tanimateRotate : true,\n
\n
\t\t//Boolean - Whether we animate scaling the Doughnut from the centre\n
\t\tanimateScale : false,\n
\n
\t\t//String - A legend template\n
\t\tlegendTemplate : "<ul class=\\"<%=name.toLowerCase()%>-legend\\"><% for (var i=0; i<segments.length; i++){%><li><span style=\\"background-color:<%=segments[i].fillColor%>\\"><%if(segments[i].label){%><%=segments[i].label%><%}%></span></li><%}%></ul>"\n
\n
\t};\n
\n
\tChart.Type.extend({\n
\t\t//Passing in a name registers this chart in the Chart namespace\n
\t\tname: "Doughnut",\n
\t\t//Providing a defaults will also register the deafults in the chart namespace\n
\t\tdefaults : defaultConfig,\n
\t\t//Initialize is fired when the chart is initialized - Data is passed in as a parameter\n
\t\t//Config is automatically merged by the core of Chart.js, and is available at this.options\n
\t\tinitialize: function(data){\n
\n
\t\t\t//Declare segments as a static property to prevent inheriting across the Chart type prototype\n
\t\t\tthis.segments = [];\n
\t\t\tthis.outerRadius = (helpers.min([this.chart.width,this.chart.height]) -\tthis.options.segmentStrokeWidth/2)/2;\n
\n
\t\t\tthis.SegmentArc = Chart.Arc.extend({\n
\t\t\t\tctx : this.chart.ctx,\n
\t\t\t\tx : this.chart.width/2,\n
\t\t\t\ty : this.chart.height/2\n
\t\t\t});\n
\n
\t\t\t//Set up tooltip events on the chart\n
\t\t\tif (this.options.showTooltips){\n
\t\t\t\thelpers.bindEvents(this, this.options.tooltipEvents, function(evt){\n
\t\t\t\t\tvar activeSegments = (evt.type !== \'mouseout\') ? this.getSegmentsAtEvent(evt) : [];\n
\n
\t\t\t\t\thelpers.each(this.segments,function(segment){\n
\t\t\t\t\t\tsegment.restore(["fillColor"]);\n
\t\t\t\t\t});\n
\t\t\t\t\thelpers.each(activeSegments,function(activeSegment){\n
\t\t\t\t\t\tactiveSegment.fillColor = activeSegment.highlightColor;\n
\t\t\t\t\t});\n
\t\t\t\t\tthis.showTooltip(activeSegments);\n
\t\t\t\t});\n
\t\t\t}\n
\t\t\tthis.calculateTotal(data);\n
\n
\t\t\thelpers.each(data,function(datapoint, index){\n
\t\t\t\tif (!datapoint.color) {\n
\t\t\t\t\tdatapoint.color = \'hsl(\' + (360 * index / data.length) + \', 100%, 50%)\';\n
\t\t\t\t}\n
\t\t\t\tthis.addData(datapoint, index, true);\n
\t\t\t},this);\n
\n
\t\t\tthis.render();\n
\t\t},\n
\t\tgetSegmentsAtEvent : function(e){\n
\t\t\tvar segmentsArray = [];\n
\n
\t\t\tvar location = helpers.getRelativePosition(e);\n
\n
\t\t\thelpers.each(this.segments,function(segment){\n
\t\t\t\tif (segment.inRange(location.x,location.y)) segmentsArray.push(segment);\n
\t\t\t},this);\n
\t\t\treturn segmentsArray;\n
\t\t},\n
\t\taddData : function(segment, atIndex, silent){\n
\t\t\tvar index = atIndex !== undefined ? atIndex : this.segments.length;\n
\t\t\tthis.segments.splice(index, 0, new this.SegmentArc({\n
\t\t\t\tvalue : segment.value,\n
\t\t\t\touterRadius : (this.options.animateScale) ? 0 : this.outerRadius,\n
\t\t\t\tinnerRadius : (this.options.animateScale) ? 0 : (this.outerRadius/100) * this.options.percentageInnerCutout,\n
\t\t\t\tfillColor : segment.color,\n
\t\t\t\thighlightColor : segment.highlight || segment.color,\n
\t\t\t\tshowStroke : this.options.segmentShowStroke,\n
\t\t\t\tstrokeWidth : this.options.segmentStrokeWidth,\n
\t\t\t\tstrokeColor : this.options.segmentStrokeColor,\n
\t\t\t\tstartAngle : Math.PI * 1.5,\n
\t\t\t\tcircumference : (this.options.animateRotate) ? 0 : this.calculateCircumference(segment.value),\n
\t\t\t\tlabel : segment.label\n
\t\t\t}));\n
\t\t\tif (!silent){\n
\t\t\t\tthis.reflow();\n
\t\t\t\tthis.update();\n
\t\t\t}\n
\t\t},\n
\t\tcalculateCircumference : function(value) {\n
\t\t\tif ( this.total > 0 ) {\n
\t\t\t\treturn (Math.PI*2)*(value / this.total);\n
\t\t\t} else {\n
\t\t\t\treturn 0;\n
\t\t\t}\n
\t\t},\n
\t\tcalculateTotal : function(data){\n
\t\t\tthis.total = 0;\n
\t\t\thelpers.each(data,function(segment){\n
\t\t\t\tthis.total += Math.abs(segment.value);\n
\t\t\t},this);\n
\t\t},\n
\t\tupdate : function(){\n
\t\t\tthis.calculateTotal(this.segments);\n
\n
\t\t\t// Reset any highlight colours before updating.\n
\t\t\thelpers.each(this.activeElements, function(activeElement){\n
\t\t\t\tactiveElement.restore([\'fillColor\']);\n
\t\t\t});\n
\n
\t\t\thelpers.each(this.segments,function(segment){\n
\t\t\t\tsegment.save();\n
\t\t\t});\n
\t\t\tthis.render();\n
\t\t},\n
\n
\t\tremoveData: function(atIndex){\n
\t\t\tvar indexToDelete = (helpers.isNumber(atIndex)) ? atIndex : this.segments.length-1;\n
\t\t\tthis.segments.splice(indexToDelete, 1);\n
\t\t\tthis.reflow();\n
\t\t\tthis.update();\n
\t\t},\n
\n
\t\treflow : function(){\n
\t\t\thelpers.extend(this.SegmentArc.prototype,{\n
\t\t\t\tx : this.chart.width/2,\n
\t\t\t\ty : this.chart.height/2\n
\t\t\t});\n
\t\t\tthis.outerRadius = (helpers.min([this.chart.width,this.chart.height]) -\tthis.options.segmentStrokeWidth/2)/2;\n
\t\t\thelpers.each(this.segments, function(segment){\n
\t\t\t\tsegment.update({\n
\t\t\t\t\touterRadius : this.outerRadius,\n
\t\t\t\t\tinnerRadius : (this.outerRadius/100) * this.options.percentageInnerCutout\n
\t\t\t\t});\n
\t\t\t}, this);\n
\t\t},\n
\t\tdraw : function(easeDecimal){\n
\t\t\tvar animDecimal = (easeDecimal) ? easeDecimal : 1;\n
\t\t\tthis.clear();\n
\t\t\thelpers.each(this.segments,function(segment,index){\n
\t\t\t\tsegment.transition({\n
\t\t\t\t\tcircumference : this.calculateCircumference(segment.value),\n
\t\t\t\t\touterRadius : this.outerRadius,\n
\t\t\t\t\tinnerRadius : (this.outerRadius/100) * this.options.percentageInnerCutout\n
\t\t\t\t},animDecimal);\n
\n
\t\t\t\tsegment.endAngle = segment.startAngle + segment.circumference;\n
\n
\t\t\t\tsegment.draw();\n
\t\t\t\tif (index === 0){\n
\t\t\t\t\tsegment.startAngle = Math.PI * 1.5;\n
\t\t\t\t}\n
\t\t\t\t//Check to see if it\'s the last segment, if not get the next and update the start angle\n
\t\t\t\tif (index < this.segments.length-1){\n
\t\t\t\t\tthis.segments[index+1].startAngle = segment.endAngle;\n
\t\t\t\t}\n
\t\t\t},this);\n
\n
\t\t}\n
\t});\n
\n
\tChart.types.Doughnut.extend({\n
\t\tname : "Pie",\n
\t\tdefaults : helpers.merge(defaultConfig,{percentageInnerCutout : 0})\n
\t});\n
\n
}).call(this);\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>6022</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Chart.Doughnut.js</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41271301.79</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Chart.Line.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
(function(){\n
\t"use strict";\n
\n
\tvar root = this,\n
\t\tChart = root.Chart,\n
\t\thelpers = Chart.helpers;\n
\n
\tvar defaultConfig = {\n
\n
\t\t///Boolean - Whether grid lines are shown across the chart\n
\t\tscaleShowGridLines : true,\n
\n
\t\t//String - Colour of the grid lines\n
\t\tscaleGridLineColor : "rgba(0,0,0,.05)",\n
\n
\t\t//Number - Width of the grid lines\n
\t\tscaleGridLineWidth : 1,\n
\n
\t\t//Boolean - Whether to show horizontal lines (except X axis)\n
\t\tscaleShowHorizontalLines: true,\n
\n
\t\t//Boolean - Whether to show vertical lines (except Y axis)\n
\t\tscaleShowVerticalLines: true,\n
\n
\t\t//Boolean - Whether the line is curved between points\n
\t\tbezierCurve : true,\n
\n
\t\t//Number - Tension of the bezier curve between points\n
\t\tbezierCurveTension : 0.4,\n
\n
\t\t//Boolean - Whether to show a dot for each point\n
\t\tpointDot : true,\n
\n
\t\t//Number - Radius of each point dot in pixels\n
\t\tpointDotRadius : 4,\n
\n
\t\t//Number - Pixel width of point dot stroke\n
\t\tpointDotStrokeWidth : 1,\n
\n
\t\t//Number - amount extra to add to the radius to cater for hit detection outside the drawn point\n
\t\tpointHitDetectionRadius : 20,\n
\n
\t\t//Boolean - Whether to show a stroke for datasets\n
\t\tdatasetStroke : true,\n
\n
\t\t//Number - Pixel width of dataset stroke\n
\t\tdatasetStrokeWidth : 2,\n
\n
\t\t//Boolean - Whether to fill the dataset with a colour\n
\t\tdatasetFill : true,\n
\n
\t\t//String - A legend template\n
\t\tlegendTemplate : "<ul class=\\"<%=name.toLowerCase()%>-legend\\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\\"background-color:<%=datasets[i].strokeColor%>\\"><%if(datasets[i].label){%><%=datasets[i].label%><%}%></span></li><%}%></ul>",\n
\n
\t\t//Boolean - Whether to horizontally center the label and point dot inside the grid\n
\t\toffsetGridLines : false\n
\n
\t};\n
\n
\n
\tChart.Type.extend({\n
\t\tname: "Line",\n
\t\tdefaults : defaultConfig,\n
\t\tinitialize: function(data){\n
\t\t\t//Declare the extension of the default point, to cater for the options passed in to the constructor\n
\t\t\tthis.PointClass = Chart.Point.extend({\n
\t\t\t\toffsetGridLines : this.options.offsetGridLines,\n
\t\t\t\tstrokeWidth : this.options.pointDotStrokeWidth,\n
\t\t\t\tradius : this.options.pointDotRadius,\n
\t\t\t\tdisplay: this.options.pointDot,\n
\t\t\t\thitDetectionRadius : this.options.pointHitDetectionRadius,\n
\t\t\t\tctx : this.chart.ctx,\n
\t\t\t\tinRange : function(mouseX){\n
\t\t\t\t\treturn (Math.pow(mouseX-this.x, 2) < Math.pow(this.radius + this.hitDetectionRadius,2));\n
\t\t\t\t}\n
\t\t\t});\n
\n
\t\t\tthis.datasets = [];\n
\n
\t\t\t//Set up tooltip events on the chart\n
\t\t\tif (this.options.showTooltips){\n
\t\t\t\thelpers.bindEvents(this, this.options.tooltipEvents, function(evt){\n
\t\t\t\t\tvar activePoints = (evt.type !== \'mouseout\') ? this.getPointsAtEvent(evt) : [];\n
\t\t\t\t\tthis.eachPoints(function(point){\n
\t\t\t\t\t\tpoint.restore([\'fillColor\', \'strokeColor\']);\n
\t\t\t\t\t});\n
\t\t\t\t\thelpers.each(activePoints, function(activePoint){\n
\t\t\t\t\t\tactivePoint.fillColor = activePoint.highlightFill;\n
\t\t\t\t\t\tactivePoint.strokeColor = activePoint.highlightStroke;\n
\t\t\t\t\t});\n
\t\t\t\t\tthis.showTooltip(activePoints);\n
\t\t\t\t});\n
\t\t\t}\n
\n
\t\t\t//Iterate through each of the datasets, and build this into a property of the chart\n
\t\t\thelpers.each(data.datasets,function(dataset){\n
\n
\t\t\t\tvar datasetObject = {\n
\t\t\t\t\tlabel : dataset.label || null,\n
\t\t\t\t\tfillColor : dataset.fillColor,\n
\t\t\t\t\tstrokeColor : dataset.strokeColor,\n
\t\t\t\t\tpointColor : dataset.pointColor,\n
\t\t\t\t\tpointStrokeColor : dataset.pointStrokeColor,\n
\t\t\t\t\tpoints : []\n
\t\t\t\t};\n
\n
\t\t\t\tthis.datasets.push(datasetObject);\n
\n
\n
\t\t\t\thelpers.each(dataset.data,function(dataPoint,index){\n
\t\t\t\t\t//Add a new point for each piece of data, passing any required data to draw.\n
\t\t\t\t\tdatasetObject.points.push(new this.PointClass({\n
\t\t\t\t\t\tvalue : dataPoint,\n
\t\t\t\t\t\tlabel : data.labels[index],\n
\t\t\t\t\t\tdatasetLabel: dataset.label,\n
\t\t\t\t\t\tstrokeColor : dataset.pointStrokeColor,\n
\t\t\t\t\t\tfillColor : dataset.pointColor,\n
\t\t\t\t\t\thighlightFill : dataset.pointHighlightFill || dataset.pointColor,\n
\t\t\t\t\t\thighlightStroke : dataset.pointHighlightStroke || dataset.pointStrokeColor\n
\t\t\t\t\t}));\n
\t\t\t\t},this);\n
\n
\t\t\t\tthis.buildScale(data.labels);\n
\n
\n
\t\t\t\tthis.eachPoints(function(point, index){\n
\t\t\t\t\thelpers.extend(point, {\n
\t\t\t\t\t\tx: this.scale.calculateX(index),\n
\t\t\t\t\t\ty: this.scale.endPoint\n
\t\t\t\t\t});\n
\t\t\t\t\tpoint.save();\n
\t\t\t\t}, this);\n
\n
\t\t\t},this);\n
\n
\n
\t\t\tthis.render();\n
\t\t},\n
\t\tupdate : function(){\n
\t\t\tthis.scale.update();\n
\t\t\t// Reset any highlight colours before updating.\n
\t\t\thelpers.each(this.activeElements, function(activeElement){\n
\t\t\t\tactiveElement.restore([\'fillColor\', \'strokeColor\']);\n
\t\t\t});\n
\t\t\tthis.eachPoints(function(point){\n
\t\t\t\tpoint.save();\n
\t\t\t});\n
\t\t\tthis.render();\n
\t\t},\n
\t\teachPoints : function(callback){\n
\t\t\thelpers.each(this.datasets,function(dataset){\n
\t\t\t\thelpers.each(dataset.points,callback,this);\n
\t\t\t},this);\n
\t\t},\n
\t\tgetPointsAtEvent : function(e){\n
\t\t\tvar pointsArray = [],\n
\t\t\t\teventPosition = helpers.getRelativePosition(e);\n
\t\t\thelpers.each(this.datasets,function(dataset){\n
\t\t\t\thelpers.each(dataset.points,function(point){\n
\t\t\t\t\tif (point.inRange(eventPosition.x,eventPosition.y)) pointsArray.push(point);\n
\t\t\t\t});\n
\t\t\t},this);\n
\t\t\treturn pointsArray;\n
\t\t},\n
\t\tbuildScale : function(labels){\n
\t\t\tvar self = this;\n
\n
\t\t\tvar dataTotal = function(){\n
\t\t\t\tvar values = [];\n
\t\t\t\tself.eachPoints(function(point){\n
\t\t\t\t\tvalues.push(point.value);\n
\t\t\t\t});\n
\n
\t\t\t\treturn values;\n
\t\t\t};\n
\n
\t\t\tvar scaleOptions = {\n
\t\t\t\ttemplateString : this.options.scaleLabel,\n
\t\t\t\theight : this.chart.height,\n
\t\t\t\twidth : this.chart.width,\n
\t\t\t\tctx : this.chart.ctx,\n
\t\t\t\ttextColor : this.options.scaleFontColor,\n
\t\t\t\toffsetGridLines : this.options.offsetGridLines,\n
\t\t\t\tfontSize : this.options.scaleFontSize,\n
\t\t\t\tfontStyle : this.options.scaleFontStyle,\n
\t\t\t\tfontFamily : this.options.scaleFontFamily,\n
\t\t\t\tvaluesCount : labels.length,\n
\t\t\t\tbeginAtZero : this.options.scaleBeginAtZero,\n
\t\t\t\tintegersOnly : this.options.scaleIntegersOnly,\n
\t\t\t\tcalculateYRange : function(currentHeight){\n
\t\t\t\t\tvar updatedRanges = helpers.calculateScaleRange(\n
\t\t\t\t\t\tdataTotal(),\n
\t\t\t\t\t\tcurrentHeight,\n
\t\t\t\t\t\tthis.fontSize,\n
\t\t\t\t\t\tthis.beginAtZero,\n
\t\t\t\t\t\tthis.integersOnly\n
\t\t\t\t\t);\n
\t\t\t\t\thelpers.extend(this, updatedRanges);\n
\t\t\t\t},\n
\t\t\t\txLabels : labels,\n
\t\t\t\tfont : helpers.fontString(this.options.scaleFontSize, this.options.scaleFontStyle, this.options.scaleFontFamily),\n
\t\t\t\tlineWidth : this.options.scaleLineWidth,\n
\t\t\t\tlineColor : this.options.scaleLineColor,\n
\t\t\t\tshowHorizontalLines : this.options.scaleShowHorizontalLines,\n
\t\t\t\tshowVerticalLines : this.options.scaleShowVerticalLines,\n
\t\t\t\tgridLineWidth : (this.options.scaleShowGridLines) ? this.options.scaleGridLineWidth : 0,\n
\t\t\t\tgridLineColor : (this.options.scaleShowGridLines) ? this.options.scaleGridLineColor : "rgba(0,0,0,0)",\n
\t\t\t\tpadding: (this.options.showScale) ? 0 : this.options.pointDotRadius + this.options.pointDotStrokeWidth,\n
\t\t\t\tshowLabels : this.options.scaleShowLabels,\n
\t\t\t\tdisplay : this.options.showScale\n
\t\t\t};\n
\n
\t\t\tif (this.options.scaleOverride){\n
\t\t\t\thelpers.extend(scaleOptions, {\n
\t\t\t\t\tcalculateYRange: helpers.noop,\n
\t\t\t\t\tsteps: this.options.scaleSteps,\n
\t\t\t\t\tstepValue: this.options.scaleStepWidth,\n
\t\t\t\t\tmin: this.options.scaleStartValue,\n
\t\t\t\t\tmax: this.options.scaleStartValue + (this.options.scaleSteps * this.options.scaleStepWidth)\n
\t\t\t\t});\n
\t\t\t}\n
\n
\n
\t\t\tthis.scale = new Chart.Scale(scaleOptions);\n
\t\t},\n
\t\taddData : function(valuesArray,label){\n
\t\t\t//Map the values array for each of the datasets\n
\n
\t\t\thelpers.each(valuesArray,function(value,datasetIndex){\n
\t\t\t\t//Add a new point for each piece of data, passing any required data to draw.\n
\t\t\t\tthis.datasets[datasetIndex].points.push(new this.PointClass({\n
\t\t\t\t\tvalue : value,\n
\t\t\t\t\tlabel : label,\n
\t\t\t\t\tdatasetLabel: this.datasets[datasetIndex].label,\n
\t\t\t\t\tx: this.scale.calculateX(this.scale.valuesCount+1),\n
\t\t\t\t\ty: this.scale.endPoint,\n
\t\t\t\t\tstrokeColor : this.datasets[datasetIndex].pointStrokeColor,\n
\t\t\t\t\tfillColor : this.datasets[datasetIndex].pointColor\n
\t\t\t\t}));\n
\t\t\t},this);\n
\n
\t\t\tthis.scale.addXLabel(label);\n
\t\t\t//Then re-render the chart.\n
\t\t\tthis.update();\n
\t\t},\n
\t\tremoveData : function(){\n
\t\t\tthis.scale.removeXLabel();\n
\t\t\t//Then re-render the chart.\n
\t\t\thelpers.each(this.datasets,function(dataset){\n
\t\t\t\tdataset.points.shift();\n
\t\t\t},this);\n
\t\t\tthis.update();\n
\t\t},\n
\t\treflow : function(){\n
\t\t\tvar newScaleProps = helpers.extend({\n
\t\t\t\theight : this.chart.height,\n
\t\t\t\twidth : this.chart.width\n
\t\t\t});\n
\t\t\tthis.scale.update(newScaleProps);\n
\t\t},\n
\t\tdraw : function(ease){\n
\t\t\tvar easingDecimal = ease || 1;\n
\t\t\tthis.clear();\n
\n
\t\t\tvar ctx = this.chart.ctx;\n
\n
\t\t\t// Some helper methods for getting the next/prev points\n
\t\t\tvar hasValue = function(item){\n
\t\t\t\treturn item.value !== null;\n
\t\t\t},\n
\t\t\tnextPoint = function(point, collection, index){\n
\t\t\t\treturn helpers.findNextWhere(collection, hasValue, index) || point;\n
\t\t\t},\n
\t\t\tpreviousPoint = function(point, collection, index){\n
\t\t\t\treturn helpers.findPreviousWhere(collection, hasValue, index) || point;\n
\t\t\t};\n
\n
\t\t\tif (!this.scale) return;\n
\t\t\tthis.scale.draw(easingDecimal);\n
\n
\n
\t\t\thelpers.each(this.datasets,function(dataset){\n
\t\t\t\tvar pointsWithValues = helpers.where(dataset.points, hasValue);\n
\n
\t\t\t\t//Transition each point first so that the line and point drawing isn\'t out of sync\n
\t\t\t\t//We can use this extra loop to calculate the control points of this dataset also in this loop\n
\n
\t\t\t\thelpers.each(dataset.points, function(point, index){\n
\t\t\t\t\tif (point.hasValue()){\n
\t\t\t\t\t\tpoint.transition({\n
\t\t\t\t\t\t\ty : this.scale.calculateY(point.value),\n
\t\t\t\t\t\t\tx : this.scale.calculateX(index)\n
\t\t\t\t\t\t}, easingDecimal);\n
\t\t\t\t\t}\n
\t\t\t\t},this);\n
\n
\n
\t\t\t\t// Control points need to be calculated in a separate loop, because we need to know the current x/y of the point\n
\t\t\t\t// This would cause issues when there is no animation, because the y of the next point would be 0, so beziers would be skewed\n
\t\t\t\tif (this.options.bezierCurve){\n
\t\t\t\t\thelpers.each(pointsWithValues, function(point, index){\n
\t\t\t\t\t\tvar tension = (index > 0 && index < pointsWithValues.length - 1) ? this.options.bezierCurveTension : 0;\n
\t\t\t\t\t\tpoint.controlPoints = helpers.splineCurve(\n
\t\t\t\t\t\t\tpreviousPoint(point, pointsWithValues, index),\n
\t\t\t\t\t\t\tpoint,\n
\t\t\t\t\t\t\tnextPoint(point, pointsWithValues, index),\n
\t\t\t\t\t\t\ttension\n
\t\t\t\t\t\t);\n
\n
\t\t\t\t\t\t// Prevent the bezier going outside of the bounds of the graph\n
\n
\t\t\t\t\t\t// Cap puter bezier handles to the upper/lower scale bounds\n
\t\t\t\t\t\tif (point.controlPoints.outer.y > this.scale.endPoint){\n
\t\t\t\t\t\t\tpoint.controlPoints.outer.y = this.scale.endPoint;\n
\t\t\t\t\t\t}\n
\t\t\t\t\t\telse if (point.controlPoints.outer.y < this.scale.startPoint){\n
\t\t\t\t\t\t\tpoint.controlPoints.outer.y = this.scale.startPoint;\n
\t\t\t\t\t\t}\n
\n
\t\t\t\t\t\t// Cap inner bezier handles to the upper/lower scale bounds\n
\t\t\t\t\t\tif (point.controlPoints.inner.y > this.scale.endPoint){\n
\t\t\t\t\t\t\tpoint.controlPoints.inner.y = this.scale.endPoint;\n
\t\t\t\t\t\t}\n
\t\t\t\t\t\telse if (point.controlPoints.inner.y < this.scale.startPoint){\n
\t\t\t\t\t\t\tpoint.controlPoints.inner.y = this.scale.startPoint;\n
\t\t\t\t\t\t}\n
\t\t\t\t\t},this);\n
\t\t\t\t}\n
\n
\n
\t\t\t\t//Draw the line between all the points\n
\t\t\t\tctx.lineWidth = this.options.datasetStrokeWidth;\n
\t\t\t\tctx.strokeStyle = dataset.strokeColor;\n
\t\t\t\tctx.beginPath();\n
\n
\t\t\t\thelpers.each(pointsWithValues, function(point, index){\n
\t\t\t\t\tif (index === 0){\n
\t\t\t\t\t\tctx.moveTo(point.x, point.y);\n
\t\t\t\t\t}\n
\t\t\t\t\telse{\n
\t\t\t\t\t\tif(this.options.bezierCurve){\n
\t\t\t\t\t\t\tvar previous = previousPoint(point, pointsWithValues, index);\n
\n
\t\t\t\t\t\t\tctx.bezierCurveTo(\n
\t\t\t\t\t\t\t\tprevious.controlPoints.outer.x,\n
\t\t\t\t\t\t\t\tprevious.controlPoints.outer.y,\n
\t\t\t\t\t\t\t\tpoint.controlPoints.inner.x,\n
\t\t\t\t\t\t\t\tpoint.controlPoints.inner.y,\n
\t\t\t\t\t\t\t\tpoint.x,\n
\t\t\t\t\t\t\t\tpoint.y\n
\t\t\t\t\t\t\t);\n
\t\t\t\t\t\t}\n
\t\t\t\t\t\telse{\n
\t\t\t\t\t\t\tctx.lineTo(point.x,point.y);\n
\t\t\t\t\t\t}\n
\t\t\t\t\t}\n
\t\t\t\t}, this);\n
\n
\t\t\t\tif (this.options.datasetStroke) {\n
\t\t\t\t\tctx.stroke();\n
\t\t\t\t}\n
\n
\t\t\t\tif (this.options.datasetFill && pointsWithValues.length > 0){\n
\t\t\t\t\t//Round off the line by going to the base of the chart, back to the start, then fill.\n
\t\t\t\t\tctx.lineTo(pointsWithValues[pointsWithValues.length - 1].x, this.scale.endPoint);\n
\t\t\t\t\tctx.lineTo(pointsWithValues[0].x, this.scale.endPoint);\n
\t\t\t\t\tctx.fillStyle = dataset.fillColor;\n
\t\t\t\t\tctx.closePath();\n
\t\t\t\t\tctx.fill();\n
\t\t\t\t}\n
\n
\t\t\t\t//Now draw the points over the line\n
\t\t\t\t//A little inefficient double looping, but better than the line\n
\t\t\t\t//lagging behind the point positions\n
\t\t\t\thelpers.each(pointsWithValues,function(point){\n
\t\t\t\t\tpoint.draw();\n
\t\t\t\t});\n
\t\t\t},this);\n
\t\t}\n
\t});\n
\n
\n
}).call(this);\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>12132</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Chart.Line.js</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41271279.2</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Chart.PolarArea.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
(function(){\n
\t"use strict";\n
\n
\tvar root = this,\n
\t\tChart = root.Chart,\n
\t\t//Cache a local reference to Chart.helpers\n
\t\thelpers = Chart.helpers;\n
\n
\tvar defaultConfig = {\n
\t\t//Boolean - Show a backdrop to the scale label\n
\t\tscaleShowLabelBackdrop : true,\n
\n
\t\t//String - The colour of the label backdrop\n
\t\tscaleBackdropColor : "rgba(255,255,255,0.75)",\n
\n
\t\t// Boolean - Whether the scale should begin at zero\n
\t\tscaleBeginAtZero : true,\n
\n
\t\t//Number - The backdrop padding above & below the label in pixels\n
\t\tscaleBackdropPaddingY : 2,\n
\n
\t\t//Number - The backdrop padding to the side of the label in pixels\n
\t\tscaleBackdropPaddingX : 2,\n
\n
\t\t//Boolean - Show line for each value in the scale\n
\t\tscaleShowLine : true,\n
\n
\t\t//Boolean - Stroke a line around each segment in the chart\n
\t\tsegmentShowStroke : true,\n
\n
\t\t//String - The colour of the stroke on each segment.\n
\t\tsegmentStrokeColor : "#fff",\n
\n
\t\t//Number - The width of the stroke value in pixels\n
\t\tsegmentStrokeWidth : 2,\n
\n
\t\t//Number - Amount of animation steps\n
\t\tanimationSteps : 100,\n
\n
\t\t//String - Animation easing effect.\n
\t\tanimationEasing : "easeOutBounce",\n
\n
\t\t//Boolean - Whether to animate the rotation of the chart\n
\t\tanimateRotate : true,\n
\n
\t\t//Boolean - Whether to animate scaling the chart from the centre\n
\t\tanimateScale : false,\n
\n
\t\t//String - A legend template\n
\t\tlegendTemplate : "<ul class=\\"<%=name.toLowerCase()%>-legend\\"><% for (var i=0; i<segments.length; i++){%><li><span style=\\"background-color:<%=segments[i].fillColor%>\\"><%if(segments[i].label){%><%=segments[i].label%><%}%></span></li><%}%></ul>"\n
\t};\n
\n
\n
\tChart.Type.extend({\n
\t\t//Passing in a name registers this chart in the Chart namespace\n
\t\tname: "PolarArea",\n
\t\t//Providing a defaults will also register the deafults in the chart namespace\n
\t\tdefaults : defaultConfig,\n
\t\t//Initialize is fired when the chart is initialized - Data is passed in as a parameter\n
\t\t//Config is automatically merged by the core of Chart.js, and is available at this.options\n
\t\tinitialize: function(data){\n
\t\t\tthis.segments = [];\n
\t\t\t//Declare segment class as a chart instance specific class, so it can share props for this instance\n
\t\t\tthis.SegmentArc = Chart.Arc.extend({\n
\t\t\t\tshowStroke : this.options.segmentShowStroke,\n
\t\t\t\tstrokeWidth : this.options.segmentStrokeWidth,\n
\t\t\t\tstrokeColor : this.options.segmentStrokeColor,\n
\t\t\t\tctx : this.chart.ctx,\n
\t\t\t\tinnerRadius : 0,\n
\t\t\t\tx : this.chart.width/2,\n
\t\t\t\ty : this.chart.height/2\n
\t\t\t});\n
\t\t\tthis.scale = new Chart.RadialScale({\n
\t\t\t\tdisplay: this.options.showScale,\n
\t\t\t\tfontStyle: this.options.scaleFontStyle,\n
\t\t\t\tfontSize: this.options.scaleFontSize,\n
\t\t\t\tfontFamily: this.options.scaleFontFamily,\n
\t\t\t\tfontColor: this.options.scaleFontColor,\n
\t\t\t\tshowLabels: this.options.scaleShowLabels,\n
\t\t\t\tshowLabelBackdrop: this.options.scaleShowLabelBackdrop,\n
\t\t\t\tbackdropColor: this.options.scaleBackdropColor,\n
\t\t\t\tbackdropPaddingY : this.options.scaleBackdropPaddingY,\n
\t\t\t\tbackdropPaddingX: this.options.scaleBackdropPaddingX,\n
\t\t\t\tlineWidth: (this.options.scaleShowLine) ? this.options.scaleLineWidth : 0,\n
\t\t\t\tlineColor: this.options.scaleLineColor,\n
\t\t\t\tlineArc: true,\n
\t\t\t\twidth: this.chart.width,\n
\t\t\t\theight: this.chart.height,\n
\t\t\t\txCenter: this.chart.width/2,\n
\t\t\t\tyCenter: this.chart.height/2,\n
\t\t\t\tctx : this.chart.ctx,\n
\t\t\t\ttemplateString: this.options.scaleLabel,\n
\t\t\t\tvaluesCount: data.length\n
\t\t\t});\n
\n
\t\t\tthis.updateScaleRange(data);\n
\n
\t\t\tthis.scale.update();\n
\n
\t\t\thelpers.each(data,function(segment,index){\n
\t\t\t\tthis.addData(segment,index,true);\n
\t\t\t},this);\n
\n
\t\t\t//Set up tooltip events on the chart\n
\t\t\tif (this.options.showTooltips){\n
\t\t\t\thelpers.bindEvents(this, this.options.tooltipEvents, function(evt){\n
\t\t\t\t\tvar activeSegments = (evt.type !== \'mouseout\') ? this.getSegmentsAtEvent(evt) : [];\n
\t\t\t\t\thelpers.each(this.segments,function(segment){\n
\t\t\t\t\t\tsegment.restore(["fillColor"]);\n
\t\t\t\t\t});\n
\t\t\t\t\thelpers.each(activeSegments,function(activeSegment){\n
\t\t\t\t\t\tactiveSegment.fillColor = activeSegment.highlightColor;\n
\t\t\t\t\t});\n
\t\t\t\t\tthis.showTooltip(activeSegments);\n
\t\t\t\t});\n
\t\t\t}\n
\n
\t\t\tthis.render();\n
\t\t},\n
\t\tgetSegmentsAtEvent : function(e){\n
\t\t\tvar segmentsArray = [];\n
\n
\t\t\tvar location = helpers.getRelativePosition(e);\n
\n
\t\t\thelpers.each(this.segments,function(segment){\n
\t\t\t\tif (segment.inRange(location.x,location.y)) segmentsArray.push(segment);\n
\t\t\t},this);\n
\t\t\treturn segmentsArray;\n
\t\t},\n
\t\taddData : function(segment, atIndex, silent){\n
\t\t\tvar index = atIndex || this.segments.length;\n
\n
\t\t\tthis.segments.splice(index, 0, new this.SegmentArc({\n
\t\t\t\tfillColor: segment.color,\n
\t\t\t\thighlightColor: segment.highlight || segment.color,\n
\t\t\t\tlabel: segment.label,\n
\t\t\t\tvalue: segment.value,\n
\t\t\t\touterRadius: (this.options.animateScale) ? 0 : this.scale.calculateCenterOffset(segment.value),\n
\t\t\t\tcircumference: (this.options.animateRotate) ? 0 : this.scale.getCircumference(),\n
\t\t\t\tstartAngle: Math.PI * 1.5\n
\t\t\t}));\n
\t\t\tif (!silent){\n
\t\t\t\tthis.reflow();\n
\t\t\t\tthis.update();\n
\t\t\t}\n
\t\t},\n
\t\tremoveData: function(atIndex){\n
\t\t\tvar indexToDelete = (helpers.isNumber(atIndex)) ? atIndex : this.segments.length-1;\n
\t\t\tthis.segments.splice(indexToDelete, 1);\n
\t\t\tthis.reflow();\n
\t\t\tthis.update();\n
\t\t},\n
\t\tcalculateTotal: function(data){\n
\t\t\tthis.total = 0;\n
\t\t\thelpers.each(data,function(segment){\n
\t\t\t\tthis.total += segment.value;\n
\t\t\t},this);\n
\t\t\tthis.scale.valuesCount = this.segments.length;\n
\t\t},\n
\t\tupdateScaleRange: function(datapoints){\n
\t\t\tvar valuesArray = [];\n
\t\t\thelpers.each(datapoints,function(segment){\n
\t\t\t\tvaluesArray.push(segment.value);\n
\t\t\t});\n
\n
\t\t\tvar scaleSizes = (this.options.scaleOverride) ?\n
\t\t\t\t{\n
\t\t\t\t\tsteps: this.options.scaleSteps,\n
\t\t\t\t\tstepValue: this.options.scaleStepWidth,\n
\t\t\t\t\tmin: this.options.scaleStartValue,\n
\t\t\t\t\tmax: this.options.scaleStartValue + (this.options.scaleSteps * this.options.scaleStepWidth)\n
\t\t\t\t} :\n
\t\t\t\thelpers.calculateScaleRange(\n
\t\t\t\t\tvaluesArray,\n
\t\t\t\t\thelpers.min([this.chart.width, this.chart.height])/2,\n
\t\t\t\t\tthis.options.scaleFontSize,\n
\t\t\t\t\tthis.options.scaleBeginAtZero,\n
\t\t\t\t\tthis.options.scaleIntegersOnly\n
\t\t\t\t);\n
\n
\t\t\thelpers.extend(\n
\t\t\t\tthis.scale,\n
\t\t\t\tscaleSizes,\n
\t\t\t\t{\n
\t\t\t\t\tsize: helpers.min([this.chart.width, this.chart.height]),\n
\t\t\t\t\txCenter: this.chart.width/2,\n
\t\t\t\t\tyCenter: this.chart.height/2\n
\t\t\t\t}\n
\t\t\t);\n
\n
\t\t},\n
\t\tupdate : function(){\n
\t\t\tthis.calculateTotal(this.segments);\n
\n
\t\t\thelpers.each(this.segments,function(segment){\n
\t\t\t\tsegment.save();\n
\t\t\t});\n
\t\t\t\n
\t\t\tthis.reflow();\n
\t\t\tthis.render();\n
\t\t},\n
\t\treflow : function(){\n
\t\t\thelpers.extend(this.SegmentArc.prototype,{\n
\t\t\t\tx : this.chart.width/2,\n
\t\t\t\ty : this.chart.height/2\n
\t\t\t});\n
\t\t\tthis.updateScaleRange(this.segments);\n
\t\t\tthis.scale.update();\n
\n
\t\t\thelpers.extend(this.scale,{\n
\t\t\t\txCenter: this.chart.width/2,\n
\t\t\t\tyCenter: this.chart.height/2\n
\t\t\t});\n
\n
\t\t\thelpers.each(this.segments, function(segment){\n
\t\t\t\tsegment.update({\n
\t\t\t\t\touterRadius : this.scale.calculateCenterOffset(segment.value)\n
\t\t\t\t});\n
\t\t\t}, this);\n
\n
\t\t},\n
\t\tdraw : function(ease){\n
\t\t\tvar easingDecimal = ease || 1;\n
\t\t\t//Clear & draw the canvas\n
\t\t\tthis.clear();\n
\t\t\thelpers.each(this.segments,function(segment, index){\n
\t\t\t\tsegment.transition({\n
\t\t\t\t\tcircumference : this.scale.getCircumference(),\n
\t\t\t\t\touterRadius : this.scale.calculateCenterOffset(segment.value)\n
\t\t\t\t},easingDecimal);\n
\n
\t\t\t\tsegment.endAngle = segment.startAngle + segment.circumference;\n
\n
\t\t\t\t// If we\'ve removed the first segment we need to set the first one to\n
\t\t\t\t// start at the top.\n
\t\t\t\tif (index === 0){\n
\t\t\t\t\tsegment.startAngle = Math.PI * 1.5;\n
\t\t\t\t}\n
\n
\t\t\t\t//Check to see if it\'s the last segment, if not get the next and update the start angle\n
\t\t\t\tif (index < this.segments.length - 1){\n
\t\t\t\t\tthis.segments[index+1].startAngle = segment.endAngle;\n
\t\t\t\t}\n
\t\t\t\tsegment.draw();\n
\t\t\t}, this);\n
\t\t\tthis.scale.draw();\n
\t\t}\n
\t});\n
\n
}).call(this);\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>7641</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Chart.PolarArea.js</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts41271286.24</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>Chart.Radar.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/javascript</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
(function(){\n
\t"use strict";\n
\n
\tvar root = this,\n
\t\tChart = root.Chart,\n
\t\thelpers = Chart.helpers;\n
\n
\n
\n
\tChart.Type.extend({\n
\t\tname: "Radar",\n
\t\tdefaults:{\n
\t\t\t//Boolean - Whether to show lines for each scale point\n
\t\t\tscaleShowLine : true,\n
\n
\t\t\t//Boolean - Whether we show the angle lines out of the radar\n
\t\t\tangleShowLineOut : true,\n
\n
\t\t\t//Boolean - Whether to show labels on the scale\n
\t\t\tscaleShowLabels : false,\n
\n
\t\t\t// Boolean - Whether the scale should begin at zero\n
\t\t\tscaleBeginAtZero : true,\n
\n
\t\t\t//String - Colour of the angle line\n
\t\t\tangleLineColor : "rgba(0,0,0,.1)",\n
\n
\t\t\t//Number - Pixel width of the angle line\n
\t\t\tangleLineWidth : 1,\n
\n
\t\t\t//String - Point label font declaration\n
\t\t\tpointLabelFontFamily : "\'Arial\'",\n
\n
\t\t\t//String - Point label font weight\n
\t\t\tpointLabelFontStyle : "normal",\n
\n
\t\t\t//Number - Point label font size in pixels\n
\t\t\tpointLabelFontSize : 10,\n
\n
\t\t\t//String - Point label font colour\n
\t\t\tpointLabelFontColor : "#666",\n
\n
\t\t\t//Boolean - Whether to show a dot for each point\n
\t\t\tpointDot : true,\n
\n
\t\t\t//Number - Radius of each point dot in pixels\n
\t\t\tpointDotRadius : 3,\n
\n
\t\t\t//Number - Pixel width of point dot stroke\n
\t\t\tpointDotStrokeWidth : 1,\n
\n
\t\t\t//Number - amount extra to add to the radius to cater for hit detection outside the drawn point\n
\t\t\tpointHitDetectionRadius : 20,\n
\n
\t\t\t//Boolean - Whether to show a stroke for datasets\n
\t\t\tdatasetStroke : true,\n
\n
\t\t\t//Number - Pixel width of dataset stroke\n
\t\t\tdatasetStrokeWidth : 2,\n
\n
\t\t\t//Boolean - Whether to fill the dataset with a colour\n
\t\t\tdatasetFill : true,\n
\n
\t\t\t//String - A legend template\n
\t\t\tlegendTemplate : "<ul class=\\"<%=name.toLowerCase()%>-legend\\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\\"background-color:<%=datasets[i].strokeColor%>\\"><%if(datasets[i].label){%><%=datasets[i].label%><%}%></span></li><%}%></ul>"\n
\n
\t\t},\n
\n
\t\tinitialize: function(data){\n
\t\t\tthis.PointClass = Chart.Point.extend({\n
\t\t\t\tstrokeWidth : this.options.pointDotStrokeWidth,\n
\t\t\t\tradius : this.options.pointDotRadius,\n
\t\t\t\tdisplay: this.options.pointDot,\n
\t\t\t\thitDetectionRadius : this.options.pointHitDetectionRadius,\n
\t\t\t\tctx : this.chart.ctx\n
\t\t\t});\n
\n
\t\t\tthis.datasets = [];\n
\n
\t\t\tthis.buildScale(data);\n
\n
\t\t\t//Set up tooltip events on the chart\n
\t\t\tif (this.options.showTooltips){\n
\t\t\t\thelpers.bindEvents(this, this.options.tooltipEvents, function(evt){\n
\t\t\t\t\tvar activePointsCollection = (evt.type !== \'mouseout\') ? this.getPointsAtEvent(evt) : [];\n
\n
\t\t\t\t\tthis.eachPoints(function(point){\n
\t\t\t\t\t\tpoint.restore([\'fillColor\', \'strokeColor\']);\n
\t\t\t\t\t});\n
\t\t\t\t\thelpers.each(activePointsCollection, function(activePoint){\n
\t\t\t\t\t\tactivePoint.fillColor = activePoint.highlightFill;\n
\t\t\t\t\t\tactivePoint.strokeColor = activePoint.highlightStroke;\n
\t\t\t\t\t});\n
\n
\t\t\t\t\tthis.showTooltip(activePointsCollection);\n
\t\t\t\t});\n
\t\t\t}\n
\n
\t\t\t//Iterate through each of the datasets, and build this into a property of the chart\n
\t\t\thelpers.each(data.datasets,function(dataset){\n
\n
\t\t\t\tvar datasetObject = {\n
\t\t\t\t\tlabel: dataset.label || null,\n
\t\t\t\t\tfillColor : dataset.fillColor,\n
\t\t\t\t\tstrokeColor : dataset.strokeColor,\n
\t\t\t\t\tpointColor : dataset.pointColor,\n
\t\t\t\t\tpointStrokeColor : dataset.pointStrokeColor,\n
\t\t\t\t\tpoints : []\n
\t\t\t\t};\n
\n
\t\t\t\tthis.datasets.push(datasetObject);\n
\n
\t\t\t\thelpers.each(dataset.data,function(dataPoint,index){\n
\t\t\t\t\t//Add a new point for each piece of data, passing any required data to draw.\n
\t\t\t\t\tvar pointPosition;\n
\t\t\t\t\tif (!this.scale.animation){\n
\t\t\t\t\t\tpointPosition = this.scale.getPointPosition(index, this.scale.calculateCenterOffset(dataPoint));\n
\t\t\t\t\t}\n
\t\t\t\t\tdatasetObject.points.push(new this.PointClass({\n
\t\t\t\t\t\tvalue : dataPoint,\n
\t\t\t\t\t\tlabel : data.labels[index],\n
\t\t\t\t\t\tdatasetLabel: dataset.label,\n
\t\t\t\t\t\tx: (this.options.animation) ? this.scale.xCenter : pointPosition.x,\n
\t\t\t\t\t\ty: (this.options.animation) ? this.scale.yCenter : pointPosition.y,\n
\t\t\t\t\t\tstrokeColor : dataset.pointStrokeColor,\n
\t\t\t\t\t\tfillColor : dataset.pointColor,\n
\t\t\t\t\t\thighlightFill : dataset.pointHighlightFill || dataset.pointColor,\n
\t\t\t\t\t\thighlightStroke : dataset.pointHighlightStroke || dataset.pointStrokeColor\n
\t\t\t\t\t}));\n
\t\t\t\t},this);\n
\n
\t\t\t},this);\n
\n
\t\t\tthis.render();\n
\t\t},\n
\t\teachPoints : function(callback){\n
\t\t\thelpers.each(this.datasets,function(dataset){\n
\t\t\t\thelpers.each(dataset.points,callback,this);\n
\t\t\t},this);\n
\t\t},\n
\n
\t\tgetPointsAtEvent : function(evt){\n
\t\t\tvar mousePosition = helpers.getRelativePosition(evt),\n
\t\t\t\tfromCenter = helpers.getAngleFromPoint({\n
\t\t\t\t\tx: this.scale.xCenter,\n
\t\t\t\t\ty: this.scale.yCenter\n
\t\t\t\t}, mousePosition);\n
\n
\t\t\tvar anglePerIndex = (Math.PI * 2) /this.scale.valuesCount,\n
\t\t\t\tpointIndex = Math.round((fromCenter.angle - Math.PI * 1.5) / anglePerIndex),\n
\t\t\t\tactivePointsCollection = [];\n
\n
\t\t\t// If we\'re at the top, make the pointIndex 0 to get the first of the array.\n
\t\t\tif (pointIndex >= this.scale.valuesCount || pointIndex < 0){\n
\t\t\t\tpointIndex = 0;\n
\t\t\t}\n
\n
\t\t\tif (fromCenter.distance <= this.scale.drawingArea){\n
\t\t\t\thelpers.each(this.datasets, function(dataset){\n
\t\t\t\t\tactivePointsCollection.push(dataset.points[pointIndex]);\n
\t\t\t\t});\n
\t\t\t}\n
\n
\t\t\treturn activePointsCollection;\n
\t\t},\n
\n
\t\tbuildScale : function(data){\n
\t\t\tthis.scale = new Chart.RadialScale({\n
\t\t\t\tdisplay: this.options.showScale,\n
\t\t\t\tfontStyle: this.options.scaleFontStyle,\n
\t\t\t\tfontSize: this.options.scaleFontSize,\n
\t\t\t\tfontFamily: this.options.scaleFontFamily,\n
\t\t\t\tfontColor: this.options.scaleFontColor,\n
\t\t\t\tshowLabels: this.options.scaleShowLabels,\n
\t\t\t\tshowLabelBackdrop: this.options.scaleShowLabelBackdrop,\n
\t\t\t\tbackdropColor: this.options.scaleBackdropColor,\n
\t\t\t\tbackdropPaddingY : this.options.scaleBackdropPaddingY,\n
\t\t\t\tbackdropPaddingX: this.options.scaleBackdropPaddingX,\n
\t\t\t\tlineWidth: (this.options.scaleShowLine) ? this.options.scaleLineWidth : 0,\n
\t\t\t\tlineColor: this.options.scaleLineColor,\n
\t\t\t\tangleLineColor : this.options.angleLineColor,\n
\t\t\t\tangleLineWidth : (this.options.angleShowLineOut) ? this.options.angleLineWidth : 0,\n
\t\t\t\t// Point labels at the edge of each line\n
\t\t\t\tpointLabelFontColor : this.options.pointLabelFontColor,\n
\t\t\t\tpointLabelFontSize : this.options.pointLabelFontSize,\n
\t\t\t\tpointLabelFontFamily : this.options.pointLabelFontFamily,\n
\t\t\t\tpointLabelFontStyle : this.options.pointLabelFontStyle,\n
\t\t\t\theight : this.chart.height,\n
\t\t\t\twidth: this.chart.width,\n
\t\t\t\txCenter: this.chart.width/2,\n
\t\t\t\tyCenter: this.chart.height/2,\n
\t\t\t\tctx : this.chart.ctx,\n
\t\t\t\ttemplateString: this.options.scaleLabel,\n
\t\t\t\tlabels: data.labels,\n
\t\t\t\tvaluesCount: data.datasets[0].data.length\n
\t\t\t});\n
\n
\t\t\tthis.scale.setScaleSize();\n
\t\t\tthis.updateScaleRange(data.datasets);\n
\t\t\tthis.scale.buildYLabels();\n
\t\t},\n
\t\tupdateScaleRange: function(datasets){\n
\t\t\tvar valuesArray = (function(){\n
\t\t\t\tvar totalDataArray = [];\n
\t\t\t\thelpers.each(datasets,function(dataset){\n
\t\t\t\t\tif (dataset.data){\n
\t\t\t\t\t\ttotalDataArray = totalDataArray.concat(dataset.data);\n
\t\t\t\t\t}\n
\t\t\t\t\telse {\n
\t\t\t\t\t\thelpers.each(dataset.points, function(point){\n
\t\t\t\t\t\t\ttotalDataArray.push(point.value);\n
\t\t\t\t\t\t});\n
\t\t\t\t\t}\n
\t\t\t\t});\n
\t\t\t\treturn totalDataArray;\n
\t\t\t})();\n
\n
\n
\t\t\tvar scaleSizes = (this.options.scaleOverride) ?\n
\t\t\t\t{\n
\t\t\t\t\tsteps: this.options.scaleSteps,\n
\t\t\t\t\tstepValue: this.options.scaleStepWidth,\n
\t\t\t\t\tmin: this.options.scaleStartValue,\n
\t\t\t\t\tmax: this.options.scaleStartValue + (this.options.scaleSteps * this.options.scaleStepWidth)\n
\t\t\t\t} :\n
\t\t\t\thelpers.calculateScaleRange(\n
\t\t\t\t\tvaluesArray,\n
\t\t\t\t\thelpers.min([this.chart.width, this.chart.height])/2,\n
\t\t\t\t\tthis.options.scaleFontSize,\n
\t\t\t\t\tthis.options.scaleBeginAtZero,\n
\t\t\t\t\tthis.options.scaleIntegersOnly\n
\t\t\t\t);\n
\n
\t\t\thelpers.extend(\n
\t\t\t\tthis.scale,\n
\t\t\t\tscaleSizes\n
\t\t\t);\n
\n
\t\t},\n
\t\taddData : function(valuesArray,label){\n
\t\t\t//Map the values array for each of the datasets\n
\t\t\tthis.scale.valuesCount++;\n
\t\t\thelpers.each(valuesArray,function(value,datasetIndex){\n
\t\t\t\tvar pointPosition = this.scale.getPointPosition(this.scale.valuesCount, this.scale.calculateCenterOffset(value));\n
\t\t\t\tthis.datasets[datasetIndex].points.push(new this.PointClass({\n
\t\t\t\t\tvalue : value,\n
\t\t\t\t\tlabel : label,\n
\t\t\t\t\tdatasetLabel: this.datasets[datasetIndex].label,\n
\t\t\t\t\tx: pointPosition.x,\n
\t\t\t\t\ty: pointPosition.y,\n
\t\t\t\t\tstrokeColor : this.datasets[datasetIndex].pointStrokeColor,\n
\t\t\t\t\tfillColor : this.datasets[datasetIndex].pointColor\n
\t\t\t\t}));\n
\t\t\t},this);\n
\n
\t\t\tthis.scale.labels.push(label);\n
\n
\t\t\tthis.reflow();\n
\n
\t\t\tthis.update();\n
\t\t},\n
\t\tremoveData : function(){\n
\t\t\tthis.scale.valuesCount--;\n
\t\t\tthis.scale.labels.shift();\n
\t\t\thelpers.each(this.datasets,function(dataset){\n
\t\t\t\tdataset.points.shift();\n
\t\t\t},this);\n
\t\t\tthis.reflow();\n
\t\t\tthis.update();\n
\t\t},\n
\t\tupdate : function(){\n
\t\t\tthis.eachPoints(function(point){\n
\t\t\t\tpoint.save();\n
\t\t\t});\n
\t\t\tthis.reflow();\n
\t\t\tthis.render();\n
\t\t},\n
\t\treflow: function(){\n
\t\t\thelpers.extend(this.scale, {\n
\t\t\t\twidth : this.chart.width,\n
\t\t\t\theight: this.chart.height,\n
\t\t\t\tsize : helpers.min([this.chart.width, this.chart.height]),\n
\t\t\t\txCenter: this.chart.width/2,\n
\t\t\t\tyCenter: this.chart.height/2\n
\t\t\t});\n
\t\t\tthis.updateScaleRange(this.datasets);\n
\t\t\tthis.scale.setScaleSize();\n
\t\t\tthis.scale.buildYLabels();\n
\t\t},\n
\t\tdraw : function(ease){\n
\t\t\tvar easeDecimal = ease || 1,\n
\t\t\t\tctx = this.chart.ctx;\n
\t\t\tthis.clear();\n
\t\t\tthis.scale.draw();\n
\n
\t\t\thelpers.each(this.datasets,function(dataset){\n
\n
\t\t\t\t//Transition each point first so that the line and point drawing isn\'t out of sync\n
\t\t\t\thelpers.each(dataset.points,function(point,index){\n
\t\t\t\t\tif (point.hasValue()){\n
\t\t\t\t\t\tpoint.transition(this.scale.getPointPosition(index, this.scale.calculateCenterOffset(point.value)), easeDecimal);\n
\t\t\t\t\t}\n
\t\t\t\t},this);\n
\n
\n
\n
\t\t\t\t//Draw the line between all the points\n
\t\t\t\tctx.lineWidth = this.options.datasetStrokeWidth;\n
\t\t\t\tctx.strokeStyle = dataset.strokeColor;\n
\t\t\t\tctx.beginPath();\n
\t\t\t\thelpers.each(dataset.points,function(point,index){\n
\t\t\t\t\tif (index === 0){\n
\t\t\t\t\t\tctx.moveTo(point.x,point.y);\n
\t\t\t\t\t}\n
\t\t\t\t\telse{\n
\t\t\t\t\t\tctx.lineTo(point.x,point.y);\n
\t\t\t\t\t}\n
\t\t\t\t},this);\n
\t\t\t\tctx.closePath();\n
\t\t\t\tctx.stroke();\n
\n
\t\t\t\tctx.fillStyle = dataset.fillColor;\n
\t\t\t\tif(this.options.datasetFill){\n
\t\t\t\t\tctx.fill();\n
\t\t\t\t}\n
\t\t\t\t//Now draw the points over the line\n
\t\t\t\t//A little inefficient double looping, but better than the line\n
\t\t\t\t//lagging behind the point positions\n
\t\t\t\thelpers.each(dataset.points,function(point){\n
\t\t\t\t\tif (point.hasValue()){\n
\t\t\t\t\t\tpoint.draw();\n
\t\t\t\t\t}\n
\t\t\t\t});\n
\n
\t\t\t},this);\n
\n
\t\t}\n
\n
\t});\n
\n
\n
\n
\n
\n
}).call(this);\n
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>10184</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Chart.Radar.js</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment