bremen_short_url/BackEnd/assets/javascript/pages/chartjs-scatter-demo.min.js

3 lines
3.7 KiB
JavaScript

"use strict";function _classCallCheck(a,t){if(!(a instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(a,o.key,o)}}function _createClass(a,t,r){return t&&_defineProperties(a.prototype,t),r&&_defineProperties(a,r),a}var ChartjsScatterDemo=function(){function a(){_classCallCheck(this,a),this.init()}return _createClass(a,[{key:"init",value:function(){this.scatterChart(),this.scatterMultiAxisChart()}},{key:"randomScalingFactor",value:function(){return(.5<Math.random()?1:-1)*Math.round(100*Math.random())}},{key:"months",value:function(){return["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}},{key:"scatterChart",value:function(){var a={datasets:[{label:"My First dataset",borderColor:Looper.colors.brand.purple,backgroundColor:Looper.colors.brand.purple,data:[{x:this.randomScalingFactor(),y:this.randomScalingFactor()},{x:this.randomScalingFactor(),y:this.randomScalingFactor()},{x:this.randomScalingFactor(),y:this.randomScalingFactor()},{x:this.randomScalingFactor(),y:this.randomScalingFactor()},{x:this.randomScalingFactor(),y:this.randomScalingFactor()},{x:this.randomScalingFactor(),y:this.randomScalingFactor()},{x:this.randomScalingFactor(),y:this.randomScalingFactor()}]},{label:"My Second dataset",borderColor:Looper.colors.brand.teal,backgroundColor:Looper.colors.brand.teal,data:[{x:this.randomScalingFactor(),y:this.randomScalingFactor()},{x:this.randomScalingFactor(),y:this.randomScalingFactor()},{x:this.randomScalingFactor(),y:this.randomScalingFactor()},{x:this.randomScalingFactor(),y:this.randomScalingFactor()},{x:this.randomScalingFactor(),y:this.randomScalingFactor()},{x:this.randomScalingFactor(),y:this.randomScalingFactor()},{x:this.randomScalingFactor(),y:this.randomScalingFactor()}]}]},t=$("#canvas-scatter")[0].getContext("2d");Chart.Scatter(t,{data:a,options:{title:{display:!0,text:"Scatter Chart"}}})}},{key:"scatterMultiAxisChart",value:function(){var a={datasets:[{label:"My First dataset",xAxisID:"x-axis-1",yAxisID:"y-axis-1",borderColor:Looper.colors.brand.purple,backgroundColor:Looper.colors.brand.purple,data:[{x:this.randomScalingFactor(),y:this.randomScalingFactor()},{x:this.randomScalingFactor(),y:this.randomScalingFactor()},{x:this.randomScalingFactor(),y:this.randomScalingFactor()},{x:this.randomScalingFactor(),y:this.randomScalingFactor()},{x:this.randomScalingFactor(),y:this.randomScalingFactor()},{x:this.randomScalingFactor(),y:this.randomScalingFactor()},{x:this.randomScalingFactor(),y:this.randomScalingFactor()}]},{label:"My Second dataset",xAxisID:"x-axis-1",yAxisID:"y-axis-2",borderColor:Looper.colors.brand.teal,backgroundColor:Looper.colors.brand.teal,data:[{x:this.randomScalingFactor(),y:this.randomScalingFactor()},{x:this.randomScalingFactor(),y:this.randomScalingFactor()},{x:this.randomScalingFactor(),y:this.randomScalingFactor()},{x:this.randomScalingFactor(),y:this.randomScalingFactor()},{x:this.randomScalingFactor(),y:this.randomScalingFactor()},{x:this.randomScalingFactor(),y:this.randomScalingFactor()},{x:this.randomScalingFactor(),y:this.randomScalingFactor()}]}]},t=$("#canvas-scatter-multi-axis")[0].getContext("2d");Chart.Scatter(t,{data:a,options:{hoverMode:"nearest",intersect:!0,title:{display:!0,text:"Scatter Chart - Multi Axis"},scales:{xAxes:[{position:"bottom",gridLines:{zeroLineColor:"rgba(0,0,0,1)"}}],yAxes:[{type:"linear",display:!0,position:"left",id:"y-axis-1"},{type:"linear",display:!0,position:"right",reverse:!0,id:"y-axis-2",gridLines:{drawOnChartArea:!1}}]}}})}}]),a}();$(document).on("theme:init",function(){new ChartjsScatterDemo});
//# sourceMappingURL=../../sourcemaps/pages/chartjs-scatter-demo.min.js.map