WordPress.org

Plugin Directory

Changeset 1675327


Ignore:
Timestamp:
06/10/17 07:34:50 (4 months ago)
Author:
kiranpotphode
Message:

Version update 1.2

Location:
easy-charts
Files:
202 added
5 edited

Legend:

Unmodified
Added
Removed
  • easy-charts/trunk/README.txt

    r1489677 r1675327  
    11=== Easy Charts === 
    22Contributors: kiranpotphode 
    3 Donate link: http://kiranpotphode.com/donate/ 
    43Tags: chart, graph, bar, line, pie, area, stacked, stacked bar, step up bar, percent bar, stacked area, percent area, donut, polar area, waterfall easy integration, uniform, data representation, simple, download as image, responsive 
    54Requires at least: 3.0 
    6 Tested up to: 4.6 
    7 Stable tag: 1.1 
     5Tested up to: 4.8 
     6Stable tag: 1.2 
    87License: GPLv2 or later 
    98License URI: http://www.gnu.org/licenses/gpl-2.0.html 
     
    7978== Changelog == 
    8079 
     80= 1.2 = 
     81*Release Date - 10th June, 2017* 
     82 
     83* Update the charts library. 
     84* New color palletes. 
     85 
    8186= 1.1 = 
    8287*Release Date - 4th September, 2016* 
  • easy-charts/trunk/admin/partials/easy-charts-configuration-metabox-display.php

    r1489677 r1675327  
    4242 
    4343                        $plugin->ec_render_field( 'radio', 'ec_chart_graph_responsive','Responsive', $ec_chart_graph['responsive'], array( 'Yes' => true, 'No' => false ) ); 
    44                         $plugin->ec_render_field( 'dropdown', 'ec_chart_graph_palette','Palette', $ec_chart_graph['palette'], array( 'Default' => 'Default', 'Plain' => 'Plain', 'Android' => 'Android', 'Simple' => 'Simple', 'Soft' => 'Soft', 'Egypt' => 'Egypt', 'Olive' => 'Olive', 'Candid' => 'Candid', 'Sulphide' => 'Sulphide', 'Lint' => 'Lint' ) ); 
     44                        $plugin->ec_render_field( 'dropdown', 'ec_chart_graph_palette','Palette', $ec_chart_graph['palette'], array( 'Default' => 'Default', 'OldDefault' => 'OldDefault', 'Plain' => 'Plain', 'Android' => 'Android', 'Simple' => 'Simple', 'Soft' => 'Soft', 'Egypt' => 'Egypt', 'Olive' => 'Olive', 'Candid' => 'Candid', 'Sulphide' => 'Sulphide', 'Lint' => 'Lint' ) ); 
    4545                        $plugin->ec_render_field( 'color-picker', 'ec_chart_graph_bgcolor','Background Color', $ec_chart_graph['bgcolor'] ); 
    4646                        $plugin->ec_render_field( 'radio', 'ec_chart_graph_orientation','Orientation', $ec_chart_graph['orientation'], array( 'Horizontal' => 'Horizontal', 'Vertical' => 'Vertical' ) ); 
  • easy-charts/trunk/easy-charts.php

    r1489677 r1675327  
    1010 * Plugin URI:        http://kiranpotphode.github.io/easy-charts/ 
    1111 * Description:       Build simple, reusable, customisable charts on any page or post with ease. 
    12  * Version:           1.1 
     12 * Version:           1.2 
    1313 * Author:            Kiran Potphode 
    14  * Author URI:        https://kiranpotphode.com/ 
    1514 * License:           GPL-2.0+ 
    1615 * License URI:       http://www.gnu.org/licenses/gpl-2.0.txt 
  • easy-charts/trunk/includes/js/uvcharts.js

    r1489677 r1675327  
    1 var uv = (function (){ 
    2   /** 
    3   * uv is the local namespace within the anonymous function, which holds everything else related to the library 
    4   * @type {Object} 
    5   */ 
     1(function(global, factory) { 
     2  if (typeof module === "object" && typeof module.exports === "object") { 
     3    module.exports = global.document? factory(global, true ): factory(global); 
     4  } else { 
     5    factory(global); 
     6  } 
     7}(typeof window !== "undefined" ? window: this, function(window, noGlobal) { 
     8  "use strict"; 
    69  var uv = {}; 
    710 
     
    5962  graphdef.categories.map(function (d) { 
    6063    graphdef.dataset[d].map(function (d, i) { 
     64      if (d.resetSum === true) { 
     65        sumMap[i] = 0; 
     66      } 
    6167      sumMap[i] += d.value; 
    6268      maxMap[i] = d3.max([sumMap[i], maxMap[i]]); 
     
    168174 
    169175uv.util.transposeData = function (graphdef) { 
    170   var dataset = {}, i, j, length, jlength, 
     176  var dataset = {}, i, j, length, jlength, resetSum, 
    171177    name, label, value, categories = graphdef.dataset[graphdef.categories[0]].map(function (d) { return d.name; }); 
    172178 
    173   for (i = 0, length = categories.length; i < length; i = i + 1) { dataset[categories[i]] = []; } 
     179  for (i = 0, length = categories.length; i < length; i = i + 1) { 
     180    dataset[categories[i]] = []; 
     181  } 
    174182 
    175183  for (i = 0, length = graphdef.categories.length; i < length; i = i + 1) { 
     
    178186      label = graphdef.dataset[name][j].name; 
    179187      value = graphdef.dataset[name][j].value; 
    180       dataset[label].push({ 'name' : name, 'value' : value }); 
     188      resetSum = graphdef.dataset[name][j].resetSum; 
     189      dataset[label].push({ 'name' : name, 'value' : value, 'resetSum': resetSum }); 
    181190    } 
    182191  } 
     
    223232    ctx.drawSvg(svgContent); 
    224233    canvas.toBlob(function(blob) { 
    225       saveAs(blob, "png_download"+Math.ceil(Math.random()*100000)+".png"); 
     234      //saveAs(blob, "png_download"+Math.ceil(Math.random()*100000)+".png"); 
     235      var a = document.createElement("a"); 
     236      document.body.appendChild(a); 
     237      a.style = "display: none"; 
     238      var url = window.URL.createObjectURL(blob); 
     239      a.href = url; 
     240      a.download = "png_download"+Math.ceil(Math.random()*100000)+".png"; 
     241      a.click(); 
     242      //window.URL.revokeObjectURL(url); 
    226243    }, "image/png"); 
    227244    callback.call(); 
    228245  } else { 
    229     console.log('this feature is not supported in this version of browser'); 
     246    console.log('uvCharts: Download feature is not supported in this version of browser'); 
    230247  } 
    231248}; 
     
    576593}; 
    577594 
    578 uv.addChart('Bar','BarGraph'); 
    579 uv.addChart('Line','LineGraph'); 
    580 uv.addChart('StackedBar','StackedBarGraph'); 
    581 uv.addChart('StepUpBar','StepUpBarGraph'); 
    582 uv.addChart('Area','AreaGraph'); 
    583 uv.addChart('StackedArea','StackedAreaGraph'); 
    584 uv.addChart('PercentBar','PercentBarGraph'); 
    585 uv.addChart('PercentArea','PercentAreaGraph'); 
    586 uv.addChart('Pie','PieGraph'); 
    587 uv.addChart('Donut','DonutGraph'); 
    588 uv.addChart('Waterfall','WaterfallGraph'); 
    589 uv.addChart('PolarArea','PolarAreaGraph'); 
     595uv.addChart('bar','BarGraph'); 
     596uv.addChart('line','LineGraph'); 
     597uv.addChart('stackedbar','StackedBarGraph'); 
     598uv.addChart('stepupbar','StepUpBarGraph'); 
     599uv.addChart('area','AreaGraph'); 
     600uv.addChart('stackedarea','StackedAreaGraph'); 
     601uv.addChart('percentbar','PercentBarGraph'); 
     602uv.addChart('percentarea','PercentAreaGraph'); 
     603uv.addChart('pie','PieGraph'); 
     604uv.addChart('donut','DonutGraph'); 
     605uv.addChart('waterfall','WaterfallGraph'); 
     606uv.addChart('polararea','PolarAreaGraph'); 
    590607 
    591608uv.chart = function (type, graphdef, config) { 
     609  type = type.toLowerCase() 
    592610  if (uv.types[type] !== undefined) { 
    593611    return new uv[uv.types[type]](graphdef, config); 
     
    822840 
    823841uv.palette = { 
    824   'Default' : ['#7E6DA1', '#C2CF30', '#FF8900', '#FE2600', '#E3003F', '#8E1E5F', '#FE2AC2', '#CCF030', '#9900EC', '#3A1AA8', '#3932FE', '#3276FF', '#35B9F6', '#42BC6A', '#91E0CB'], 
     842  'Default': ['#00BBC9', '#EC63AB', '#AA8AE4', '#83CE44', '#ff8f25', '#009EAA', '#CA4F7F', '#9C70C0', '#6BAF3B'], 
     843  'OldDefault' : ['#7E6DA1', '#C2CF30', '#FF8900', '#FE2600', '#E3003F', '#8E1E5F', '#FE2AC2', '#CCF030', '#9900EC', '#3A1AA8', '#3932FE', '#3276FF', '#35B9F6', '#42BC6A', '#91E0CB'], 
    825844  'Plain' : ['#B1EB68', '#B1B9B5', '#FFA16C', '#9B64E7', '#CEE113', '#2F9CFA', '#CA6877', '#EC3D8C', '#9CC66D', '#C73640', '#7D9532', '#B064DC' ], 
    826845  'Android' : ['#33B5E5', '#AA66CC', '#99CC00', '#FFBB33', '#FF4444', '#0099CC', '#9933CC', '#669900', '#FF8800', '#CC0000'], 
     
    14001419 
    14011420  //Log Graph object if flag set to truthy value 
    1402   //if (isLoggable) { 
     1421  if (isLoggable) { 
    14031422    console.log(self); 
    1404   //} 
     1423  } 
    14051424  return this; 
    14061425}; 
     
    18981917  var self = this; 
    18991918  self.graphdef.stepup = 'normal'; 
     1919  self.config.legend.legendtype = 'labels'; 
    19001920  return this; 
    19011921}; 
     
    20992119  self['draw' + self.config.graph.orientation + 'Area'](); 
    21002120 
    2101   self.finalize(true); 
     2121  self.finalize(); 
    21022122}; 
    21032123 
     
    22472267    .style('fill', color) 
    22482268    .transition() 
    2249       .duration(uv.config.effects.duration) 
    2250       .delay(idx * uv.config.effects.duration) 
     2269      .duration(self.config.effects.duration) 
     2270      .delay(idx * self.config.effects.duration) 
    22512271      .attr('width', function (d, i) { return axes.hor.scale(uv.util.getPercentage(d.value, sumMap[i]));}) 
    22522272      .call(uv.util.endAll, function (d,i){ 
     
    22682288    .text(function(d, i) { return ( axes.hor.scale(uv.util.getPercentage(csum[i], sumMap[i])) > 15 ) ? String(Math.round(uv.util.getPercentage(d.value, sumMap[i]))) : null; }) 
    22692289    .transition() 
    2270       .duration(uv.config.effects.duration) 
    2271       .delay(idx * uv.config.effects.duration) 
     2290      .duration(self.config.effects.duration) 
     2291      .delay(idx * self.config.effects.duration) 
    22722292      .attr('x', function (d, i) { tsum[i] += d.value; return axes.hor.scale(uv.util.getPercentage(tsum[i], sumMap[i])) - 5; }); 
    22732293}; 
     
    22902310    .style('fill', color) 
    22912311    .transition() 
    2292       .duration(uv.config.effects.duration) 
    2293       .delay(idx * uv.config.effects.duration) 
     2312      .duration(self.config.effects.duration) 
     2313      .delay(idx * self.config.effects.duration) 
    22942314      .attr('height', function (d, i) { return height - axes.ver.scale(uv.util.getPercentage(d.value, sumMap[i])); }) 
    22952315      .call(uv.util.endAll, function (d,i){ 
     
    23102330    .text(function(d, i) { return ( height - axes.ver.scale(uv.util.getPercentage(d.value, sumMap[i])) > 15) ? String(Math.round(uv.util.getPercentage(d.value, sumMap[i]))) : null; }) 
    23112331    .transition() 
    2312       .duration(uv.config.effects.duration) 
    2313       .delay(idx * uv.config.effects.duration) 
     2332      .duration(self.config.effects.duration) 
     2333      .delay(idx * self.config.effects.duration) 
    23142334      .attr('y', function (d, i) { tsum[i] += d.value; return -(2*height - axes.ver.scale(uv.util.getPercentage(tsum[i], sumMap[i]))) + 5; }); 
    23152335}; 
     
    24502470  var self = this; 
    24512471  self.graphdef.stepup = 'normal'; 
     2472  self.config.legend.legendtype = 'labels'; 
    24522473  return this; 
    24532474}; 
     
    26132634    .style('fill', color) 
    26142635    .transition() 
    2615       .duration(uv.config.effects.duration) 
    2616       .delay(idx * uv.config.effects.duration) 
     2636      .duration(self.config.effects.duration) 
     2637      .delay(idx * self.config.effects.duration) 
    26172638      .attr('width', function (d,i) { return axes.hor.scale(csum[i]) - axes.hor.scale(csum[i]-d.value); }) 
    26182639      .each("end", function (d,i){ 
     
    26402661    .text(function(d) { return ( axes.hor.scale(d.value) > 15 ) ? uv.util.getLabelValue(self, d) : null; }) 
    26412662    .transition() 
    2642       .duration(uv.config.effects.duration) 
    2643       .delay(idx * uv.config.effects.duration) 
     2663      .duration(self.config.effects.duration) 
     2664      .delay(idx * self.config.effects.duration) 
    26442665      .style('opacity', 1) 
    26452666      .attr('x', function (d, i) { tsum[i] += d.value; return axes.hor.scale(tsum[i]) - 5; }); 
     
    26692690    .style('fill', color) 
    26702691    .transition() 
    2671       .duration(uv.config.effects.duration) 
    2672       .delay(idx * uv.config.effects.duration) 
     2692      .duration(self.config.effects.duration) 
     2693      .delay(idx * self.config.effects.duration) 
    26732694      .attr('height', function (d,i) { return -(axes.ver.scale(-csum[i]) - axes.ver.scale(-csum[i]-d.value)); }) 
    26742695      .each("end", function (d,i){ 
     
    26962717    .text(function(d) { return ( height - axes.ver.scale(d.value) > 15) ? uv.util.getLabelValue(self, d) : null; }) 
    26972718    .transition() 
    2698       .duration(uv.config.effects.duration) 
    2699       .delay(idx * uv.config.effects.duration) 
     2719      .duration(self.config.effects.duration) 
     2720      .delay(idx * self.config.effects.duration) 
    27002721      .style('opacity', 1) 
    27012722      .attr('y', function (d, i) { tsum[i] += d.value; return -(2*height - axes.ver.scale(tsum[i])) + 5; }); 
     
    27442765    .attr('height', self.axes.ver.scale.rangeBand() / len) 
    27452766    .attr('width', 0) 
     2767    .attr('transform', 
     2768      function (d) { 
     2769      return (d.value < 0) ? 'scale(-1,1)': 'scale(1,1)'; 
     2770    }) 
    27462771    .attr('x', function (d, i) { 
     2772      if (d.resetSum === true) csum[i] = 0; 
    27472773      var value = self.axes.hor.scale(csum[i]); 
    27482774      csum[i] += d.value; 
     
    27532779    .style('stroke', 'none') 
    27542780    .style('fill', color) 
    2755     .style('transform', function (d) { 
    2756       return (d.value < 0) ? 'scale(-1,1)': 'scale(1,1)'; 
    2757     }) 
    27582781    .transition() 
    27592782      .duration(self.config.effects.duration) 
     
    27812804      .delay(idx * self.config.effects.duration) 
    27822805      .style('opacity', 1) 
    2783       .attr('x', function (d, i) { tsum[i] += d.value; return self.axes.hor.scale(tsum[i]); }); 
     2806      .attr('x', function (d, i) { 
     2807        if (d.resetSum === true) tsum[i] = 0; 
     2808        tsum[i] += d.value; 
     2809        return self.axes.hor.scale(tsum[i]); 
     2810      }); 
    27842811 
    27852812  bars.append('svg:title') 
     
    28002827    .attr('height', 0) 
    28012828    .attr('width', self.axes.hor.scale.rangeBand() / len) 
     2829    .attr('transform', 
     2830      function (d) { 
     2831      return (d.value < 0) ? 'scale(1,-1)': 'scale(1,1)'; 
     2832    }) 
    28022833    .attr('x', function (d) { return self.axes.hor.scale(d.name); }) 
    28032834    .attr('y', function (d, i) { 
     2835      if (d.resetSum === true) csum[i] = 0; 
    28042836      var value = (2*self.height() - self.axes.ver.scale(csum[i])); 
    28052837      csum[i] += d.value; 
     
    28092841    .style('stroke', 'none') 
    28102842    .style('fill', color) 
    2811     .style('transform', function (d) { 
    2812       return (d.value < 0)? 'scale(1,-1)': 'scale(1,1)' 
    2813     }) 
    28142843    .transition() 
    28152844      .duration(self.config.effects.duration) 
     
    28392868      .delay(idx * self.config.effects.duration) 
    28402869      .style('opacity', 1) 
    2841       .attr('y', function (d, i) { tsum[i] += d.value; return -(2*self.height() - self.axes.ver.scale(tsum[i])) - 10; }); 
     2870      .attr('y', function (d, i) { 
     2871        if (d.resetSum === true) tsum[i] = 0; 
     2872        tsum[i] += d.value; 
     2873        return -(2*self.height() - self.axes.ver.scale(tsum[i])) - 10; 
     2874      }); 
    28422875 
    28432876  bars.append('svg:title') 
     
    30723105}; 
    30733106 
     3107  if (!noGlobal) { 
     3108    window.uv = { 
     3109      chart: uv.chart 
     3110    }; 
     3111  } 
     3112 
    30743113  return { 
    30753114    chart: uv.chart 
    30763115  }; 
    3077 })(); 
     3116})); 
  • easy-charts/trunk/includes/js/uvcharts.min.js

    r1489677 r1675327  
    1 var uv=function(){var t={};return t.util={},t.util.inherits=function(t){function e(){}return e.prototype=t.prototype||t,new e},t.util.getUniqueId=function(){return(new Date).getTime()},t.util.getMax=function(t,e){switch(e){case"stepup":return this.getStepMaxValue(t);case"normal":return this.getMaxValue(t);case"percent":return 100;case"waterfall":return this.getWaterfallMaxValue(t);default:console.error("Unknown classification for chart",e)}},t.util.getMaxValue=function(t){return d3.max(t.categories.map(function(e){return d3.max(t.dataset[e].map(function(t){return t.value}))}))},t.util.getStepMaxValue=function(t){var e=t.dataset[t.categories[0]].map(function(){return 0}),a=e.map(function(){return 0});return t.categories.map(function(n){t.dataset[n].map(function(t,n){e[n]+=t.value,a[n]=d3.max([e[n],a[n]])})}),d3.max(a)},t.util.getWaterfallMaxValue=function(t){var e=t.categories.map(function(){return 0});return t.categories.map(function(a,n){var r=0;t.dataset[a].map(function(t){r+=t.value,e[n]<r&&(e[n]=r)})}),d3.max(e)},t.util.getMin=function(t,e){switch(e){case"normal":return this.getMinValue(t);case"stepup":return this.getStepMinValue(t);default:return 0}},t.util.getMinValue=function(t){return d3.min([0,d3.min(t.categories.map(function(e){return d3.min(t.dataset[e].map(function(t){return t.value}))}))])},t.util.getStepMinValue=function(t){var e=t.dataset[t.categories[0]].map(function(){return 0}),a=e.map(function(){return 0});return t.categories.map(function(n){t.dataset[n].map(function(t,n){e[n]+=t.value,a[n]=d3.min([e[n],a[n]])})}),d3.min(a)},t.util.getSumUpArray=function(t){var e=t.dataset[t.categories[0]].map(function(){return 0});return t.categories.map(function(a){t.dataset[a].map(function(t,a){e[a]+=t.value})}),e},t.util.getPercentage=function(t,e){return 100*t/e},t.util.getDataArray=function(t){return t.categories.map(function(e){return t.dataset[e]})},t.util.getTabularArray=function(t){var e,a,n,r,o=[],s=[];for(e=0,r=t.dataset[t.categories[0]].length;r>e;e+=1){for(s=[],s.push(t.dataset[t.categories[0]][e].name),a=0,n=t.categories.length;n>a;a+=1)s.push(t.dataset[t.categories[a]][e].value);o.push(s)}return o},t.util.getLabelArray=function(t,e){return t.dataset[t.categories[e?e:0]].map(function(t){return t.name})},t.util.getCategoryArray=function(t){return t.categories.map(function(t){return t})},t.util.getCategoryData=function(t,e){return e.map(function(e){return t.dataset[e].map(function(t){return t.value})})},t.util.transposeData=function(t){var e,a,n,r,o,s,i,l={},c=t.dataset[t.categories[0]].map(function(t){return t.name});for(e=0,n=c.length;n>e;e+=1)l[c[e]]=[];for(e=0,n=t.categories.length;n>e;e+=1)for(o=t.categories[e],a=0,r=t.dataset[o].length;r>a;a+=1)s=t.dataset[o][a].name,i=t.dataset[o][a].value,l[s].push({name:o,value:i});t.categories=c,t.dataset=l},t.util.getPascalCasedName=function(t){return t.substring(0,1).toUpperCase()+t.substring(1)},t.util.getColorBand=function(e,a){{var n=0;e.graph.palette||"Default"}return e.graph.custompalette&&0!==e.graph.custompalette.length?(n=e.graph.custompalette.length,e.graph.custompalette[a%n]):(n=t.palette[e.graph.palette].length,t.palette[e.graph.palette][a%n])},t.util.formatClassName=function(t){var e=t.trim().replace(/[^A-Za-z0-9_\-]/g,"-").toLowerCase();return e},t.util.svgToPng=function(t,e){if(this.isCanvasSupported()){var a=d3.select(t.frame.node().parentNode).html(),n=document.createElement("canvas"),r=n.getContext("2d");n.setAttribute("width",d3.select(t.frame.node()).attr("width")),n.setAttribute("height",d3.select(t.frame.node()).attr("height")),r.drawSvg(a),n.toBlob(function(t){saveAs(t,"png_download"+Math.ceil(1e5*Math.random())+".png")},"image/png"),e.call()}else console.log("this feature is not supported in this version of browser")},t.util.isDownloadSupported=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return"function"==typeof e.drawSvg&&"function"==typeof t.toBlob},t.util.isCanvasSupported=function(){var t=document.createElement("canvas");return!(!t.getContext||!t.getContext("2d"))},t.util.endAll=function(t,e){var a=0;t.each(function(){++a}).each("end",function(){--a||e.apply(this,arguments)})},t.util.getClassName=function(e,a){var n=t.util.formatClassName(a);return d3.select(e).attr("class")?-1!==d3.select(e).attr("class").split(" ").indexOf(n)?d3.select(e).attr("class"):d3.select(e).attr("class")+" "+n:n},t.util.getLabelValue=function(t,e){if(void 0!==t.config.label.formatter)return t.config.label.formatter(e.value);var a=e.value%1===0?e.value:e.value.toFixed(t.config.label.precision);return t.config.label.prefix+String(a)+t.config.label.suffix},t.util._deepClone=function(e,a){if("object"==typeof a){var n=!0;for(var r in a)n=!1,a.hasOwnProperty(r)&&(void 0===e&&(e=Array.isArray(a)?[]:{}),e[r]=t.util._deepClone(e[r],a[r]));n&&(e=Array.isArray(a)?[]:{})}else e=a;return e},t.util.extend=function(){if(void 0===arguments[0]||null===arguments[0])return arguments[0];for(var e=1;e<arguments.length;e++)for(var a in arguments[e])arguments[e].hasOwnProperty(a)&&(arguments[0][a]=t.util._deepClone(arguments[0][a],arguments[e][a]));return arguments[0]},t.util.getTooltipText=function(e,a,n,r){if(!e.config.tooltip.show)return"";var o=e.config.tooltip.format;return""===o?a+" ["+n+"] : "+t.util.getLabelValue(r):o.replace(/%c/gi,a).replace(/%l/gi,n).replace(/%v/gi,t.util.getLabelValue(e,r))},t.config={graph:{palette:"Default",bgcolor:"#FFFFFF",orientation:"Horizontal",max:0,min:0,custompalette:[],opacity:1,responsive:!1,align:"xMinYMin",meetOrSlice:"meet"},meta:{position:"#uv-div",caption:"",subcaption:"",hlabel:"",vlabel:"",hsublabel:"",vsublabel:"",isDownloadable:!1,downloadLabel:"Download"},dimension:{width:400,height:400},margin:{top:50,bottom:150,left:100,right:100},frame:{bgcolor:"#FFFFFF"},axis:{ticks:8,subticks:2,padding:5,minor:-10,strokecolor:"#000000",fontfamily:"Arial",fontsize:"14",fontweight:"bold",showticks:!0,showsubticks:!0,showtext:!0,showhortext:!0,showvertext:!0,opacity:.1},label:{fontfamily:"Arial",fontsize:"11",fontweight:"normal",strokecolor:"#000000",showlabel:!0,precision:2,prefix:"",suffix:"",formatter:void 0},tooltip:{show:!0,format:"%c [%l]: %v"},scale:{type:"linear",ordinality:.2},bar:{strokecolor:"none",fontfamily:"Arial",fontsize:"10",fontweight:"bold",textcolor:"#000"},line:{interpolation:"linear",showcircles:!0,circleradius:3.5,circleopacity:.6,fontfamily:"Arial",fontsize:"10",fontweight:"bold",textcolor:"#000",strokewidth:1.5,strokeopacity:1},area:{interpolation:"cardinal",offset:"zero",opacity:.2},pie:{fontfamily:"Arial",fontsize:"14",fontweight:"normal",fontvariant:"small-caps",fontfill:"#FFFFFF",strokecolor:"#FFFFFF",strokewidth:1},donut:{fontfamily:"Arial",fontsize:"14",fontweight:"normal",fontvariant:"small-caps",fontfill:"#000",factor:.4,strokecolor:"#FFFFFF",strokewidth:1},caption:{fontfamily:"Arial",fontsize:"14",fontweight:"bold",fontvariant:"small-caps",textdecoration:"none",hovercolor:"#696969",strokecolor:"#0000FF",textanchor:"middle",cursor:"pointer"},subCaption:{fontfamily:"Arial",fontsize:"9",fontweight:"normal",fontvariant:"normal",textdecoration:"none",textanchor:"middle"},legend:{position:"bottom",fontfamily:"Arial",fontsize:"11",fontweight:"normal",color:"#000000",strokewidth:.15,textmargin:15,symbolsize:10,inactivecolor:"#DDD",legendstart:0,legendtype:"categories",showlegends:!0},effects:{hovercolor:"#FF0000",strokecolor:"none",textcolor:"#000000",duration:800,hover:400,showhovertext:!1}},t.constants={},t.constants.classes={uv:"uv",pos:"uv-div",frame:"uv-frame",panel:"uv-panel",bg:"uv-chart-bg",chart:"uv-chart",axes:"uv-axes",legend:"uv-legend",framebg:"uv-frame-bg",horaxis:"uv-hor-axis",veraxis:"uv-ver-axis",caption:"uv-caption",captiontext:"uv-caption-text",subcaption:"uv-subcaption",subcaptiontext:"uv-subcaption-text",axeslabelgroup:"uv-axes-label-group",axeslabel:"uv-axes-label",axessublabel:"uv-axes-sub-label",legendsign:"uv-legend-sign",legendlabel:"uv-legend-label",hoverbg:"uv-hover-bg",arc:"uv-arc-",areapath:"uv-areapath-",linepath:"uv-linepath-",area:"uv-area-",line:"uv-line-",dot:"uv-dot",chartdiv:"uv-chart-div",circleticks:"circle-ticks",download:"uv-download-options"},t.constants.downloads={downloadLabel:"Download"},t.types={},t.addChart=function(e,a){t.types[e]=a},t.addChart("Bar","BarGraph"),t.addChart("Line","LineGraph"),t.addChart("StackedBar","StackedBarGraph"),t.addChart("StepUpBar","StepUpBarGraph"),t.addChart("Area","AreaGraph"),t.addChart("StackedArea","StackedAreaGraph"),t.addChart("PercentBar","PercentBarGraph"),t.addChart("PercentArea","PercentAreaGraph"),t.addChart("Pie","PieGraph"),t.addChart("Donut","DonutGraph"),t.addChart("Waterfall","WaterfallGraph"),t.addChart("PolarArea","PolarAreaGraph"),t.chart=function(e,a,n){return void 0!==t.types[e]?new t[t.types[e]](a,n):void 0},t.effects={},t.effects.bar={},t.effects.bar.mouseover=function(e,a){var n=e.config,r=e.categories[a],o=e.labels[a],s=function(){e.frame.selectAll("rect.cr-"+t.util.formatClassName(r)).transition().duration(n.effects.hover).style("fill",n.effects.hovercolor).style("stroke",n.effects.strokecolor),n.effects.showhovertext&&e.frame.selectAll("text.cr-"+t.util.formatClassName(r)).transition().duration(n.effects.hover).style("fill",n.effects.textcolor).style("opacity",1)};return"categories"===n.legend.legendtype?e.effects[r].mouseover=s:e.effects[o].mouseover=s,s},t.effects.bar.mouseout=function(e,a,n){var r=e.config,o=e.categories[a],s=t.util.getColorBand(e.config,a),i=n||t.util.getColorBand(e.config,a),l=e.labels[a],c=function(){e.frame.selectAll("rect.cr-"+t.util.formatClassName(o)).transition().duration(r.effects.hover).style("fill",s).style("stroke","none"),e.frame.selectAll("text.cr-"+t.util.formatClassName(o)).transition().duration(r.effects.hover).style("fill",e.config.label.showlabel?i:"none")};return"categories"===r.legend.legendtype?e.effects[o].mouseout=c:e.effects[l].mouseout=c,c},t.effects.area={},t.effects.area.mouseover=function(e,a){var n=e.config,r=e.categories[a],o=function(){e.frame.selectAll(".cge-"+t.util.formatClassName(r)).select("path."+t.constants.classes.area+t.util.formatClassName(r)).transition().duration(n.effects.hover).style("fill",n.effects.hovercolor)};return e.effects[r].mouseover=o,o},t.effects.area.mouseout=function(e,a){var n=e.config,r=e.categories[a],o=function(){e.frame.selectAll(".cge-"+t.util.formatClassName(r)).select("path."+t.constants.classes.area+t.util.formatClassName(r)),e.frame.selectAll(".cge-"+t.util.formatClassName(r)).select("path."+t.constants.classes.area+t.util.formatClassName(r)).transition().duration(n.effects.hover).style("fill",t.util.getColorBand(n,a))};return e.effects[r].mouseout=o,o},t.effects.line={},t.effects.line.mouseover=function(e,a){var n=e.config,r=e.categories[a],o=function(){e.frame.selectAll(".cge-"+t.util.formatClassName(r)).selectAll("circle").transition().duration(n.effects.hover).style("fill",n.effects.hovercolor).style("fill-opacity",1).style("stroke",n.effects.hovercolor),e.frame.selectAll(".cge-"+t.util.formatClassName(r)).select("path").transition().duration(n.effects.hover).style("stroke",n.effects.hovercolor),n.effects.showhovertext&&e.frame.selectAll(".cge-"+t.util.formatClassName(r)).selectAll("text").transition().duration(n.effects.hover).style("fill",n.effects.textcolor)};return e.effects[r].mouseover=o,o},t.effects.line.mouseout=function(e,a,n){var r=e.config,o=e.categories[a],s=n||t.util.getColorBand(e.config,a),i=function(){e.frame.selectAll(".cge-"+t.util.formatClassName(o)).selectAll("circle").transition().duration(r.effects.hover).style("fill",s).style("fill-opacity",.6).style("stroke","#fff"),e.frame.selectAll(".cge-"+t.util.formatClassName(o)).select("path").transition().duration(r.effects.hover).style("stroke",s),e.frame.selectAll(".cge-"+t.util.formatClassName(o)).selectAll("text").transition().duration(r.effects.hover).style("fill",e.config.label.showlabel?s:"none")};return e.effects[o].mouseout=i,i},t.effects.caption={},t.effects.caption.mouseover=function(e){return function(){d3.select(this.parentNode.parentNode).select("."+t.constants.classes.hoverbg).transition().duration(e.effects.duration).style("fill",e.caption.hovercolor)}},t.effects.caption.mouseout=function(e){return function(){d3.select(this.parentNode.parentNode).select("."+t.constants.classes.hoverbg).transition().duration(e.effects.duration).style("fill",e.graph.bgcolor)}},t.effects.donut={},t.effects.donut.mouseover=function(t,e,a,n){return function(n){var r={x:e.centroid(n)[0]/5,y:e.centroid(n)[1]/5};d3.select(this.parentNode).transition().duration(a.effects.duration).attr("transform","translate("+(t.x+r.x)+","+(t.y+r.y)+")")}},t.effects.donut.mouseout=function(t,e){return function(){d3.select(this.parentNode).transition().duration(e.effects.duration).attr("transform","translate("+t.x+","+t.y+")")}},t.effects.pie={},t.effects.pie.mouseover=function(t,e,a,n){var r=function(t){var r={x:a.centroid(t)[0]/5,y:a.centroid(t)[1]/5};d3.select(this.parentNode).transition().duration(n.effects.duration).attr("transform","translate("+(e.x+r.x)+","+(e.y+r.y)+")")};return r},t.effects.pie.mouseout=function(t,e,a){var n=function(){d3.select(this.parentNode).transition().duration(a.effects.duration).attr("transform","translate("+e.x+","+e.y+")")};return n},t.effects.legend={},t.effects.legend.mouseover=function(t,e){return"categories"===t.config.legend.legendtype?t.effects.group[t.categories[e]].mouseover:t.effects.group[t.labels[e]].mouseover},t.effects.legend.mouseout=function(t,e){return"categories"===t.config.legend.legendtype?t.effects.group[t.categories[e]].mouseout:t.effects.group[t.labels[e]].mouseout},t.effects.legend.click=function(e,a,n){var r="false"===d3.select(a).attr("disabled")?!1:!0;n.toggleGraphGroup(e),d3.select(a).select("rect").style("fill",r?t.util.getColorBand(n.config,e):t.config.legend.inactivecolor),d3.select(a).select("text").style("fill",r?null:t.config.legend.inactivecolor),d3.select(a).attr("disabled",r?"false":"true")},t.palette={Default:["#7E6DA1","#C2CF30","#FF8900","#FE2600","#E3003F","#8E1E5F","#FE2AC2","#CCF030","#9900EC","#3A1AA8","#3932FE","#3276FF","#35B9F6","#42BC6A","#91E0CB"],Plain:["#B1EB68","#B1B9B5","#FFA16C","#9B64E7","#CEE113","#2F9CFA","#CA6877","#EC3D8C","#9CC66D","#C73640","#7D9532","#B064DC"],Android:["#33B5E5","#AA66CC","#99CC00","#FFBB33","#FF4444","#0099CC","#9933CC","#669900","#FF8800","#CC0000"],Soft:["#9ED8D2","#FFD478","#F16D9A","#A8D59D","#FDC180","#F05133","#EDED8A","#F6A0A5","#9F218B"],Simple:["#FF8181","#FFB081","#FFE081","#EFFF81","#BFFF81","#90FF81","#81FFA2","#81FFD1","#9681FF","#C281FF","#FF81DD"],Egypt:["#3A3E04","#784818","#FCFCA8","#C03C0C","#F0A830","#A8783C","#FCFCFC","#FCE460","#540C00","#C0C084","#3C303C","#1EA34A","#606C54","#F06048"],Olive:["#18240C","#3C6C18","#60A824","#90D824","#A8CC60","#789C60","#CCF030","#B4CCA8","#D8F078","#40190D","#E4F0CC"],Candid:["#AF5E14","#81400C","#E5785D","#FEBFBF","#A66363","#C7B752","#EFF1A7","#83ADB7","#528F98","#BCEDF5","#446B3D","#8BD96F","#E4FFB9"],Sulphide:["#594440","#0392A7","#FFC343","#E2492F","#007257","#B0BC4A","#2E5493","#7C2738","#FF538B","#A593A1","#EBBA86","#E2D9CA"],Lint:["#A8A878","#F0D89C","#60909C","#242418","#E49C30","#54483C","#306090","#C06C00","#C0C0C0","#847854","#6C3C00","#9C3C3C","#183C60","#FCCC00","#840000","#FCFCFC"]},t.Graph=function(e,a){var n=this;return n.id=t.util.getUniqueId(),n.graphdef=null,n.config=null,n.frame=null,n.panel=null,n.chart=null,n.bg=null,n.effects={},n.axes={hor:{group:null,scale:null,func:null,axis:null,line:null,label:null},ver:{group:null,scale:null,func:null,axis:null,line:null,label:null},meta:{min:null,max:null}},n.labels=null,n.categories=null,n.graphdef=e,n.config=t.util.extend({},t.config,a),this},t.Graph.prototype.init=function(){var t=this;return t.max().min().position(t.config.meta.position||"body").setDimensions().setFrame().setPanel().setBackground().setCaption().setSubCaption().setMetadata().setHorizontalAxis().setVerticalAxis().setEffectsObject(),t.config.meta.isDownloadable&&t.setDownloadOptions(),t.config.legend.showlegends&&t.setLegend(),t},t.Graph.prototype.setDimensions=function(){var t=this;return t.height(t.config.dimension.height).width(t.config.dimension.width).top(t.config.margin.top).bottom(t.config.margin.bottom).left(t.config.margin.left).right(t.config.margin.right),this},t.Graph.prototype.setDownloadOptions=function(){if(t.util.isDownloadSupported()){var e=this;e.download=e.panel.append("g").classed(t.constants.classes.download,!0),e.download.append("text").classed(t.constants.classes.download,!0).text(e.config.meta.downloadLabel).attr("y",-e.config.margin.top/2).attr("x",e.config.dimension.width-25).attr("text-anchor",e.config.caption.textanchor).style("font-family",e.config.caption.fontfamily).style("font-size","12").style("cursor",e.config.caption.cursor).style("stroke",e.config.caption.strokecolor).style("text-decoration","underline").on("mouseover",function(){var t=d3.select(this);t.style("color","#0000FF")}).on("mouseout",function(){var t=d3.select(this);t.style("color","#8D8D8D")}).on("click",function(){var a=d3.select(this);a.style("display","none"),t.util.svgToPng(e,function(){a.style("display",null)})})}},t.Graph.prototype.setFrame=function(){var e=this;return e.frame||(e.frame=d3.select(e.position()||"body").append("div").classed(t.constants.classes.chartdiv,!0).style("display","inline-block").style("width","100%").style("height","100%").append("svg")),e.frame.attr("id",t.constants.classes.uv+"-"+e.id).classed(t.constants.classes.frame,!0),e.config.graph.responsive===!0?e.frame.attr("width","100%").attr("height","100%").attr("preserveAspectRatio",e.config.graph.align+" "+e.config.graph.meetOrSlice).attr("viewBox","0 0 "+(e.width()+e.left()+e.right())+" "+(e.height()+e.top()+e.bottom())):e.frame.attr("width",e.width()+e.left()+e.right()).attr("height",e.height()+e.top()+e.bottom()),e.frame.append("rect").classed(t.constants.classes.framebg,!0).attr("width",e.width()+e.left()+e.right()).attr("height",e.height()+e.top()+e.bottom()).style("fill",e.config.frame.bgcolor),this},t.Graph.prototype.setPanel=function(){var e=this;return e.panel||(e.panel=e.frame.append("g")),e.panel.attr("id",t.constants.classes.panel+"-"+e.id).classed(t.constants.classes.panel,!0).attr("transform","translate("+e.left()+","+e.top()+")"),this},t.Graph.prototype.setBackground=function(e){var a=this;return a.bg||(a.bg=a.panel.append("rect").classed(t.constants.classes.bg,!0).attr("height",a.height()).attr("width",a.width())),a.bg.style("fill",e||a.config.graph.bgcolor),a.chart=a.panel.append("g").classed(t.constants.classes.chart,!0).style("opacity",a.config.graph.opacity),this},t.Graph.prototype.setCaption=function(){var e=this;return e.caption=e.panel.append("g").classed(t.constants.classes.caption,!0),e.caption.append("text").classed(t.constants.classes.captiontext,!0).text(e.config.meta.caption).attr("y",-e.config.margin.top/2).attr("x",e.config.dimension.width/2).attr("text-anchor",e.config.caption.textanchor).style("font-family",e.config.caption.fontfamily).style("font-size",e.config.caption.fontsize).style("font-weight",e.config.caption.fontweight).style("font-variant",e.config.caption.fontvariant).style("text-decoration",e.config.caption.textdecoration).on("mouseover",t.effects.caption.mouseover(e.config)).on("mouseout",t.effects.caption.mouseout(e.config)),this},t.Graph.prototype.setSubCaption=function(){var e=this;return e.subCaption=e.panel.append("g").classed(t.constants.classes.subcaption,!0),e.subCaption.append("text").classed(t.constants.classes.subcaptiontext,!0).text(e.config.meta.subcaption).attr("y",-e.config.margin.top/2+1*e.config.caption.fontsize).attr("x",e.config.dimension.width/2).attr("text-anchor",e.config.caption.textanchor).style("font-family",e.config.subCaption.fontfamily).style("font-size",e.config.subCaption.fontsize).style("font-weight",e.config.subCaption.fontweight).style("font-variant",e.config.subCaption.fontvariant).style("text-decoration",e.config.subCaption.textdecoration),this},t.Graph.prototype.setMetadata=function(){var e=this;return e.labels=t.util.getLabelArray(e.graphdef),e.categories=t.util.getCategoryArray(e.graphdef),this},t.Graph.prototype.setHorizontalAxis=function(){{var e=this;e.graphdef}return e.axes.hor.group||(e.axes.hor.group=e.panel.append("g").classed(t.constants.classes.horaxis,!0).attr("transform","translate(0,"+e.height()+")").style("shape-rendering","crispEdges")),"Horizontal"===e.config.graph.orientation?(e.axes.hor.scale=d3.scale[e.config.scale.type]().domain(["log"===e.config.scale.type?1:e.min(),e.max()]).range([0,e.width()]),e.axes.hor.scale.nice&&e.axes.hor.scale.nice(),e.config.axis.showsubticks||(e.config.axis.subticks=0),e.axes.hor.func=d3.svg.axis().scale(e.axes.hor.scale).ticks(e.config.axis.ticks).tickSize(-e.height(),e.config.axis.minor,0).tickPadding(e.config.axis.padding).tickSubdivide(e.config.axis.subticks).orient("bottom")):(e.axes.hor.scale=d3.scale.ordinal().rangeRoundBands([0,e.width()],e.config.scale.ordinality),e.axes.hor.func=d3.svg.axis().scale(e.axes.hor.scale).tickPadding(e.config.axis.padding).orient("bottom"),e.config.axis.showtext&&e.config.axis.showhortext||e.axes.hor.func.tickSize(0)),e.config.axis.showtext&&e.config.axis.showhortext||e.axes.hor.func.tickFormat(function(t){return""}),this},t.Graph.prototype.setVerticalAxis=function(){{var e=this;e.graphdef}return e.axes.ver.group||(e.axes.ver.group=e.panel.append("g").classed(t.constants.classes.veraxis,!0).style("shape-rendering","crispEdges")),"Vertical"===e.config.graph.orientation?(e.axes.ver.scale=d3.scale[e.config.scale.type]().domain([e.max(),"log"===e.config.scale.type?1:e.min()]).range([0,e.height()]),e.axes.ver.scale.nice&&e.axes.ver.scale.nice(),e.config.axis.showsubticks||(e.config.axis.subticks=0),e.axes.ver.func=d3.svg.axis().scale(e.axes.ver.scale).ticks(e.config.axis.ticks).tickSize(-e.width(),e.config.axis.minor,0).tickPadding(e.config.axis.padding).tickSubdivide(e.config.axis.subticks).orient("left")):(e.axes.ver.scale=d3.scale.ordinal().rangeRoundBands([0,e.height()],e.config.scale.ordinality),e.axes.ver.func=d3.svg.axis().scale(e.axes.ver.scale).tickPadding(e.config.axis.padding).orient("left"),e.config.axis.showtext&&e.config.axis.showvertext||e.axes.ver.func.tickSize(0)),e.config.axis.showtext&&e.config.axis.showvertext||e.axes.ver.func.tickFormat(function(t){return""}),this},t.Graph.prototype.setEffectsObject=function(){for(var t=this,e="categories"===t.config.legend.legendtype?t.categories:t.labels,a=0;a<e.length;a++)t.effects[e[a]]={};return t},t.Graph.prototype.drawHorizontalAxis=function(){var e=this;return e.axes.hor.axis=e.axes.hor.group.append("g").style("font-family",e.config.label.fontfamily).style("font-size",e.config.label.fontsize).style("font-weight",e.config.label.fontweight).call(e.axes.hor.func),e.config.axis.showticks&&e.axes.hor.axis.selectAll("line").style("stroke",e.config.axis.strokecolor).style("opacity",e.config.axis.opacity),e.axes.hor.axis.selectAll("path").style("fill","none"),e.axes.hor.line=e.panel.append("line").classed(t.constants.classes.horaxis,!0).attr("y1","Horizontal"===e.config.graph.orientation?e.height():e.axes.ver.scale(0)).attr("y2","Horizontal"===e.config.graph.orientation?e.height():e.axes.ver.scale(0)).attr("x1","0").attr("x2",e.width()).style("stroke",e.config.axis.strokecolor),e.axes.hor.label=e.axes.hor.group.append("g").classed(t.constants.classes.axeslabelgroup,!0).attr("transform","translate("+e.width()/2+","+(1*e.config.margin.bottom/4+1*e.config.label.fontsize)+")"),e.axes.hor.label.append("text").attr("display","block").classed(t.constants.classes.axeslabel,!0).classed("cal",!0).attr("text-anchor","middle").style("font-size",e.config.axis.fontsize).style("font-family",e.config.axis.fontfamily).text(e.config.meta.hlabel),e.axes.hor.label.append("text").attr("display","block").attr("y",1*e.config.axis.fontsize).attr(t.constants.classes.axessublabel,!0).classed("casl",!0).attr("text-anchor","middle").style("font-size",e.config.axis.fontsize-2).style("font-family",e.config.axis.fontfamily).text(e.config.meta.hsublabel),this},t.Graph.prototype.drawVerticalAxis=function(){var e=this;return e.axes.ver.axis=e.axes.ver.group.append("g").classed(t.constants.classes.axes,!0).style("font-family",e.config.label.fontfamily).style("font-size",e.config.label.fontsize).style("font-weight",e.config.label.fontweight).call(e.axes.ver.func),e.config.axis.showticks&&e.axes.ver.axis.selectAll("line").style("stroke",e.config.axis.strokecolor).style("opacity",e.config.axis.opacity),e.axes.ver.axis.selectAll("path").style("fill","none"),e.axes.ver.line=e.panel.append("line").classed(t.constants.classes.veraxis,!0).attr("x1","Horizontal"===e.config.graph.orientation?e.axes.hor.scale(0):0).attr("x2","Horizontal"===e.config.graph.orientation?e.axes.hor.scale(0):0).attr("y1",0).attr("y2",e.height()).style("stroke",e.config.axis.strokecolor),e.axes.ver.label=e.axes.ver.group.append("g").attr("transform","translate("+-4*e.config.margin.left/5+","+e.height()/2+")rotate(270)"),e.axes.ver.label.append("text").classed(t.constants.classes.axeslabel,!0).attr("text-anchor","middle").classed("cal",!0).style("font-family",e.config.axis.fontfamily).style("font-size",e.config.axis.fontsize).text(e.config.meta.vlabel),e.axes.ver.label.append("text").classed(t.constants.classes.axessublabel,!0).attr("text-anchor","middle").attr("y",+e.config.axis.fontsize).classed("casl",!0).style("font-family",e.config.axis.fontfamily).style("font-size",e.config.axis.fontsize-2).text(e.config.meta.vsublabel),this},t.Graph.prototype.setLegend=function(){var e=this,a=e.panel.append("g").classed(t.constants.classes.legend,!0).attr("transform",function(t,a){if("right"===e.config.legend.position)return"translate("+e.width()+", 10)";if("bottom"===e.config.legend.position){var n=e.height()+e.config.margin.bottom/2+Number(e.config.axis.fontsize);return"translate(0, "+n+")"}});return e.legends=a.selectAll("g").data("categories"===e.config.legend.legendtype?e.categories:e.labels),e.legends.enter().append("g").attr("transform",function(t,a){if("right"===e.config.legend.position)return"translate(10,"+10*(2*a-1)+")";if("bottom"===e.config.legend.position){var n=100*a-e.config.dimension.width*e.config.legend.legendstart,r=20*e.config.legend.legendstart;return n>=e.config.dimension.width&&(e.config.legend.legendstart=e.config.legend.legendstart+1,n=100*a-e.config.dimension.width*e.config.legend.legendstart,r=20*e.config.legend.legendstart),"translate("+n+","+r+")"}}).attr("class",function(a,n){var r="categories"===e.config.legend.legendtype?e.categories[n]:e.labels[n];return t.util.getClassName(this,"cl-"+r)}).attr("disabled","false").on("mouseover",function(t,a){e.effects[t].mouseover&&"function"==typeof e.effects[t].mouseover&&e.effects[t].mouseover()}).on("mouseout",function(t,a){e.effects[t].mouseout&&"function"==typeof e.effects[t].mouseout&&e.effects[t].mouseout()}).on("click",function(a,n){t.effects.legend.click(n,this,e)}),e.legends.append("rect").classed(t.constants.classes.legendsign,!0).attr("height",e.config.legend.symbolsize).attr("width",e.config.legend.symbolsize).style("fill",function(a,n){return t.util.getColorBand(e.config,n)}).style("stroke","none"),e.legends.append("text").classed(t.constants.classes.legendlabel,!0).text(function(t,a){return"categories"===e.config.legend.legendtype?e.categories[a]:e.labels[a]}).attr("dx",e.config.legend.textmargin).attr("dy",".71em").attr("text-anchor","start").style("stroke",e.config.legend.color).style("fill",e.config.legend.color).style("stroke-width",e.config.legend.strokewidth).style("font-family",e.config.legend.fontfamily).style("font-size",e.config.legend.fontsize).style("font-weight",e.config.legend.fontweight),this},t.Graph.prototype.finalize=function(t){var e=this;return e.drawHorizontalAxis().drawVerticalAxis(),e.frame.selectAll("text").style("cursor","default"),console.log(e),this},t.Graph.prototype.remove=function(){return this.frame.remove(),this},t.Graph.prototype.removeCaption=function(){return this.caption.remove(),this},t.Graph.prototype.removeLegend=function(){return this.legends[0]&&this.legends[0].parentNode.remove(),this},t.Graph.prototype.removePanel=function(){return this.panel.remove(),this},t.Graph.prototype.removeHorAxis=function(){return this.panel.selectAll("g."+t.constants.classes.horaxis+" >*").remove(),this.panel.selectAll("line."+t.constants.classes.horaxis).remove(),this},t.Graph.prototype.removeVerAxis=function(){return this.panel.selectAll("g."+t.constants.classes.veraxis+" >*").remove(),this.panel.selectAll("line."+t.constants.classes.veraxis).remove(),this},t.Graph.prototype.width=function(t){return t?(this.config.dimension.width=t,this):this.config.dimension.width},t.Graph.prototype.height=function(t){return t?(this.config.dimension.height=t,this):this.config.dimension.height},t.Graph.prototype.top=function(t){return t?(this.config.margin.top=t,this):this.config.margin.top},t.Graph.prototype.bottom=function(t){return t?(this.config.margin.bottom=t,this):this.config.margin.bottom},t.Graph.prototype.left=function(t){return t?(this.config.margin.left=t,this):this.config.margin.left},t.Graph.prototype.right=function(t){return t?(this.config.margin.right=t,this):this.config.margin.right},t.Graph.prototype.position=function(t){return t?(this.config.meta.position=t,this):this.config.meta.position},t.Graph.prototype.caption=function(t){return t?(this.config.meta.caption=t,this):this.config.meta.caption},t.Graph.prototype.subCaption=function(t){return t?(this.config.meta.subCaption=t,this):this.config.meta.caption},t.Graph.prototype.isDownloadable=function(t){return t?(this.config.meta.isDownload=t,this):this.config.meta.isDownload},t.Graph.prototype.max=function(){return null!==this.axes.meta.max?this.axes.meta.max:(this.axes.meta.max=t.util.getMax(this.graphdef,this.graphdef.stepup),this)},t.Graph.prototype.min=function(){return null!==this.axes.meta.min?this.axes.meta.min:(this.axes.meta.min=t.util.getMin(this.graphdef,this.graphdef.stepup),this)},t.Graph.prototype.toggleGraphGroup=function(e){{var a=this,n=a.categories[e],r=a.frame.select("g.cge-"+t.util.formatClassName(n)).style("display");t.util.getColorBand(a.config,e)}return a.frame.selectAll("g.cge-"+t.util.formatClassName(n)).style("display","none"===r?null:"none"),this},t.AreaGraph=function(e,a){var n=this;t.Graph.call(n,e,a).setDefaults().init(),n.areagroups=[],n.dataset=t.util.getDataArray(n.graphdef);var r,o,s,i,l=n.graphdef.dataset[n.graphdef.categories[0]];for(n.axes["Horizontal"===n.config.graph.orientation?"ver":"hor"].scale.domain(l.map(function(t){return t.name})),s=0,i=n.dataset.length;i>s;s+=1)o=n.chart.append("g").classed("cg-"+t.util.formatClassName(n.categories[s]),!0).append("g").classed("cge-"+t.util.formatClassName(n.categories[s]),!0).datum(n.dataset[s]),r={path:o,linefunc:void 0,areafunc:void 0,line:void 0,area:void 0},n["draw"+n.config.graph.orientation+"Area"](r,s),n.areagroups.push(r);n.finalize()},t.AreaGraph.prototype=t.util.inherits(t.Graph),t.AreaGraph.prototype.setDefaults=function(){var t=this;return t.graphdef.stepup="normal",this},t.AreaGraph.prototype.drawHorizontalArea=function(e,a){var n=this,r=t.util.getColorBand(n.config,a);n.axes.ver.scale.rangePoints([0,n.height()]),e.linefunc=d3.svg.line().x(function(t){return n.axes.hor.scale(t.value)}).y(function(t){return n.axes.ver.scale(t.name)+n.axes.ver.scale.rangeBand()/2}).interpolate(n.config.area.interpolation),e.areafunc=d3.svg.area().x0(n.axes.hor.scale(0)).x1(e.linefunc.x()).y(e.linefunc.y()).interpolate(n.config.area.interpolation),e.area=e.path.append("svg:path").classed(t.constants.classes.areapath+a,!0).attr("d",e.areafunc).style("opacity",n.config.area.opacity).style("-moz-opacity",n.config.area.opacity).style("fill",r),e.line=e.path.append("svg:path").classed(t.constants.classes.linepath+a,!0).attr("d",e.linefunc).style("stroke","white").style("fill","none"),e.path.selectAll("."+t.constants.classes.dot).data(n.dataset[a]).enter().append("circle").classed(t.constants.classes.dot,!0).attr("cx",e.linefunc.x()).attr("cy",e.linefunc.y()).attr("r",3.5).style("fill","white"); 
    2  
    3 },t.AreaGraph.prototype.drawVerticalArea=function(e,a){var n=this,r=t.util.getColorBand(n.config,a);n.axes.hor.scale.rangePoints([0,n.width()]),e.linefunc=d3.svg.line().x(function(t){return n.axes.hor.scale(t.name)+n.axes.hor.scale.rangeBand()/2}).y(function(t){return n.axes.ver.scale(t.value)}).interpolate(n.config.area.interpolation),e.areafunc=d3.svg.area().x(e.linefunc.x()).y0(e.linefunc.y()).y1(n.axes.ver.scale(0)).interpolate(n.config.area.interpolation),e.area=e.path.append("svg:path").classed(t.constants.classes.areapath+a,!0).attr("d",e.areafunc).style("opacity",n.config.area.opacity).style("-moz-opacity",n.config.area.opacity).style("fill",r),e.line=e.path.append("svg:path").classed(t.constants.classes.linepath+a,!0).attr("d",e.linefunc).style("stroke","white").style("fill","none"),e.path.selectAll("."+t.constants.classes.dot).data(n.dataset[a]).enter().append("circle").classed(t.constants.classes.dot,!0).attr("cx",e.linefunc.x()).attr("cy",e.linefunc.y()).attr("r",3.5).style("fill","white")},t.BarGraph=function(e,a){var n=this;t.Graph.call(n,e,a).setDefaults().init(),n.bargroups={},n.axes["Horizontal"===n.config.graph.orientation?"ver":"hor"].scale.domain(n.labels);var r,o,s=n.categories.length;for(r=0;s>r;r+=1)o=n.categories[r],n.bargroups[o]=n.chart.append("g").classed("cg-"+t.util.formatClassName(o),!0),n["draw"+n.config.graph.orientation+"Bars"](r);n.finalize()},t.BarGraph.prototype=t.util.inherits(t.Graph),t.BarGraph.prototype.setDefaults=function(){var t=this;return t.graphdef.stepup="normal",this},t.BarGraph.prototype.drawHorizontalBars=function(e){var a=this,n=t.util.getColorBand(this.config,e),r=a.categories.length,o=a.bargroups[a.categories[e]].selectAll("g").data(a.graphdef.dataset[a.categories[e]]).enter().append("g").classed("cge-"+t.util.formatClassName(a.categories[e]),!0).attr("transform",function(t){return t.value<0?"scale(-1,1)":void 0});o.append("rect").classed(t.util.formatClassName(a.categories[e]),!0).classed("cr-"+t.util.formatClassName(a.categories[e]),!0).attr("height",a.axes.ver.scale.rangeBand()/r).attr("x",function(t){return t.value<0?-a.axes.hor.scale(0):a.axes.hor.scale(0)}).attr("y",function(t){return a.axes.ver.scale(t.name)}).attr("width",0).style("stroke",a.config.bar.strokecolor).style("fill",n).transition().duration(a.config.effects.duration).delay(function(t,e){return e*a.config.effects.duration}).attr("width",function(t){return a.axes.hor.scale(Math.abs(t.value))-a.axes.hor.scale(0)}).call(t.util.endAll,function(n,r){d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseover",t.effects.bar.mouseover(a,e)),d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseout",t.effects.bar.mouseout(a,e)),"function"==typeof a.config.graph.clickCallback&&d3.select(this.parentNode.parentNode).selectAll("rect").on("click",function(t){a.config.graph.clickCallback.apply(null,[t])})}),o.append("text").attr("x",function(t){return a.axes.hor.scale(0)}).attr("y",function(t){return a.axes.ver.scale(t.name)+a.axes.ver.scale.rangeBand()/r/2}).attr("dx",function(t){return t.value<0?"-20px":"4px"}).attr("dy",".35em").attr("text-anchor","start").classed("cr-"+t.util.formatClassName(a.categories[e]),!0).style("fill",a.config.label.showlabel?t.util.getColorBand(a.config,e):"none").style("font-family",a.config.bar.fontfamily).style("font-size",a.config.bar.fontsize).style("font-weight",a.config.bar.fontweight).style("transform",function(t){return t.value<0?"scale(-1,1)":"scale(1,1)"}).style("opacity",0).text(function(e){return t.util.getLabelValue(a,e)}).transition().duration(a.config.effects.duration).delay(function(t,e){return e*a.config.effects.duration}).style("opacity",1).attr("x",function(t){return a.axes.hor.scale(t.value)}),o.append("svg:title").text(function(n,r){return t.util.getTooltipText(a,a.categories[e],a.labels[r],n)}),a.bargroups[a.categories[e]].attr("transform","translate(0,"+e*a.axes.ver.scale.rangeBand()/r+")")},t.BarGraph.prototype.drawVerticalBars=function(e){var a=this,n=t.util.getColorBand(this.config,e),r=a.categories.length,o=a.bargroups[a.categories[e]].selectAll("g").data(a.graphdef.dataset[a.categories[e]]).enter().append("g").classed("cge-"+t.util.formatClassName(a.categories[e]),!0).attr("transform",function(t){return t.value<0?"scale(1, -1)":void 0});o.append("rect").classed(t.util.formatClassName(a.categories[e]),!0).classed("cr-"+t.util.formatClassName(a.categories[e]),!0).attr("height",0).attr("width",a.axes.hor.scale.rangeBand()/r).attr("x",function(t){return a.axes.hor.scale(t.name)}).attr("y",function(t){return(t.value<0?-1:1)*(a.height()-a.axes.ver.scale(0))}).style("stroke",a.config.bar.strokecolor).style("fill",n).transition().duration(a.config.effects.duration).delay(e*a.config.effects.duration).attr("height",function(t){return Math.abs(a.axes.ver.scale(0)-a.axes.ver.scale(t.value))}).call(t.util.endAll,function(n,r){d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseover",t.effects.bar.mouseover(a,e)),d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseout",t.effects.bar.mouseout(a,e)),"function"==typeof a.config.graph.clickCallback&&d3.select(this.parentNode.parentNode).selectAll("rect").on("click",function(t){a.config.graph.clickCallback.apply(null,[t])})}),o.append("text").attr("transform",function(t){return t.value<0?"scale(1,1)":"scale(1,-1)"}).attr("x",function(t){return a.axes.hor.scale(t.name)+a.axes.hor.scale.rangeBand()/r/2}).attr("y",function(t){return a.height()-a.axes.ver.scale(0)}).attr("dx",0).attr("dy",function(t){return t.value<0?"2em":".35em"}).attr("text-anchor","middle").classed("cr-"+t.util.formatClassName(a.categories[e]),!0).style("fill",a.config.label.showlabel?t.util.getColorBand(a.config,e):"none").style("font-family",a.config.bar.fontfamily).style("font-size",a.config.bar.fontsize).style("font-weight",a.config.bar.fontweight).style("opacity",0).text(function(e){return t.util.getLabelValue(a,e)}).transition().duration(a.config.effects.duration).delay(e*a.config.effects.duration).style("opacity",1).attr("y",function(t){return-(a.height()-a.axes.ver.scale(t.value))-10}),o.append("svg:title").text(function(n,r){return t.util.getTooltipText(a,a.categories[e],a.labels[r],n)}),a.bargroups[a.categories[e]].attr("transform","translate("+e*a.axes.hor.scale.rangeBand()/r+","+a.height()+") scale(1,-1)")},t.DonutGraph=function(e,a){var n=this;t.Graph.call(n,e,a).setDefaults().init(),n.radius=2*Math.min(n.height(),n.width())/5,n.center={x:n.width()/2,y:n.height()/2},n.category=e.categories[0];var r=t.util.getCategoryData(n.graphdef,[n.category]),o=d3.svg.arc().innerRadius(n.radius*n.config.donut.factor).outerRadius(n.radius),s=d3.layout.pie();n.chart.data(r),n.arcs=n.chart.selectAll("g.arc").data(s).enter().append("g").classed(t.constants.classes.arc+t.util.formatClassName(n.category),!0).attr("transform","translate("+n.center.x+","+n.center.y+")"),n.arcs.append("path").attr("d",o).style("fill",function(e,a){return t.util.getColorBand(n.config,a)}).style("stroke",n.config.donut.strokecolor).style("stroke-width",n.config.donut.strokewidth).on("mouseover",t.effects.donut.mouseover(n.center,o,n.config)).on("mouseout",t.effects.donut.mouseout(n.center,n.config)),"function"==typeof n.config.graph.clickCallback&&n.arcs.on("click",function(t){n.config.graph.clickCallback.apply(null,[t])}),n.arcs.append("text").attr("transform",function(t){return"translate("+o.centroid(t)+")"}).attr("dy",".35em").attr("text-anchor","middle").style("fill",n.config.label.showlabel?n.config.donut.fontfill:"none").style("font-family",n.config.donut.fontfamily).style("font-size",n.config.donut.fontsize).style("font-weight",n.config.donut.fontweight).style("font-variant",n.config.donut.fontvariant).text(function(e){return t.util.getLabelValue(n,e)}),n.arcs.append("svg:title").text(function(e,a){return t.util.getTooltipText(n,n.category,n.labels[a],e)})},t.DonutGraph.prototype=t.util.inherits(t.Graph),t.DonutGraph.prototype.setDefaults=function(){var t=this;return t.graphdef.stepup="normal",this},t.LineGraph=function(e,a){var n=this;t.Graph.call(n,e,a).setDefaults().init(),n.linegroups={},n.dataset=t.util.getDataArray(n.graphdef);var r,o,s,i=n.categories.length,l=n.labels;for(n.axes["Horizontal"===n.config.graph.orientation?"ver":"hor"].scale.domain(l),s=0;i>s;s+=1)o=n.chart.append("g").classed("cg-"+t.util.formatClassName(n.categories[s]),!0).append("g").classed("cge-"+t.util.formatClassName(n.categories[s]),!0).datum(n.dataset[s]),r={path:o,func:void 0},n["draw"+n.config.graph.orientation+"Lines"](r,s),n.linegroups[n.categories[s]]=r;n.finalize()},t.LineGraph.prototype=t.util.inherits(t.Graph),t.LineGraph.prototype.setDefaults=function(){var t=this;return t.graphdef.stepup="normal",t.config.scale.ordinality=0,this},t.LineGraph.prototype.drawHorizontalLines=function(e,a){var n=this,r=n.axes,o=(n.config,t.util.getColorBand(n.config,a));return n.axes.ver.scale.rangePoints([0,n.height()]),e.func=d3.svg.line().x(function(t){return r.hor.scale(t.value)}).y(function(t){return r.ver.scale(t.name)+r.ver.scale.rangeBand()/2}).interpolate(t.config.line.interpolation),e.path.append("path").classed("cr-"+t.util.formatClassName(n.categories[a]),!0).attr("d",e.func).style("fill","none").style("stroke",o).style("stroke-width",n.config.line.strokewidth).style("stroke-opacity",n.config.line.strokeopacity).transition().duration(3*n.config.effects.duration).delay(2*a*n.config.effects.duration).style("stroke-opacity",1).call(t.util.endAll,function(e,r){d3.select(this.parentNode.parentNode).selectAll("path").on("mouseover",t.effects.line.mouseover(n,a)),d3.select(this.parentNode.parentNode).selectAll("path").on("mouseout",t.effects.line.mouseout(n,a)),d3.select(this.parentNode.parentNode).selectAll("circle").on("mouseover",t.effects.line.mouseover(n,a)),d3.select(this.parentNode.parentNode).selectAll("circle").on("mouseout",t.effects.line.mouseout(n,a))}),n.config.line.showcircles&&e.path.selectAll("circle").data(n.dataset[a]).enter().append("circle").classed("cr-"+t.util.formatClassName(n.categories[a]),!0).attr("cx",e.func.x()).attr("cy",e.func.y()).attr("r",n.config.line.circleradius).style("fill",o).style("fill-opacity",n.config.line.circleopacity).style("stroke","#fff").append("svg:title").text(function(e,r){return t.util.getTooltipText(n,n.categories[a],n.labels[r],e)}),e.path.selectAll("text").data(n.dataset[a]).enter().append("text").attr("x",function(t){return r.hor.scale(t.value)}).attr("y",function(t){return r.ver.scale(t.name)+r.ver.scale.rangeBand()/2}).attr("dx",10).attr("dy",".35em").attr("text-anchor","start").style("opacity",0).classed("cr-"+t.util.formatClassName(n.categories[a]),!0).style("fill",n.config.label.showlabel?t.util.getColorBand(n.config,a):"none").style("font-family",n.config.line.fontfamily).style("font-size",n.config.line.fontsize).style("font-weight",n.config.line.fontweight).text(function(e){return t.util.getLabelValue(n,e)}).transition().duration(3*n.config.effects.duration).delay(2*a*n.config.effects.duration).style("opacity",1),this},t.LineGraph.prototype.drawVerticalLines=function(e,a){var n=this,r=n.axes,o=(n.config,t.util.getColorBand(n.config,a));return n.axes.hor.scale.rangePoints([0,n.width()]),e.func=d3.svg.line().x(function(t){return r.hor.scale(t.name)+r.hor.scale.rangeBand()/2}).y(function(t){return r.ver.scale(t.value)}).interpolate(t.config.line.interpolation),e.path.append("path").attr("d",e.func).classed("cr-"+t.util.formatClassName(n.categories[a]),!0).style("fill","none").style("stroke",o).style("stroke-width",n.config.line.strokewidth).style("stroke-opacity",n.config.line.strokeopacity).transition().duration(n.config.effects.duration).delay(2*a*n.config.effects.duration).style("stroke-opacity",1).call(t.util.endAll,function(e,r){d3.select(this.parentNode.parentNode).selectAll("path").on("mouseover",t.effects.line.mouseover(n,a)),d3.select(this.parentNode.parentNode).selectAll("path").on("mouseout",t.effects.line.mouseout(n,a)),d3.select(this.parentNode.parentNode).selectAll("circle").on("mouseover",t.effects.line.mouseover(n,a)),d3.select(this.parentNode.parentNode).selectAll("circle").on("mouseout",t.effects.line.mouseout(n,a))}),n.config.line.showcircles&&e.path.selectAll("circle").data(n.dataset[a]).enter().append("circle").attr("cx",e.func.x()).attr("cy",e.func.y()).attr("r",n.config.line.circleradius).classed("cr-"+t.util.formatClassName(n.categories[a]),!0).style("fill",o).style("fill-opacity",n.config.line.circleopacity).style("stroke","#fff").append("svg:title").text(function(e,r){return t.util.getTooltipText(n,n.categories[a],n.labels[r],e)}),e.path.selectAll("text").data(n.dataset[a]).enter().append("text").attr("x",function(t){return r.hor.scale(t.name)+r.hor.scale.rangeBand()/2}).attr("y",function(t){return r.ver.scale(t.value)-20}).attr("dx",0).attr("dy",".71em").attr("text-anchor","middle").classed("cr-"+t.util.formatClassName(n.categories[a]),!0).style("fill",n.config.label.showlabel?t.util.getColorBand(n.config,a):"none").style("font-family",n.config.line.fontfamily).style("font-size",n.config.line.fontsize).style("font-weight",n.config.line.fontweight).style("opacity",0).text(function(e){return t.util.getLabelValue(n,e)}).transition().duration(3*n.config.effects.duration).delay(2*a*n.config.effects.duration).style("opacity",1),this},t.PercentAreaGraph=function(e,a){var n=this;t.Graph.call(n,e,a).setDefaults().init();{var r=d3.layout.stack().offset("zero")(n.categories.map(function(t){return e.dataset[t].map(function(t){return{x:t.name,y:+t.value}})})),o=n.labels;n.categories}n.axes["Horizontal"===n.config.graph.orientation?"ver":"hor"].scale.domain(o),n.areagroup=n.chart.selectAll("g.areagroup").data(r).enter().append("g").attr("class",function(e,a){return t.util.getClassName(this,"cge-"+n.categories[a])}),n["draw"+n.config.graph.orientation+"Area"](),n.finalize(!0)},t.PercentAreaGraph.prototype=t.util.inherits(t.Graph),t.PercentAreaGraph.prototype.setDefaults=function(){var t=this;return t.graphdef.stepup="percent",this},t.PercentAreaGraph.prototype.drawHorizontalArea=function(){var e=this,a=e.axes,n=e.categories,r=e.config,o=t.util.getSumUpArray(e.graphdef);a.ver.scale.rangePoints([0,e.height()]);for(var s=0;s<n.length;s+=1)t.effects.area.mouseover(e,s),t.effects.area.mouseout(e,s);e.areagroup.append("path").attr("class",function(e,a){return t.util.getClassName(this,t.constants.classes.area+t.util.formatClassName(n[a]))}).style("fill",function(e,a){return t.util.getColorBand(r,a)}).attr("d",d3.svg.area().y(function(t){return a.ver.scale(t.x)+a.ver.scale.rangeBand()/2}).x0(function(e,n){return a.hor.scale(t.util.getPercentage(e.y0,o[n]))}).x1(function(e,n){return a.hor.scale(t.util.getPercentage(e.y0+e.y,o[n]))}).interpolate(e.config.area.interpolation)).on("mouseover",function(t,a){e.effects[n[a]].mouseover()}).on("mouseout",function(t,a){e.effects[n[a]].mouseout()}),e.areagroup.append("path").attr("class",function(e,a){return t.util.getClassName(this,t.constants.classes.line+t.util.formatClassName(n[a]))}).style("stroke","white").style("fill","none").style("stroke-width",2).attr("d",d3.svg.line().y(function(t){return a.ver.scale(t.x)+a.ver.scale.rangeBand()/2}).x(function(e,n){return a.hor.scale(t.util.getPercentage(e.y0+e.y,o[n]))}).interpolate(e.config.area.interpolation))},t.PercentAreaGraph.prototype.drawVerticalArea=function(){var e=this,a=e.axes,n=e.categories,r=e.config,o=t.util.getSumUpArray(e.graphdef);a.hor.scale.rangePoints([0,e.width()]);for(var s=0;s<n.length;s+=1)t.effects.area.mouseover(e,s),t.effects.area.mouseout(e,s);e.areagroup.append("path").attr("class",function(e,a){return t.util.getClassName(this,t.constants.classes.area+t.util.formatClassName(n[a]))}).style("fill",function(e,a){return t.util.getColorBand(r,a)}).attr("d",d3.svg.area().x(function(t){return a.hor.scale(t.x)+a.hor.scale.rangeBand()/2}).y0(function(e,n){return a.ver.scale(t.util.getPercentage(e.y0,o[n]))}).y1(function(e,n){return a.ver.scale(t.util.getPercentage(e.y0+e.y,o[n]))}).interpolate(e.config.area.interpolation)).on("mouseover",function(t,a){e.effects[n[a]].mouseover()}).on("mouseout",function(t,a){e.effects[n[a]].mouseout()}),e.areagroup.append("path").attr("class",function(e,a){return t.util.getClassName(this,t.constants.classes.line+t.util.formatClassName(n[a]))}).style("stroke","white").style("fill","none").style("stroke-width",2).attr("d",d3.svg.line().x(function(t,e){return a.hor.scale(t.x)+a.hor.scale.rangeBand()/2}).y(function(e,n){return a.ver.scale(t.util.getPercentage(e.y0+e.y,o[n]))}).interpolate(e.config.area.interpolation))},t.PercentBarGraph=function(e,a){var n=this;t.Graph.call(n,e,a).setDefaults().init(),n.bargroups=[];var r,o,s,i,l,c=n.labels,f=c.map(function(t){return 0}),u=c.map(function(t){return 0});for(n.axes["Horizontal"===n.config.graph.orientation?"ver":"hor"].scale.domain(c),s=0,i=n.categories.length;i>s;s+=1)l=t.util.getColorBand(n.config,s),r=n.chart.append("g").classed("cg-"+n.categories[s],!0),o=r.selectAll("g").data(n.graphdef.dataset[n.categories[s]]).enter().append("g").classed("cge-"+t.util.formatClassName(n.categories[s]),!0),n["draw"+t.util.getPascalCasedName(n.config.graph.orientation)+"Bars"](o,f,u,s),"Vertical"===n.config.graph.orientation&&r.attr("transform","translate(0,"+2*n.height()+") scale(1,-1)"),n.bargroups.push(r);n.finalize()},t.PercentBarGraph.prototype=t.util.inherits(t.Graph),t.PercentBarGraph.prototype.setDefaults=function(){var t=this;return t.graphdef.stepup="percent",t.config.scale.ordinality=0,this},t.PercentBarGraph.prototype.drawHorizontalBars=function(e,a,n,r){var o=this,s=this.axes,i=t.util.getColorBand(this.config,r),l=(this.config,t.util.getSumUpArray(this.graphdef));e.append("rect").attr("height",s.ver.scale.rangeBand()).attr("width",0).attr("x",function(e,n){var r=s.hor.scale(t.util.getPercentage(a[n],l[n]));return a[n]+=e.value,r}).attr("y",function(t){return s.ver.scale(t.name)}).classed("cr-"+t.util.formatClassName(o.categories[r]),!0).style("stroke","none").style("fill",i).transition().duration(t.config.effects.duration).delay(r*t.config.effects.duration).attr("width",function(e,a){return s.hor.scale(t.util.getPercentage(e.value,l[a]))}).call(t.util.endAll,function(e,a){d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseover",t.effects.bar.mouseover(o,r,o.config.effects.textcolor)),d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseout",t.effects.bar.mouseout(o,r,o.config.effects.textcolor))}),e.append("text").attr("y",function(t){return s.ver.scale(t.name)+s.ver.scale.rangeBand()/2}).attr("dx",0).attr("dy",".35em").attr("text-anchor","end").classed("cr-"+t.util.formatClassName(o.categories[r]),!0).style("fill",o.config.label.showlabel?o.config.effects.textcolor:"none").style("font-family",this.config.bar.fontfamily).style("font-size",this.config.bar.fontsize).style("font-weight",this.config.bar.fontweight).text(function(e,n){return s.hor.scale(t.util.getPercentage(a[n],l[n]))>15?String(Math.round(t.util.getPercentage(e.value,l[n]))):null}).transition().duration(t.config.effects.duration).delay(r*t.config.effects.duration).attr("x",function(e,a){return n[a]+=e.value,s.hor.scale(t.util.getPercentage(n[a],l[a]))-5})},t.PercentBarGraph.prototype.drawVerticalBars=function(e,a,n,r){var o=this,s=this.height(),i=this.axes,l=t.util.getColorBand(this.config,r),c=(this.config,t.util.getSumUpArray(this.graphdef));e.append("rect").attr("height",0).attr("width",i.hor.scale.rangeBand()).attr("x",function(t){return i.hor.scale(t.name)}).attr("y",function(e,n){var r=i.ver.scale(t.util.getPercentage(a[n],c[n]));return a[n]-=e.value,r}).classed("cr-"+t.util.formatClassName(o.categories[r]),!0).style("stroke","none").style("fill",l).transition().duration(t.config.effects.duration).delay(r*t.config.effects.duration).attr("height",function(e,a){return s-i.ver.scale(t.util.getPercentage(e.value,c[a]))}).call(t.util.endAll,function(e,a){d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseover",t.effects.bar.mouseover(o,r,o.config.effects.textcolor)),d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseout",t.effects.bar.mouseout(o,r,o.config.effects.textcolor))}),e.append("text").attr("transform","scale(1,-1)").attr("x",function(t){return i.hor.scale(t.name)+i.hor.scale.rangeBand()/2}).attr("y",-s+5).attr("dy",".71em").attr("text-anchor","middle").classed("cr-"+t.util.formatClassName(o.categories[r]),!0).style("fill",o.config.label.showlabel?o.config.effects.textcolor:"none").style("font-family",this.config.bar.fontfamily).style("font-size",this.config.bar.fontsize).style("font-weight",this.config.bar.fontweight).text(function(e,a){return s-i.ver.scale(t.util.getPercentage(e.value,c[a]))>15?String(Math.round(t.util.getPercentage(e.value,c[a]))):null}).transition().duration(t.config.effects.duration).delay(r*t.config.effects.duration).attr("y",function(e,a){return n[a]+=e.value,-(2*s-i.ver.scale(t.util.getPercentage(n[a],c[a])))+5})},t.PieGraph=function(e,a){var n=this;t.Graph.call(n,e,a).setDefaults().init(),n.radius=2*Math.min(n.height(),n.width())/5,n.center={x:n.width()/2,y:n.height()/2},n.category=e.categories[0];var r=t.util.getCategoryData(n.graphdef,[n.category]),o=d3.svg.arc().innerRadius(0).outerRadius(n.radius),s=d3.layout.pie();n.chart.data(r),n.arcs=n.chart.selectAll("g.arc").data(s).enter().append("g").classed(t.constants.classes.arc+t.util.formatClassName(n.category),!0).attr("class",function(e,a){return t.util.getClassName(this,"cge-"+n.labels[a])}).attr("transform","translate("+n.center.x+","+n.center.y+")"),n.arcs.append("path").attr("d",o).style("fill",function(e,a){return t.util.getColorBand(n.config,a)}).style("stroke",n.config.pie.strokecolor).style("stroke-width",n.config.pie.strokewidth).on("mouseover",t.effects.pie.mouseover(n,n.center,o,n.config)).on("mouseout",t.effects.pie.mouseout(n,n.center,n.config)),n.arcs.append("text").attr("transform",function(t){return"translate("+o.centroid(t)+")"}).attr("dy",".35em").attr("text-anchor","middle").style("fill",n.config.label.showlabel?n.config.pie.fontfill:"none").style("font-family",n.config.pie.fontfamily).style("font-size",n.config.pie.fontsize).style("font-weight",n.config.pie.fontweight).style("font-variant",n.config.pie.fontvariant).text(function(e){return t.util.getLabelValue(n,e)}),n.arcs.append("svg:title").text(function(e,a){return t.util.getTooltipText(n,n.category,n.labels[a],e)}),"function"==typeof n.config.graph.clickCallback&&n.arcs.on("click",function(t){n.config.graph.clickCallback.apply(null,[t])})},t.PieGraph.prototype=t.util.inherits(t.Graph),t.PieGraph.prototype.setDefaults=function(){var t=this;return t.graphdef.stepup="normal",t.config.legend.legendtype="labels",this},t.PolarAreaGraph=function(e,a){var n=this;t.Graph.call(n,e,a).setDefaults().init(),n.maxRadius=2*Math.min(n.height(),n.width())/5,n.center={x:n.width()/2,y:n.height()/2},n.category=n.categories[0];for(var r=t.util.getCategoryData(n.graphdef,[n.category]),o=r[0].map(function(t,e){return t}),s=d3.layout.pie().value(function(t){return n.max()/r[0].length}),i=[],l=d3.svg.arc().innerRadius(0).outerRadius(function(t,e){return o[e]*n.maxRadius/n.max()}),c=1;c<=n.config.axis.ticks;c++)i[c]=n.maxRadius/n.config.axis.ticks*c;n.chart.data(r),n.arcs=n.chart.selectAll("g.arc").data(s).enter().append("g").classed(t.constants.classes.arc+t.util.formatClassName(n.category),!0).attr("transform","translate("+n.center.x+","+n.center.y+")"),n.arcs.append("path").attr("d",l).style("fill",function(e,a){return t.util.getColorBand(n.config,a)}).style("stroke",n.config.pie.strokecolor).style("stroke-width",n.config.pie.strokewidth),n.arcs.append("svg:title").text(function(e,a){return t.util.getTooltipText(n,n.category,n.labels[a],e)}),n.chart.selectAll("."+t.constants.classes.circleticks).data(i).enter().append("svg:g").classed(t.constants.classes.circleticks,!0).append("svg:circle").attr("r",function(t,e){return t}).style("stroke",n.config.axis.strokecolor).style("opacity",n.config.axis.opacity).style("fill","none").attr("transform","translate("+n.center.x+","+n.center.y+")"),"function"==typeof n.config.graph.clickCallback&&n.arcs.on("click",function(t){n.config.graph.clickCallback.apply(null,[t])})},t.PolarAreaGraph.prototype=t.util.inherits(t.Graph),t.PolarAreaGraph.prototype.setDefaults=function(){var t=this;return t.graphdef.stepup="normal",this},t.StackedAreaGraph=function(e,a){var n=this;t.Graph.call(n,e,a).setDefaults().init();var r=d3.layout.stack().offset(n.config.area.offset)(n.categories.map(function(t){return e.dataset[t].map(function(t){return{x:t.name,y:+t.value}})}));n.axes["Horizontal"===n.config.graph.orientation?"ver":"hor"].scale.domain(n.labels.map(function(t){return t})),n.areagroup=n.chart.append("g").selectAll("g").data(r).enter().append("g").attr("class",function(e,a){return t.util.getClassName(this,"cge-"+n.categories[a])}),n["draw"+n.config.graph.orientation+"Area"](),n.finalize()},t.StackedAreaGraph.prototype=t.util.inherits(t.Graph),t.StackedAreaGraph.prototype.setDefaults=function(){var t=this;return t.graphdef.stepup="stepup",this},t.StackedAreaGraph.prototype.drawHorizontalArea=function(){var e=this,a=e.axes,n=e.categories,r=e.config;a.ver.scale.rangePoints([0,e.height()]);for(var o=0;o<n.length;o+=1)t.effects.area.mouseover(e,o),t.effects.area.mouseout(e,o);return e.areagroup.append("path").attr("class",function(e,a){return t.util.getClassName(this,t.constants.classes.area+n[a])}).style("fill",function(e,a){return t.util.getColorBand(r,a)}).attr("d",d3.svg.area().y(function(t){return a.ver.scale(t.x)+a.ver.scale.rangeBand()/2}).x0(function(t){return a.hor.scale(t.y0)}).x1(function(t){return a.hor.scale(t.y0+t.y)}).interpolate(e.config.area.interpolation)).on("mouseover",function(t,a){e.effects[n[a]].mouseover()}).on("mouseout",function(t,a){e.effects[n[a]].mouseout()}),e.areagroup.append("path").attr("class",function(e,a){return t.util.getClassName(this,t.constants.classes.line+n[a])}).style("stroke","white").style("fill","none").style("stroke-width",2).attr("d",d3.svg.line().y(function(t){return a.ver.scale(t.x)+a.ver.scale.rangeBand()/2}).x(function(t){return a.hor.scale(t.y0+t.y)}).interpolate(e.config.area.interpolation)),e},t.StackedAreaGraph.prototype.drawVerticalArea=function(){var e=this,a=e.axes,n=e.categories,r=e.config;a.hor.scale.rangePoints([0,e.width()]);for(var o=0;o<n.length;o+=1)t.effects.area.mouseover(e,o),t.effects.area.mouseout(e,o);return e.areagroup.append("path").attr("class",function(e,a){return t.util.getClassName(this,t.constants.classes.area+n[a])}).style("fill",function(e,a){return t.util.getColorBand(r,a)}).attr("d",d3.svg.area().x(function(t){return a.hor.scale(t.x)+a.hor.scale.rangeBand()/2}).y0(function(t){return a.ver.scale(t.y0)}).y1(function(t){return a.ver.scale(t.y0+t.y)}).interpolate(e.config.area.interpolation)).on("mouseover",function(t,a){e.effects[n[a]].mouseover()}).on("mouseout",function(t,a){e.effects[n[a]].mouseout()}),e.areagroup.append("path").attr("class",function(e,a){return t.util.getClassName(this,t.constants.classes.line+n[a])}).style("stroke","white").style("fill","none").style("stroke-width",2).attr("d",d3.svg.line().x(function(t){return a.hor.scale(t.x)+a.hor.scale.rangeBand()/2}).y(function(t){return a.ver.scale(t.y0+t.y)}).interpolate(e.config.area.interpolation)),e},t.StackedBarGraph=function(e,a){var n=this;t.Graph.call(n,e,a).setDefaults().init(),n.bargroups={};var r,o,s=n.labels,i=s.map(function(t){return 0}),l=s.map(function(t){return 0});for(n.axes["Horizontal"===n.config.graph.orientation?"ver":"hor"].scale.domain(s),r=0,o=n.categories.length;o>r;r+=1)n.bargroups[n.categories[r]]=n.chart.append("g").classed("cg-"+t.util.formatClassName(n.categories[r]),!0),n["draw"+n.config.graph.orientation+"Bars"](r,i,l);n.finalize()},t.StackedBarGraph.prototype=t.util.inherits(t.Graph),t.StackedBarGraph.prototype.setDefaults=function(){var t=this;return t.graphdef.stepup="stepup",this},t.StackedBarGraph.prototype.drawHorizontalBars=function(e,a,n){var r=this,o=this.axes,s=t.util.getColorBand(this.config,e),i=this.config,l=this.bargroups[this.categories[e]],c=l.selectAll("g").data(this.graphdef.dataset[r.categories[e]]).enter().append("g").classed("cge-"+t.util.formatClassName(r.categories[e]),!0);c.append("rect").attr("height",o.ver.scale.rangeBand()).attr("width",0).attr("x",function(t,e){var n=o.hor.scale(a[e]);return a[e]+=t.value,n}).attr("y",function(t){return o.ver.scale(t.name)}).classed("cr-"+t.util.formatClassName(r.categories[e]),!0).style("stroke","none").style("fill",s).transition().duration(t.config.effects.duration).delay(e*t.config.effects.duration).attr("width",function(t,e){return o.hor.scale(a[e])-o.hor.scale(a[e]-t.value)}).each("end",function(a,n){d3.select(this).on("mouseover",t.effects.bar.mouseover(r,e,r.config.effects.textcolor)),d3.select(this).on("mouseout",t.effects.bar.mouseout(r,e,r.config.effects.textcolor)),"function"==typeof r.config.graph.clickCallback&&d3.select(this).on("click",function(t){r.config.graph.clickCallback.apply(null,[t])})}),c.append("text").attr("y",function(t){return o.ver.scale(t.name)+o.ver.scale.rangeBand()/2}).attr("dx",0).attr("dy",".35em").attr("text-anchor","end").classed("cr-"+t.util.formatClassName(r.categories[e]),!0).style("fill",r.config.label.showlabel?r.config.effects.textcolor:"none").style("font-family",i.bar.fontfamily).style("font-size",i.bar.fontsize).style("font-weight",i.bar.fontweight).style("opacity",0).text(function(e){return o.hor.scale(e.value)>15?t.util.getLabelValue(r,e):null}).transition().duration(t.config.effects.duration).delay(e*t.config.effects.duration).style("opacity",1).attr("x",function(t,e){return n[e]+=t.value,o.hor.scale(n[e])-5}),c.append("svg:title").text(function(a,n){return t.util.getTooltipText(r,r.categories[e],r.labels[n],a)})},t.StackedBarGraph.prototype.drawVerticalBars=function(e,a,n){var r=this,o=this.height(),s=this.axes,i=t.util.getColorBand(this.config,e),l=this.config,c=this.bargroups[r.categories[e]],f=c.selectAll("g").data(this.graphdef.dataset[r.categories[e]]).enter().append("g").classed("cge-"+t.util.formatClassName(r.categories[e]),!0);f.append("rect").attr("height",0).attr("width",s.hor.scale.rangeBand()).attr("x",function(t){return s.hor.scale(t.name)}).attr("y",function(t,e){var n=s.ver.scale(a[e]);return a[e]-=t.value,n}).classed("cr-"+t.util.formatClassName(r.categories[e]),!0).style("stroke","none").style("fill",i).transition().duration(t.config.effects.duration).delay(e*t.config.effects.duration).attr("height",function(t,e){return-(s.ver.scale(-a[e])-s.ver.scale(-a[e]-t.value))}).each("end",function(a,n){d3.select(this).on("mouseover",t.effects.bar.mouseover(r,e,r.config.effects.textcolor)),d3.select(this).on("mouseout",t.effects.bar.mouseout(r,e,r.config.effects.textcolor)),"function"==typeof r.config.graph.clickCallback&&d3.select(this).on("click",function(t){r.config.graph.clickCallback.apply(null,[t])})}),f.append("text").attr("transform","scale(1,-1)").attr("x",function(t){return s.hor.scale(t.name)+s.hor.scale.rangeBand()/2}).attr("y",-o+5).attr("dy",".71em").attr("text-anchor","middle").classed("cr-"+t.util.formatClassName(r.categories[e]),!0).style("fill",r.config.label.showlabel?r.config.effects.textcolor:"none").style("font-family",l.bar.fontfamily).style("font-size",l.bar.fontsize).style("font-weight",l.bar.fontweight).style("opacity",0).text(function(e){return o-s.ver.scale(e.value)>15?t.util.getLabelValue(r,e):null}).transition().duration(t.config.effects.duration).delay(e*t.config.effects.duration).style("opacity",1).attr("y",function(t,e){return n[e]+=t.value,-(2*o-s.ver.scale(n[e]))+5}),f.append("svg:title").text(function(a,n){return t.util.getTooltipText(r,r.categories[e],r.labels[n],a)}),c.attr("transform","translate(0,"+2*this.height()+") scale(1,-1)")},t.StepUpBarGraph=function(e,a){var n=this;t.Graph.call(n,e,a).setDefaults().init(),this.bargroups={};var r,o=n.categories.length,s=n.labels.map(function(t){ 
    4 return 0}),i=n.labels.map(function(t){return 0});for(n.axes["Horizontal"===this.config.graph.orientation?"ver":"hor"].scale.domain(this.labels),r=0;o>r;r+=1)n.bargroups[n.categories[r]]=this.chart.append("g").classed("cg-"+t.util.formatClassName(n.categories[r]),!0),n["draw"+n.config.graph.orientation+"Bars"](r,s,i);n.finalize()},t.StepUpBarGraph.prototype=t.util.inherits(t.Graph),t.StepUpBarGraph.prototype.setDefaults=function(){var t=this;return t.graphdef.stepup="stepup",this},t.StepUpBarGraph.prototype.drawHorizontalBars=function(e,a,n){var r=this,o=r.categories.length,s=t.util.getColorBand(r.config,e),i=r.bargroups[r.categories[e]],l=i.selectAll("g").data(r.graphdef.dataset[r.categories[e]]).enter().append("g").classed("cge-"+t.util.formatClassName(r.categories[e]),!0);l.append("rect").attr("height",r.axes.ver.scale.rangeBand()/o).attr("width",0).attr("x",function(t,e){var n=r.axes.hor.scale(a[e]);return a[e]+=t.value,t.value<0?-n:n}).attr("y",function(t){return r.axes.ver.scale(t.name)}).classed("cr-"+t.util.formatClassName(r.categories[e]),!0).style("stroke","none").style("fill",s).style("transform",function(t){return t.value<0?"scale(-1,1)":"scale(1,1)"}).transition().duration(r.config.effects.duration).delay(e*r.config.effects.duration).attr("width",function(t,e){return Math.abs(r.axes.hor.scale(a[e])-r.axes.hor.scale(a[e]-t.value))}).call(t.util.endAll,function(a,n){d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseover",t.effects.bar.mouseover(r,e)),d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseout",t.effects.bar.mouseout(r,e))}),l.append("text").attr("y",function(t){return r.axes.ver.scale(t.name)+r.axes.ver.scale.rangeBand()/o/2}).attr("dx",function(t){return t.value<0?-16:4}).attr("dy",".35em").attr("text-anchor","start").classed("cr-"+t.util.formatClassName(r.categories[e]),!0).style("fill",r.config.label.showlabel?t.util.getColorBand(r.config,e):"none").style("opacity",0).style("font-family",r.config.bar.fontfamily).style("font-size",r.config.bar.fontsize).style("font-weight",r.config.bar.fontweight).text(function(e){return t.util.getLabelValue(r,e)}).transition().duration(r.config.effects.duration).delay(e*r.config.effects.duration).style("opacity",1).attr("x",function(t,e){return n[e]+=t.value,r.axes.hor.scale(n[e])}),l.append("svg:title").text(function(a,n){return t.util.getTooltipText(r,r.categories[e],r.labels[n],a)}),i.attr("transform","translate(0,"+e*r.axes.ver.scale.rangeBand()/o+")")},t.StepUpBarGraph.prototype.drawVerticalBars=function(e,a,n){var r=this,o=r.categories.length,s=t.util.getColorBand(r.config,e),i=r.bargroups[r.categories[e]],l=i.selectAll("g").data(r.graphdef.dataset[r.categories[e]]).enter().append("g").classed("cge-"+t.util.formatClassName(r.categories[e]),!0);l.append("rect").attr("height",0).attr("width",r.axes.hor.scale.rangeBand()/o).attr("x",function(t){return r.axes.hor.scale(t.name)}).attr("y",function(t,e){var n=2*r.height()-r.axes.ver.scale(a[e]);return a[e]+=t.value,t.value<0?-n:n}).classed("cr-"+t.util.formatClassName(r.categories[e]),!0).style("stroke","none").style("fill",s).style("transform",function(t){return t.value<0?"scale(1,-1)":"scale(1,1)"}).transition().duration(r.config.effects.duration).delay(e*r.config.effects.duration).attr("height",function(t,e){return Math.abs(r.axes.ver.scale(-a[e])-r.axes.ver.scale(-a[e]-t.value))}).call(t.util.endAll,function(a,n){d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseover",t.effects.bar.mouseover(r,e)),d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseout",t.effects.bar.mouseout(r,e))}),l.append("text").attr("transform","scale(1,-1)").attr("x",function(t){return r.axes.hor.scale(t.name)+r.axes.hor.scale.rangeBand()/o/2}).attr("y",-r.height()-10).attr("dy",function(t){return t.value<0?"2.3em":".71em"}).attr("text-anchor","middle").classed("cr-"+t.util.formatClassName(r.categories[e]),!0).style("fill",r.config.label.showlabel?t.util.getColorBand(r.config,e):"none").style("font-family",r.config.bar.fontfamily).style("font-size",r.config.bar.fontsize).style("font-weight",r.config.bar.fontweight).style("opacity",0).text(function(e){return t.util.getLabelValue(r,e)}).transition().duration(r.config.effects.duration).delay(e*r.config.effects.duration).style("opacity",1).attr("y",function(t,e){return n[e]+=t.value,-(2*r.height()-r.axes.ver.scale(n[e]))-10}),l.append("svg:title").text(function(a,n){return t.util.getTooltipText(r,r.categories[e],r.labels[n],a)}),i.attr("transform","translate("+e*r.axes.hor.scale.rangeBand()/o+","+2*r.height()+") scale(1,-1)")},t.Table=function(){this.caption=void 0,this.position=void 0,this.graphdef=void 0,this.table=void 0,this.header=void 0,this.body=void 0,this.bodyrows={}},t.Table.prototype.init=function(e,a){this.graphdef=e,this.config=t.util.extend({},a),this.position=this.config.meta.pos||"body",this.table=d3.select(this.position).append("table").classed(this.config.table.tableclass,!0),this.header=this.table.append("thead").classed(this.config.table.headerclass,!0),this.body=this.table.append("tbody").classed(this.config.table.bodyclass,!0),this.footer=this.table.append("tfoot").classed(this.config.table.footerclass,!0)},t.Table.prototype.finalize=function(){},t.TableGraph=function(e,a){t.Table.apply(this,[e]),this.init(e,a),"Horizontal"===this.config.graph.orientation?this.setHorTable():this.setVerTable(),this.finalize()},t.TableGraph.prototype=t.util.inherits(t.Table),t.TableGraph.prototype.setHorTable=function(){var e=this.graphdef.categories,a=t.util.getTabularArray(this.graphdef);e.unshift(""),this.header.append("tr").selectAll("td").data(e).enter().append("td").text(function(t){return t}),e.shift(),this.bodyrows=this.body.selectAll("tr").data(a).enter().append("tr"),this.bodyrows.selectAll("td").data(function(t,e){return a[e]}).enter().append("td").attr("class",function(t,e){var a=0===e?"chart3rtablelabel":"chart3rtabledata";return d3.select(this).attr("class")+a}).text(function(t){return t})},t.TableGraph.prototype.setVerTable=function(){var e=t.util.getLabelArray(this.graphdef),a=this.graphdef.dataset;e.unshift(""),this.header.append("tr").selectAll("td").data(e).enter().append("td").text(function(t){return t}),e.shift(),this.bodyrows=this.body.selectAll("tr").data(this.graphdef.categories).enter().append("tr"),this.bodyrows.selectAll("td").data(function(t){var e,n,r=[];for(r.push(t),e=0,n=a[t].length;n>e;e+=1)r.push(a[t][e].value);return r}).enter().append("td").attr("class",function(t,e){var a=0===e?"chart3rtablelabel":"chart3rtabledata";return d3.select(this).attr("class")+a}).text(function(t){return t})},t.WaterfallGraph=function(e,a){var n=this;t.Graph.call(n,e,a).setDefaults().init(),n.bargroups={},n.axes["Horizontal"===n.config.graph.orientation?"ver":"hor"].scale.domain(n.labels);{var r;n.categories.length}r=n.categories[0],n.bargroups[r]=n.chart.append("g").classed("cg-"+t.util.formatClassName(r),!0),n["draw"+n.config.graph.orientation+"Bars"](0),n.finalize()},t.WaterfallGraph.prototype=t.util.inherits(t.Graph),t.WaterfallGraph.prototype.setDefaults=function(){var t=this;return t.graphdef.stepup="waterfall",t.config.legend.showlegends=!1,this},t.WaterfallGraph.prototype.drawHorizontalBars=function(e){var a=this,n=a.categories.length,r=t.util.getColorBand(a.config,e),o=a.bargroups[a.categories[e]],s=0,i=0,l=o.selectAll("g").data(a.graphdef.dataset[a.categories[e]]).enter().append("g").classed("cge-"+t.util.formatClassName(a.categories[e]),!0);l.append("rect").attr("height",a.axes.ver.scale.rangeBand()/n-2).attr("width",0).attr("x",function(t,e){var n=t.value<0?s+t.value:s;return s+=t.value,a.axes.hor.scale(n)}).attr("y",function(t){return a.axes.ver.scale(t.name)}).classed("cr-"+t.util.formatClassName(a.categories[e]),!0).style("stroke","none").style("fill",r).transition().duration(a.config.effects.duration).delay(e*a.config.effects.duration).attr("width",function(t){return a.axes.hor.scale(Math.abs(t.value))}).call(t.util.endAll,function(n,r){d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseover",t.effects.bar.mouseover(a,e)),d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseout",t.effects.bar.mouseout(a,e))}),l.append("text").attr("y",function(t){return a.axes.ver.scale(t.name)+a.axes.ver.scale.rangeBand()/n/2}).attr("dx",4).attr("dy",".35em").attr("text-anchor","start").classed("cr-"+t.util.formatClassName(a.categories[e]),!0).style("fill",a.config.label.showlabel?t.util.getColorBand(a.config,e):"none").style("font-family",a.config.bar.fontfamily).style("font-size",a.config.bar.fontsize).style("font-weight",a.config.bar.fontweight).text(function(e){return t.util.getLabelValue(a,e)}).transition().duration(a.config.effects.duration).delay(e*a.config.effects.duration).attr("x",function(t,e){var n=t.value<0?i:i+t.value;return i+=t.value,a.axes.hor.scale(n)}),l.append("svg:title").text(function(n,r){return t.util.getTooltipText(a,a.categories[e],a.labels[r],n)}),o.attr("transform","translate(0,"+e*a.axes.ver.scale.rangeBand()/n+")")},t.WaterfallGraph.prototype.drawVerticalBars=function(e){var a=this,n=t.util.getColorBand(this.config,e),r=a.categories.length,o=0,s=0,i=a.bargroups[a.categories[e]].selectAll("g").data(a.graphdef.dataset[a.categories[e]]).enter().append("g").classed("cge-"+t.util.formatClassName(a.categories[e]),!0);i.append("rect").classed("cr-"+t.util.formatClassName(a.categories[e]),!0).attr("height",0).attr("width",0).attr("x",function(t){return a.axes.hor.scale(t.name)}).attr("y",function(t){var e=t.value<0?o+t.value:o;return o+=t.value,a.height()-a.axes.ver.scale(e)}).style("stroke",a.config.bar.strokecolor).style("fill",n).transition().duration(a.config.effects.duration).delay(e*a.config.effects.duration).attr("height",function(t){return a.height()-a.axes.ver.scale(Math.abs(t.value))}).attr("width",a.axes.hor.scale.rangeBand()/r-2).call(t.util.endAll,function(n,r){d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseover",t.effects.bar.mouseover(a,e)),d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseout",t.effects.bar.mouseout(a,e))}),i.append("text").attr("transform","scale(1,-1)").attr("x",function(t){return a.axes.hor.scale(t.name)+a.axes.hor.scale.rangeBand()/r/2}).attr("y",-10).attr("dx",0).attr("dy",".35em").attr("text-anchor","middle").classed("cr-"+t.util.formatClassName(a.categories[e]),!0).style("fill",a.config.label.showlabel?t.util.getColorBand(a.config,e):"none").style("font-family",a.config.bar.fontfamily).style("font-size",a.config.bar.fontsize).style("font-weight",a.config.bar.fontweight).text(function(e){return t.util.getLabelValue(a,e)}).transition().duration(a.config.effects.duration).delay(e*a.config.effects.duration).attr("y",function(t){s+=t.value;var e=t.value<0?s-t.value:s;return-(a.height()-a.axes.ver.scale(e))-10}),i.append("svg:title").text(function(n,r){return t.util.getTooltipText(a,a.categories[e],a.labels[r],n)}),a.bargroups[a.categories[e]].attr("transform","translate("+e*a.axes.hor.scale.rangeBand()/r+","+a.height()+") scale(1,-1)")},{chart:t.chart}}(); 
     1!function(t,e){"object"==typeof module&&"object"==typeof module.exports?module.exports=t.document?e(t,!0):e(t):e(t)}("undefined"!=typeof window?window:this,function(t,e){"use strict";var a={};return a.util={},a.util.inherits=function(t){function e(){}return e.prototype=t.prototype||t,new e},a.util.getUniqueId=function(){return(new Date).getTime()},a.util.getMax=function(t,e){switch(e){case"stepup":return this.getStepMaxValue(t);case"normal":return this.getMaxValue(t);case"percent":return 100;case"waterfall":return this.getWaterfallMaxValue(t);default:console.error("Unknown classification for chart",e)}},a.util.getMaxValue=function(t){return d3.max(t.categories.map(function(e){return d3.max(t.dataset[e].map(function(t){return t.value}))}))},a.util.getStepMaxValue=function(t){var e=t.dataset[t.categories[0]].map(function(){return 0}),a=e.map(function(){return 0});return t.categories.map(function(n){t.dataset[n].map(function(t,n){t.resetSum===!0&&(e[n]=0),e[n]+=t.value,a[n]=d3.max([e[n],a[n]])})}),d3.max(a)},a.util.getWaterfallMaxValue=function(t){var e=t.categories.map(function(){return 0});return t.categories.map(function(a,n){var r=0;t.dataset[a].map(function(t){r+=t.value,e[n]<r&&(e[n]=r)})}),d3.max(e)},a.util.getMin=function(t,e){switch(e){case"normal":return this.getMinValue(t);case"stepup":return this.getStepMinValue(t);default:return 0}},a.util.getMinValue=function(t){return d3.min([0,d3.min(t.categories.map(function(e){return d3.min(t.dataset[e].map(function(t){return t.value}))}))])},a.util.getStepMinValue=function(t){var e=t.dataset[t.categories[0]].map(function(){return 0}),a=e.map(function(){return 0});return t.categories.map(function(n){t.dataset[n].map(function(t,n){e[n]+=t.value,a[n]=d3.min([e[n],a[n]])})}),d3.min(a)},a.util.getSumUpArray=function(t){var e=t.dataset[t.categories[0]].map(function(){return 0});return t.categories.map(function(a){t.dataset[a].map(function(t,a){e[a]+=t.value})}),e},a.util.getPercentage=function(t,e){return 100*t/e},a.util.getDataArray=function(t){return t.categories.map(function(e){return t.dataset[e]})},a.util.getTabularArray=function(t){var e,a,n,r,o=[],s=[];for(e=0,r=t.dataset[t.categories[0]].length;r>e;e+=1){for(s=[],s.push(t.dataset[t.categories[0]][e].name),a=0,n=t.categories.length;n>a;a+=1)s.push(t.dataset[t.categories[a]][e].value);o.push(s)}return o},a.util.getLabelArray=function(t,e){return t.dataset[t.categories[e?e:0]].map(function(t){return t.name})},a.util.getCategoryArray=function(t){return t.categories.map(function(t){return t})},a.util.getCategoryData=function(t,e){return e.map(function(e){return t.dataset[e].map(function(t){return t.value})})},a.util.transposeData=function(t){var e,a,n,r,o,s,i,l,c={},f=t.dataset[t.categories[0]].map(function(t){return t.name});for(e=0,n=f.length;n>e;e+=1)c[f[e]]=[];for(e=0,n=t.categories.length;n>e;e+=1)for(s=t.categories[e],a=0,r=t.dataset[s].length;r>a;a+=1)i=t.dataset[s][a].name,l=t.dataset[s][a].value,o=t.dataset[s][a].resetSum,c[i].push({name:s,value:l,resetSum:o});t.categories=f,t.dataset=c},a.util.getPascalCasedName=function(t){return t.substring(0,1).toUpperCase()+t.substring(1)},a.util.getColorBand=function(t,e){{var n=0;t.graph.palette||"Default"}return t.graph.custompalette&&0!==t.graph.custompalette.length?(n=t.graph.custompalette.length,t.graph.custompalette[e%n]):(n=a.palette[t.graph.palette].length,a.palette[t.graph.palette][e%n])},a.util.formatClassName=function(t){var e=t.trim().replace(/[^A-Za-z0-9_\-]/g,"-").toLowerCase();return e},a.util.svgToPng=function(e,a){if(this.isCanvasSupported()){var n=d3.select(e.frame.node().parentNode).html(),r=document.createElement("canvas"),o=r.getContext("2d");r.setAttribute("width",d3.select(e.frame.node()).attr("width")),r.setAttribute("height",d3.select(e.frame.node()).attr("height")),o.drawSvg(n),r.toBlob(function(e){var a=document.createElement("a");document.body.appendChild(a),a.style="display: none";var n=t.URL.createObjectURL(e);a.href=n,a.download="png_download"+Math.ceil(1e5*Math.random())+".png",a.click()},"image/png"),a.call()}else console.log("uvCharts: Download feature is not supported in this version of browser")},a.util.isDownloadSupported=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return"function"==typeof e.drawSvg&&"function"==typeof t.toBlob},a.util.isCanvasSupported=function(){var t=document.createElement("canvas");return!(!t.getContext||!t.getContext("2d"))},a.util.endAll=function(t,e){var a=0;t.each(function(){++a}).each("end",function(){--a||e.apply(this,arguments)})},a.util.getClassName=function(t,e){var n=a.util.formatClassName(e);return d3.select(t).attr("class")?-1!==d3.select(t).attr("class").split(" ").indexOf(n)?d3.select(t).attr("class"):d3.select(t).attr("class")+" "+n:n},a.util.getLabelValue=function(t,e){if(void 0!==t.config.label.formatter)return t.config.label.formatter(e.value);var a=e.value%1===0?e.value:e.value.toFixed(t.config.label.precision);return t.config.label.prefix+String(a)+t.config.label.suffix},a.util._deepClone=function(t,e){if("object"==typeof e){var n=!0;for(var r in e)n=!1,e.hasOwnProperty(r)&&(void 0===t&&(t=Array.isArray(e)?[]:{}),t[r]=a.util._deepClone(t[r],e[r]));n&&(t=Array.isArray(e)?[]:{})}else t=e;return t},a.util.extend=function(){if(void 0===arguments[0]||null===arguments[0])return arguments[0];for(var t=1;t<arguments.length;t++)for(var e in arguments[t])arguments[t].hasOwnProperty(e)&&(arguments[0][e]=a.util._deepClone(arguments[0][e],arguments[t][e]));return arguments[0]},a.util.getTooltipText=function(t,e,n,r){if(!t.config.tooltip.show)return"";var o=t.config.tooltip.format;return""===o?e+" ["+n+"] : "+a.util.getLabelValue(r):o.replace(/%c/gi,e).replace(/%l/gi,n).replace(/%v/gi,a.util.getLabelValue(t,r))},a.config={graph:{palette:"Default",bgcolor:"#FFFFFF",orientation:"Horizontal",max:0,min:0,custompalette:[],opacity:1,responsive:!1,align:"xMinYMin",meetOrSlice:"meet"},meta:{position:"#uv-div",caption:"",subcaption:"",hlabel:"",vlabel:"",hsublabel:"",vsublabel:"",isDownloadable:!1,downloadLabel:"Download"},dimension:{width:400,height:400},margin:{top:50,bottom:150,left:100,right:100},frame:{bgcolor:"#FFFFFF"},axis:{ticks:8,subticks:2,padding:5,minor:-10,strokecolor:"#000000",fontfamily:"Arial",fontsize:"14",fontweight:"bold",showticks:!0,showsubticks:!0,showtext:!0,showhortext:!0,showvertext:!0,opacity:.1},label:{fontfamily:"Arial",fontsize:"11",fontweight:"normal",strokecolor:"#000000",showlabel:!0,precision:2,prefix:"",suffix:"",formatter:void 0},tooltip:{show:!0,format:"%c [%l]: %v"},scale:{type:"linear",ordinality:.2},bar:{strokecolor:"none",fontfamily:"Arial",fontsize:"10",fontweight:"bold",textcolor:"#000"},line:{interpolation:"linear",showcircles:!0,circleradius:3.5,circleopacity:.6,fontfamily:"Arial",fontsize:"10",fontweight:"bold",textcolor:"#000",strokewidth:1.5,strokeopacity:1},area:{interpolation:"cardinal",offset:"zero",opacity:.2},pie:{fontfamily:"Arial",fontsize:"14",fontweight:"normal",fontvariant:"small-caps",fontfill:"#FFFFFF",strokecolor:"#FFFFFF",strokewidth:1},donut:{fontfamily:"Arial",fontsize:"14",fontweight:"normal",fontvariant:"small-caps",fontfill:"#000",factor:.4,strokecolor:"#FFFFFF",strokewidth:1},caption:{fontfamily:"Arial",fontsize:"14",fontweight:"bold",fontvariant:"small-caps",textdecoration:"none",hovercolor:"#696969",strokecolor:"#0000FF",textanchor:"middle",cursor:"pointer"},subCaption:{fontfamily:"Arial",fontsize:"9",fontweight:"normal",fontvariant:"normal",textdecoration:"none",textanchor:"middle"},legend:{position:"bottom",fontfamily:"Arial",fontsize:"11",fontweight:"normal",color:"#000000",strokewidth:.15,textmargin:15,symbolsize:10,inactivecolor:"#DDD",legendstart:0,legendtype:"categories",showlegends:!0},effects:{hovercolor:"#FF0000",strokecolor:"none",textcolor:"#000000",duration:800,hover:400,showhovertext:!1}},a.constants={},a.constants.classes={uv:"uv",pos:"uv-div",frame:"uv-frame",panel:"uv-panel",bg:"uv-chart-bg",chart:"uv-chart",axes:"uv-axes",legend:"uv-legend",framebg:"uv-frame-bg",horaxis:"uv-hor-axis",veraxis:"uv-ver-axis",caption:"uv-caption",captiontext:"uv-caption-text",subcaption:"uv-subcaption",subcaptiontext:"uv-subcaption-text",axeslabelgroup:"uv-axes-label-group",axeslabel:"uv-axes-label",axessublabel:"uv-axes-sub-label",legendsign:"uv-legend-sign",legendlabel:"uv-legend-label",hoverbg:"uv-hover-bg",arc:"uv-arc-",areapath:"uv-areapath-",linepath:"uv-linepath-",area:"uv-area-",line:"uv-line-",dot:"uv-dot",chartdiv:"uv-chart-div",circleticks:"circle-ticks",download:"uv-download-options"},a.constants.downloads={downloadLabel:"Download"},a.types={},a.addChart=function(t,e){a.types[t]=e},a.addChart("bar","BarGraph"),a.addChart("line","LineGraph"),a.addChart("stackedbar","StackedBarGraph"),a.addChart("stepupbar","StepUpBarGraph"),a.addChart("area","AreaGraph"),a.addChart("stackedarea","StackedAreaGraph"),a.addChart("percentbar","PercentBarGraph"),a.addChart("percentarea","PercentAreaGraph"),a.addChart("pie","PieGraph"),a.addChart("donut","DonutGraph"),a.addChart("waterfall","WaterfallGraph"),a.addChart("polararea","PolarAreaGraph"),a.chart=function(t,e,n){return t=t.toLowerCase(),void 0!==a.types[t]?new a[a.types[t]](e,n):void 0},a.effects={},a.effects.bar={},a.effects.bar.mouseover=function(t,e){var n=t.config,r=t.categories[e],o=t.labels[e],s=function(){t.frame.selectAll("rect.cr-"+a.util.formatClassName(r)).transition().duration(n.effects.hover).style("fill",n.effects.hovercolor).style("stroke",n.effects.strokecolor),n.effects.showhovertext&&t.frame.selectAll("text.cr-"+a.util.formatClassName(r)).transition().duration(n.effects.hover).style("fill",n.effects.textcolor).style("opacity",1)};return"categories"===n.legend.legendtype?t.effects[r].mouseover=s:t.effects[o].mouseover=s,s},a.effects.bar.mouseout=function(t,e,n){var r=t.config,o=t.categories[e],s=a.util.getColorBand(t.config,e),i=n||a.util.getColorBand(t.config,e),l=t.labels[e],c=function(){t.frame.selectAll("rect.cr-"+a.util.formatClassName(o)).transition().duration(r.effects.hover).style("fill",s).style("stroke","none"),t.frame.selectAll("text.cr-"+a.util.formatClassName(o)).transition().duration(r.effects.hover).style("fill",t.config.label.showlabel?i:"none")};return"categories"===r.legend.legendtype?t.effects[o].mouseout=c:t.effects[l].mouseout=c,c},a.effects.area={},a.effects.area.mouseover=function(t,e){var n=t.config,r=t.categories[e],o=function(){t.frame.selectAll(".cge-"+a.util.formatClassName(r)).select("path."+a.constants.classes.area+a.util.formatClassName(r)).transition().duration(n.effects.hover).style("fill",n.effects.hovercolor)};return t.effects[r].mouseover=o,o},a.effects.area.mouseout=function(t,e){var n=t.config,r=t.categories[e],o=function(){t.frame.selectAll(".cge-"+a.util.formatClassName(r)).select("path."+a.constants.classes.area+a.util.formatClassName(r)),t.frame.selectAll(".cge-"+a.util.formatClassName(r)).select("path."+a.constants.classes.area+a.util.formatClassName(r)).transition().duration(n.effects.hover).style("fill",a.util.getColorBand(n,e))};return t.effects[r].mouseout=o,o},a.effects.line={},a.effects.line.mouseover=function(t,e){var n=t.config,r=t.categories[e],o=function(){t.frame.selectAll(".cge-"+a.util.formatClassName(r)).selectAll("circle").transition().duration(n.effects.hover).style("fill",n.effects.hovercolor).style("fill-opacity",1).style("stroke",n.effects.hovercolor),t.frame.selectAll(".cge-"+a.util.formatClassName(r)).select("path").transition().duration(n.effects.hover).style("stroke",n.effects.hovercolor),n.effects.showhovertext&&t.frame.selectAll(".cge-"+a.util.formatClassName(r)).selectAll("text").transition().duration(n.effects.hover).style("fill",n.effects.textcolor)};return t.effects[r].mouseover=o,o},a.effects.line.mouseout=function(t,e,n){var r=t.config,o=t.categories[e],s=n||a.util.getColorBand(t.config,e),i=function(){t.frame.selectAll(".cge-"+a.util.formatClassName(o)).selectAll("circle").transition().duration(r.effects.hover).style("fill",s).style("fill-opacity",.6).style("stroke","#fff"),t.frame.selectAll(".cge-"+a.util.formatClassName(o)).select("path").transition().duration(r.effects.hover).style("stroke",s),t.frame.selectAll(".cge-"+a.util.formatClassName(o)).selectAll("text").transition().duration(r.effects.hover).style("fill",t.config.label.showlabel?s:"none")};return t.effects[o].mouseout=i,i},a.effects.caption={},a.effects.caption.mouseover=function(t){return function(){d3.select(this.parentNode.parentNode).select("."+a.constants.classes.hoverbg).transition().duration(t.effects.duration).style("fill",t.caption.hovercolor)}},a.effects.caption.mouseout=function(t){return function(){d3.select(this.parentNode.parentNode).select("."+a.constants.classes.hoverbg).transition().duration(t.effects.duration).style("fill",t.graph.bgcolor)}},a.effects.donut={},a.effects.donut.mouseover=function(t,e,a,n){return function(n){var r={x:e.centroid(n)[0]/5,y:e.centroid(n)[1]/5};d3.select(this.parentNode).transition().duration(a.effects.duration).attr("transform","translate("+(t.x+r.x)+","+(t.y+r.y)+")")}},a.effects.donut.mouseout=function(t,e){return function(){d3.select(this.parentNode).transition().duration(e.effects.duration).attr("transform","translate("+t.x+","+t.y+")")}},a.effects.pie={},a.effects.pie.mouseover=function(t,e,a,n){var r=function(t){var r={x:a.centroid(t)[0]/5,y:a.centroid(t)[1]/5};d3.select(this.parentNode).transition().duration(n.effects.duration).attr("transform","translate("+(e.x+r.x)+","+(e.y+r.y)+")")};return r},a.effects.pie.mouseout=function(t,e,a){var n=function(){d3.select(this.parentNode).transition().duration(a.effects.duration).attr("transform","translate("+e.x+","+e.y+")")};return n},a.effects.legend={},a.effects.legend.mouseover=function(t,e){return"categories"===t.config.legend.legendtype?t.effects.group[t.categories[e]].mouseover:t.effects.group[t.labels[e]].mouseover},a.effects.legend.mouseout=function(t,e){return"categories"===t.config.legend.legendtype?t.effects.group[t.categories[e]].mouseout:t.effects.group[t.labels[e]].mouseout},a.effects.legend.click=function(t,e,n){var r="false"===d3.select(e).attr("disabled")?!1:!0;n.toggleGraphGroup(t),d3.select(e).select("rect").style("fill",r?a.util.getColorBand(n.config,t):a.config.legend.inactivecolor),d3.select(e).select("text").style("fill",r?null:a.config.legend.inactivecolor),d3.select(e).attr("disabled",r?"false":"true")},a.palette={Default:["#00BBC9","#EC63AB","#AA8AE4","#83CE44","#ff8f25","#009EAA","#CA4F7F","#9C70C0","#6BAF3B"],OldDefault:["#7E6DA1","#C2CF30","#FF8900","#FE2600","#E3003F","#8E1E5F","#FE2AC2","#CCF030","#9900EC","#3A1AA8","#3932FE","#3276FF","#35B9F6","#42BC6A","#91E0CB"],Plain:["#B1EB68","#B1B9B5","#FFA16C","#9B64E7","#CEE113","#2F9CFA","#CA6877","#EC3D8C","#9CC66D","#C73640","#7D9532","#B064DC"],Android:["#33B5E5","#AA66CC","#99CC00","#FFBB33","#FF4444","#0099CC","#9933CC","#669900","#FF8800","#CC0000"],Soft:["#9ED8D2","#FFD478","#F16D9A","#A8D59D","#FDC180","#F05133","#EDED8A","#F6A0A5","#9F218B"],Simple:["#FF8181","#FFB081","#FFE081","#EFFF81","#BFFF81","#90FF81","#81FFA2","#81FFD1","#9681FF","#C281FF","#FF81DD"],Egypt:["#3A3E04","#784818","#FCFCA8","#C03C0C","#F0A830","#A8783C","#FCFCFC","#FCE460","#540C00","#C0C084","#3C303C","#1EA34A","#606C54","#F06048"],Olive:["#18240C","#3C6C18","#60A824","#90D824","#A8CC60","#789C60","#CCF030","#B4CCA8","#D8F078","#40190D","#E4F0CC"],Candid:["#AF5E14","#81400C","#E5785D","#FEBFBF","#A66363","#C7B752","#EFF1A7","#83ADB7","#528F98","#BCEDF5","#446B3D","#8BD96F","#E4FFB9"],Sulphide:["#594440","#0392A7","#FFC343","#E2492F","#007257","#B0BC4A","#2E5493","#7C2738","#FF538B","#A593A1","#EBBA86","#E2D9CA"],Lint:["#A8A878","#F0D89C","#60909C","#242418","#E49C30","#54483C","#306090","#C06C00","#C0C0C0","#847854","#6C3C00","#9C3C3C","#183C60","#FCCC00","#840000","#FCFCFC"]},a.Graph=function(t,e){var n=this;return n.id=a.util.getUniqueId(),n.graphdef=null,n.config=null,n.frame=null,n.panel=null,n.chart=null,n.bg=null,n.effects={},n.axes={hor:{group:null,scale:null,func:null,axis:null,line:null,label:null},ver:{group:null,scale:null,func:null,axis:null,line:null,label:null},meta:{min:null,max:null}},n.labels=null,n.categories=null,n.graphdef=t,n.config=a.util.extend({},a.config,e),this},a.Graph.prototype.init=function(){var t=this;return t.max().min().position(t.config.meta.position||"body").setDimensions().setFrame().setPanel().setBackground().setCaption().setSubCaption().setMetadata().setHorizontalAxis().setVerticalAxis().setEffectsObject(),t.config.meta.isDownloadable&&t.setDownloadOptions(),t.config.legend.showlegends&&t.setLegend(),t},a.Graph.prototype.setDimensions=function(){var t=this;return t.height(t.config.dimension.height).width(t.config.dimension.width).top(t.config.margin.top).bottom(t.config.margin.bottom).left(t.config.margin.left).right(t.config.margin.right),this},a.Graph.prototype.setDownloadOptions=function(){if(a.util.isDownloadSupported()){var t=this;t.download=t.panel.append("g").classed(a.constants.classes.download,!0),t.download.append("text").classed(a.constants.classes.download,!0).text(t.config.meta.downloadLabel).attr("y",-t.config.margin.top/2).attr("x",t.config.dimension.width-25).attr("text-anchor",t.config.caption.textanchor).style("font-family",t.config.caption.fontfamily).style("font-size","12").style("cursor",t.config.caption.cursor).style("stroke",t.config.caption.strokecolor).style("text-decoration","underline").on("mouseover",function(){var t=d3.select(this);t.style("color","#0000FF")}).on("mouseout",function(){var t=d3.select(this);t.style("color","#8D8D8D")}).on("click",function(){var e=d3.select(this);e.style("display","none"),a.util.svgToPng(t,function(){e.style("display",null)})})}},a.Graph.prototype.setFrame=function(){var t=this;return t.frame||(t.frame=d3.select(t.position()||"body").append("div").classed(a.constants.classes.chartdiv,!0).style("display","inline-block").style("width","100%").style("height","100%").append("svg")),t.frame.attr("id",a.constants.classes.uv+"-"+t.id).classed(a.constants.classes.frame,!0),t.config.graph.responsive===!0?t.frame.attr("width","100%").attr("height","100%").attr("preserveAspectRatio",t.config.graph.align+" "+t.config.graph.meetOrSlice).attr("viewBox","0 0 "+(t.width()+t.left()+t.right())+" "+(t.height()+t.top()+t.bottom())):t.frame.attr("width",t.width()+t.left()+t.right()).attr("height",t.height()+t.top()+t.bottom()),t.frame.append("rect").classed(a.constants.classes.framebg,!0).attr("width",t.width()+t.left()+t.right()).attr("height",t.height()+t.top()+t.bottom()).style("fill",t.config.frame.bgcolor),this},a.Graph.prototype.setPanel=function(){var t=this;return t.panel||(t.panel=t.frame.append("g")),t.panel.attr("id",a.constants.classes.panel+"-"+t.id).classed(a.constants.classes.panel,!0).attr("transform","translate("+t.left()+","+t.top()+")"),this},a.Graph.prototype.setBackground=function(t){var e=this;return e.bg||(e.bg=e.panel.append("rect").classed(a.constants.classes.bg,!0).attr("height",e.height()).attr("width",e.width())),e.bg.style("fill",t||e.config.graph.bgcolor),e.chart=e.panel.append("g").classed(a.constants.classes.chart,!0).style("opacity",e.config.graph.opacity),this},a.Graph.prototype.setCaption=function(){var t=this;return t.caption=t.panel.append("g").classed(a.constants.classes.caption,!0),t.caption.append("text").classed(a.constants.classes.captiontext,!0).text(t.config.meta.caption).attr("y",-t.config.margin.top/2).attr("x",t.config.dimension.width/2).attr("text-anchor",t.config.caption.textanchor).style("font-family",t.config.caption.fontfamily).style("font-size",t.config.caption.fontsize).style("font-weight",t.config.caption.fontweight).style("font-variant",t.config.caption.fontvariant).style("text-decoration",t.config.caption.textdecoration).on("mouseover",a.effects.caption.mouseover(t.config)).on("mouseout",a.effects.caption.mouseout(t.config)),this},a.Graph.prototype.setSubCaption=function(){var t=this;return t.subCaption=t.panel.append("g").classed(a.constants.classes.subcaption,!0),t.subCaption.append("text").classed(a.constants.classes.subcaptiontext,!0).text(t.config.meta.subcaption).attr("y",-t.config.margin.top/2+1*t.config.caption.fontsize).attr("x",t.config.dimension.width/2).attr("text-anchor",t.config.caption.textanchor).style("font-family",t.config.subCaption.fontfamily).style("font-size",t.config.subCaption.fontsize).style("font-weight",t.config.subCaption.fontweight).style("font-variant",t.config.subCaption.fontvariant).style("text-decoration",t.config.subCaption.textdecoration),this},a.Graph.prototype.setMetadata=function(){var t=this;return t.labels=a.util.getLabelArray(t.graphdef),t.categories=a.util.getCategoryArray(t.graphdef),this},a.Graph.prototype.setHorizontalAxis=function(){{var t=this;t.graphdef}return t.axes.hor.group||(t.axes.hor.group=t.panel.append("g").classed(a.constants.classes.horaxis,!0).attr("transform","translate(0,"+t.height()+")").style("shape-rendering","crispEdges")),"Horizontal"===t.config.graph.orientation?(t.axes.hor.scale=d3.scale[t.config.scale.type]().domain(["log"===t.config.scale.type?1:t.min(),t.max()]).range([0,t.width()]),t.axes.hor.scale.nice&&t.axes.hor.scale.nice(),t.config.axis.showsubticks||(t.config.axis.subticks=0),t.axes.hor.func=d3.svg.axis().scale(t.axes.hor.scale).ticks(t.config.axis.ticks).tickSize(-t.height(),t.config.axis.minor,0).tickPadding(t.config.axis.padding).tickSubdivide(t.config.axis.subticks).orient("bottom")):(t.axes.hor.scale=d3.scale.ordinal().rangeRoundBands([0,t.width()],t.config.scale.ordinality),t.axes.hor.func=d3.svg.axis().scale(t.axes.hor.scale).tickPadding(t.config.axis.padding).orient("bottom"),t.config.axis.showtext&&t.config.axis.showhortext||t.axes.hor.func.tickSize(0)),t.config.axis.showtext&&t.config.axis.showhortext||t.axes.hor.func.tickFormat(function(t){return""}),this},a.Graph.prototype.setVerticalAxis=function(){{var t=this;t.graphdef}return t.axes.ver.group||(t.axes.ver.group=t.panel.append("g").classed(a.constants.classes.veraxis,!0).style("shape-rendering","crispEdges")),"Vertical"===t.config.graph.orientation?(t.axes.ver.scale=d3.scale[t.config.scale.type]().domain([t.max(),"log"===t.config.scale.type?1:t.min()]).range([0,t.height()]),t.axes.ver.scale.nice&&t.axes.ver.scale.nice(),t.config.axis.showsubticks||(t.config.axis.subticks=0),t.axes.ver.func=d3.svg.axis().scale(t.axes.ver.scale).ticks(t.config.axis.ticks).tickSize(-t.width(),t.config.axis.minor,0).tickPadding(t.config.axis.padding).tickSubdivide(t.config.axis.subticks).orient("left")):(t.axes.ver.scale=d3.scale.ordinal().rangeRoundBands([0,t.height()],t.config.scale.ordinality),t.axes.ver.func=d3.svg.axis().scale(t.axes.ver.scale).tickPadding(t.config.axis.padding).orient("left"),t.config.axis.showtext&&t.config.axis.showvertext||t.axes.ver.func.tickSize(0)),t.config.axis.showtext&&t.config.axis.showvertext||t.axes.ver.func.tickFormat(function(t){return""}),this},a.Graph.prototype.setEffectsObject=function(){for(var t=this,e="categories"===t.config.legend.legendtype?t.categories:t.labels,a=0;a<e.length;a++)t.effects[e[a]]={};return t},a.Graph.prototype.drawHorizontalAxis=function(){var t=this;return t.axes.hor.axis=t.axes.hor.group.append("g").style("font-family",t.config.label.fontfamily).style("font-size",t.config.label.fontsize).style("font-weight",t.config.label.fontweight).call(t.axes.hor.func),t.config.axis.showticks&&t.axes.hor.axis.selectAll("line").style("stroke",t.config.axis.strokecolor).style("opacity",t.config.axis.opacity),t.axes.hor.axis.selectAll("path").style("fill","none"),t.axes.hor.line=t.panel.append("line").classed(a.constants.classes.horaxis,!0).attr("y1","Horizontal"===t.config.graph.orientation?t.height():t.axes.ver.scale(0)).attr("y2","Horizontal"===t.config.graph.orientation?t.height():t.axes.ver.scale(0)).attr("x1","0").attr("x2",t.width()).style("stroke",t.config.axis.strokecolor),t.axes.hor.label=t.axes.hor.group.append("g").classed(a.constants.classes.axeslabelgroup,!0).attr("transform","translate("+t.width()/2+","+(1*t.config.margin.bottom/4+1*t.config.label.fontsize)+")"),t.axes.hor.label.append("text").attr("display","block").classed(a.constants.classes.axeslabel,!0).classed("cal",!0).attr("text-anchor","middle").style("font-size",t.config.axis.fontsize).style("font-family",t.config.axis.fontfamily).text(t.config.meta.hlabel),t.axes.hor.label.append("text").attr("display","block").attr("y",1*t.config.axis.fontsize).attr(a.constants.classes.axessublabel,!0).classed("casl",!0).attr("text-anchor","middle").style("font-size",t.config.axis.fontsize-2).style("font-family",t.config.axis.fontfamily).text(t.config.meta.hsublabel),this},a.Graph.prototype.drawVerticalAxis=function(){var t=this;return t.axes.ver.axis=t.axes.ver.group.append("g").classed(a.constants.classes.axes,!0).style("font-family",t.config.label.fontfamily).style("font-size",t.config.label.fontsize).style("font-weight",t.config.label.fontweight).call(t.axes.ver.func),t.config.axis.showticks&&t.axes.ver.axis.selectAll("line").style("stroke",t.config.axis.strokecolor).style("opacity",t.config.axis.opacity),t.axes.ver.axis.selectAll("path").style("fill","none"),t.axes.ver.line=t.panel.append("line").classed(a.constants.classes.veraxis,!0).attr("x1","Horizontal"===t.config.graph.orientation?t.axes.hor.scale(0):0).attr("x2","Horizontal"===t.config.graph.orientation?t.axes.hor.scale(0):0).attr("y1",0).attr("y2",t.height()).style("stroke",t.config.axis.strokecolor),t.axes.ver.label=t.axes.ver.group.append("g").attr("transform","translate("+-4*t.config.margin.left/5+","+t.height()/2+")rotate(270)"),t.axes.ver.label.append("text").classed(a.constants.classes.axeslabel,!0).attr("text-anchor","middle").classed("cal",!0).style("font-family",t.config.axis.fontfamily).style("font-size",t.config.axis.fontsize).text(t.config.meta.vlabel),t.axes.ver.label.append("text").classed(a.constants.classes.axessublabel,!0).attr("text-anchor","middle").attr("y",+t.config.axis.fontsize).classed("casl",!0).style("font-family",t.config.axis.fontfamily).style("font-size",t.config.axis.fontsize-2).text(t.config.meta.vsublabel),this},a.Graph.prototype.setLegend=function(){var t=this,e=t.panel.append("g").classed(a.constants.classes.legend,!0).attr("transform",function(e,a){if("right"===t.config.legend.position)return"translate("+t.width()+", 10)";if("bottom"===t.config.legend.position){var n=t.height()+t.config.margin.bottom/2+Number(t.config.axis.fontsize);return"translate(0, "+n+")"}});return t.legends=e.selectAll("g").data("categories"===t.config.legend.legendtype?t.categories:t.labels),t.legends.enter().append("g").attr("transform",function(e,a){if("right"===t.config.legend.position)return"translate(10,"+10*(2*a-1)+")";if("bottom"===t.config.legend.position){var n=100*a-t.config.dimension.width*t.config.legend.legendstart,r=20*t.config.legend.legendstart;return n>=t.config.dimension.width&&(t.config.legend.legendstart=t.config.legend.legendstart+1,n=100*a-t.config.dimension.width*t.config.legend.legendstart,r=20*t.config.legend.legendstart),"translate("+n+","+r+")"}}).attr("class",function(e,n){var r="categories"===t.config.legend.legendtype?t.categories[n]:t.labels[n];return a.util.getClassName(this,"cl-"+r)}).attr("disabled","false").on("mouseover",function(e,a){t.effects[e].mouseover&&"function"==typeof t.effects[e].mouseover&&t.effects[e].mouseover()}).on("mouseout",function(e,a){t.effects[e].mouseout&&"function"==typeof t.effects[e].mouseout&&t.effects[e].mouseout()}).on("click",function(e,n){a.effects.legend.click(n,this,t)}),t.legends.append("rect").classed(a.constants.classes.legendsign,!0).attr("height",t.config.legend.symbolsize).attr("width",t.config.legend.symbolsize).style("fill",function(e,n){return a.util.getColorBand(t.config,n)}).style("stroke","none"),t.legends.append("text").classed(a.constants.classes.legendlabel,!0).text(function(e,a){return"categories"===t.config.legend.legendtype?t.categories[a]:t.labels[a]}).attr("dx",t.config.legend.textmargin).attr("dy",".71em").attr("text-anchor","start").style("stroke",t.config.legend.color).style("fill",t.config.legend.color).style("stroke-width",t.config.legend.strokewidth).style("font-family",t.config.legend.fontfamily).style("font-size",t.config.legend.fontsize).style("font-weight",t.config.legend.fontweight),this},a.Graph.prototype.finalize=function(t){var e=this;return e.drawHorizontalAxis().drawVerticalAxis(),e.frame.selectAll("text").style("cursor","default"),t&&console.log(e),this},a.Graph.prototype.remove=function(){return this.frame.remove(),this},a.Graph.prototype.removeCaption=function(){return this.caption.remove(),this},a.Graph.prototype.removeLegend=function(){return this.legends[0]&&this.legends[0].parentNode.remove(),this},a.Graph.prototype.removePanel=function(){return this.panel.remove(),this},a.Graph.prototype.removeHorAxis=function(){return this.panel.selectAll("g."+a.constants.classes.horaxis+" >*").remove(),this.panel.selectAll("line."+a.constants.classes.horaxis).remove(),this},a.Graph.prototype.removeVerAxis=function(){return this.panel.selectAll("g."+a.constants.classes.veraxis+" >*").remove(),this.panel.selectAll("line."+a.constants.classes.veraxis).remove(),this},a.Graph.prototype.width=function(t){return t?(this.config.dimension.width=t,this):this.config.dimension.width},a.Graph.prototype.height=function(t){return t?(this.config.dimension.height=t,this):this.config.dimension.height},a.Graph.prototype.top=function(t){return t?(this.config.margin.top=t,this):this.config.margin.top},a.Graph.prototype.bottom=function(t){return t?(this.config.margin.bottom=t,this):this.config.margin.bottom},a.Graph.prototype.left=function(t){return t?(this.config.margin.left=t,this):this.config.margin.left},a.Graph.prototype.right=function(t){return t?(this.config.margin.right=t,this):this.config.margin.right},a.Graph.prototype.position=function(t){return t?(this.config.meta.position=t,this):this.config.meta.position},a.Graph.prototype.caption=function(t){return t?(this.config.meta.caption=t,this):this.config.meta.caption},a.Graph.prototype.subCaption=function(t){return t?(this.config.meta.subCaption=t,this):this.config.meta.caption},a.Graph.prototype.isDownloadable=function(t){return t?(this.config.meta.isDownload=t,this):this.config.meta.isDownload},a.Graph.prototype.max=function(){return null!==this.axes.meta.max?this.axes.meta.max:(this.axes.meta.max=a.util.getMax(this.graphdef,this.graphdef.stepup),this)},a.Graph.prototype.min=function(){return null!==this.axes.meta.min?this.axes.meta.min:(this.axes.meta.min=a.util.getMin(this.graphdef,this.graphdef.stepup),this)},a.Graph.prototype.toggleGraphGroup=function(t){{var e=this,n=e.categories[t],r=e.frame.select("g.cge-"+a.util.formatClassName(n)).style("display");a.util.getColorBand(e.config,t)}return e.frame.selectAll("g.cge-"+a.util.formatClassName(n)).style("display","none"===r?null:"none"),this},a.AreaGraph=function(t,e){var n=this;a.Graph.call(n,t,e).setDefaults().init(),n.areagroups=[],n.dataset=a.util.getDataArray(n.graphdef);var r,o,s,i,l=n.graphdef.dataset[n.graphdef.categories[0]];for(n.axes["Horizontal"===n.config.graph.orientation?"ver":"hor"].scale.domain(l.map(function(t){return t.name})),s=0,i=n.dataset.length;i>s;s+=1)o=n.chart.append("g").classed("cg-"+a.util.formatClassName(n.categories[s]),!0).append("g").classed("cge-"+a.util.formatClassName(n.categories[s]),!0).datum(n.dataset[s]),r={path:o,linefunc:void 0,areafunc:void 0,line:void 0,area:void 0},n["draw"+n.config.graph.orientation+"Area"](r,s),n.areagroups.push(r);n.finalize()},a.AreaGraph.prototype=a.util.inherits(a.Graph),a.AreaGraph.prototype.setDefaults=function(){var t=this;return t.graphdef.stepup="normal",this},a.AreaGraph.prototype.drawHorizontalArea=function(t,e){var n=this,r=a.util.getColorBand(n.config,e);n.axes.ver.scale.rangePoints([0,n.height()]),t.linefunc=d3.svg.line().x(function(t){return n.axes.hor.scale(t.value)}).y(function(t){return n.axes.ver.scale(t.name)+n.axes.ver.scale.rangeBand()/2}).interpolate(n.config.area.interpolation), 
     2t.areafunc=d3.svg.area().x0(n.axes.hor.scale(0)).x1(t.linefunc.x()).y(t.linefunc.y()).interpolate(n.config.area.interpolation),t.area=t.path.append("svg:path").classed(a.constants.classes.areapath+e,!0).attr("d",t.areafunc).style("opacity",n.config.area.opacity).style("-moz-opacity",n.config.area.opacity).style("fill",r),t.line=t.path.append("svg:path").classed(a.constants.classes.linepath+e,!0).attr("d",t.linefunc).style("stroke","white").style("fill","none"),t.path.selectAll("."+a.constants.classes.dot).data(n.dataset[e]).enter().append("circle").classed(a.constants.classes.dot,!0).attr("cx",t.linefunc.x()).attr("cy",t.linefunc.y()).attr("r",3.5).style("fill","white")},a.AreaGraph.prototype.drawVerticalArea=function(t,e){var n=this,r=a.util.getColorBand(n.config,e);n.axes.hor.scale.rangePoints([0,n.width()]),t.linefunc=d3.svg.line().x(function(t){return n.axes.hor.scale(t.name)+n.axes.hor.scale.rangeBand()/2}).y(function(t){return n.axes.ver.scale(t.value)}).interpolate(n.config.area.interpolation),t.areafunc=d3.svg.area().x(t.linefunc.x()).y0(t.linefunc.y()).y1(n.axes.ver.scale(0)).interpolate(n.config.area.interpolation),t.area=t.path.append("svg:path").classed(a.constants.classes.areapath+e,!0).attr("d",t.areafunc).style("opacity",n.config.area.opacity).style("-moz-opacity",n.config.area.opacity).style("fill",r),t.line=t.path.append("svg:path").classed(a.constants.classes.linepath+e,!0).attr("d",t.linefunc).style("stroke","white").style("fill","none"),t.path.selectAll("."+a.constants.classes.dot).data(n.dataset[e]).enter().append("circle").classed(a.constants.classes.dot,!0).attr("cx",t.linefunc.x()).attr("cy",t.linefunc.y()).attr("r",3.5).style("fill","white")},a.BarGraph=function(t,e){var n=this;a.Graph.call(n,t,e).setDefaults().init(),n.bargroups={},n.axes["Horizontal"===n.config.graph.orientation?"ver":"hor"].scale.domain(n.labels);var r,o,s=n.categories.length;for(r=0;s>r;r+=1)o=n.categories[r],n.bargroups[o]=n.chart.append("g").classed("cg-"+a.util.formatClassName(o),!0),n["draw"+n.config.graph.orientation+"Bars"](r);n.finalize()},a.BarGraph.prototype=a.util.inherits(a.Graph),a.BarGraph.prototype.setDefaults=function(){var t=this;return t.graphdef.stepup="normal",this},a.BarGraph.prototype.drawHorizontalBars=function(t){var e=this,n=a.util.getColorBand(this.config,t),r=e.categories.length,o=e.bargroups[e.categories[t]].selectAll("g").data(e.graphdef.dataset[e.categories[t]]).enter().append("g").classed("cge-"+a.util.formatClassName(e.categories[t]),!0).attr("transform",function(t){return t.value<0?"scale(-1,1)":void 0});o.append("rect").classed(a.util.formatClassName(e.categories[t]),!0).classed("cr-"+a.util.formatClassName(e.categories[t]),!0).attr("height",e.axes.ver.scale.rangeBand()/r).attr("x",function(t){return t.value<0?-e.axes.hor.scale(0):e.axes.hor.scale(0)}).attr("y",function(t){return e.axes.ver.scale(t.name)}).attr("width",0).style("stroke",e.config.bar.strokecolor).style("fill",n).transition().duration(e.config.effects.duration).delay(function(t,a){return a*e.config.effects.duration}).attr("width",function(t){return e.axes.hor.scale(Math.abs(t.value))-e.axes.hor.scale(0)}).call(a.util.endAll,function(n,r){d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseover",a.effects.bar.mouseover(e,t)),d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseout",a.effects.bar.mouseout(e,t)),"function"==typeof e.config.graph.clickCallback&&d3.select(this.parentNode.parentNode).selectAll("rect").on("click",function(t){e.config.graph.clickCallback.apply(null,[t])})}),o.append("text").attr("x",function(t){return e.axes.hor.scale(0)}).attr("y",function(t){return e.axes.ver.scale(t.name)+e.axes.ver.scale.rangeBand()/r/2}).attr("dx",function(t){return t.value<0?"-20px":"4px"}).attr("dy",".35em").attr("text-anchor","start").classed("cr-"+a.util.formatClassName(e.categories[t]),!0).style("fill",e.config.label.showlabel?a.util.getColorBand(e.config,t):"none").style("font-family",e.config.bar.fontfamily).style("font-size",e.config.bar.fontsize).style("font-weight",e.config.bar.fontweight).style("transform",function(t){return t.value<0?"scale(-1,1)":"scale(1,1)"}).style("opacity",0).text(function(t){return a.util.getLabelValue(e,t)}).transition().duration(e.config.effects.duration).delay(function(t,a){return a*e.config.effects.duration}).style("opacity",1).attr("x",function(t){return e.axes.hor.scale(t.value)}),o.append("svg:title").text(function(n,r){return a.util.getTooltipText(e,e.categories[t],e.labels[r],n)}),e.bargroups[e.categories[t]].attr("transform","translate(0,"+t*e.axes.ver.scale.rangeBand()/r+")")},a.BarGraph.prototype.drawVerticalBars=function(t){var e=this,n=a.util.getColorBand(this.config,t),r=e.categories.length,o=e.bargroups[e.categories[t]].selectAll("g").data(e.graphdef.dataset[e.categories[t]]).enter().append("g").classed("cge-"+a.util.formatClassName(e.categories[t]),!0).attr("transform",function(t){return t.value<0?"scale(1, -1)":void 0});o.append("rect").classed(a.util.formatClassName(e.categories[t]),!0).classed("cr-"+a.util.formatClassName(e.categories[t]),!0).attr("height",0).attr("width",e.axes.hor.scale.rangeBand()/r).attr("x",function(t){return e.axes.hor.scale(t.name)}).attr("y",function(t){return(t.value<0?-1:1)*(e.height()-e.axes.ver.scale(0))}).style("stroke",e.config.bar.strokecolor).style("fill",n).transition().duration(e.config.effects.duration).delay(t*e.config.effects.duration).attr("height",function(t){return Math.abs(e.axes.ver.scale(0)-e.axes.ver.scale(t.value))}).call(a.util.endAll,function(n,r){d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseover",a.effects.bar.mouseover(e,t)),d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseout",a.effects.bar.mouseout(e,t)),"function"==typeof e.config.graph.clickCallback&&d3.select(this.parentNode.parentNode).selectAll("rect").on("click",function(t){e.config.graph.clickCallback.apply(null,[t])})}),o.append("text").attr("transform",function(t){return t.value<0?"scale(1,1)":"scale(1,-1)"}).attr("x",function(t){return e.axes.hor.scale(t.name)+e.axes.hor.scale.rangeBand()/r/2}).attr("y",function(t){return e.height()-e.axes.ver.scale(0)}).attr("dx",0).attr("dy",function(t){return t.value<0?"2em":".35em"}).attr("text-anchor","middle").classed("cr-"+a.util.formatClassName(e.categories[t]),!0).style("fill",e.config.label.showlabel?a.util.getColorBand(e.config,t):"none").style("font-family",e.config.bar.fontfamily).style("font-size",e.config.bar.fontsize).style("font-weight",e.config.bar.fontweight).style("opacity",0).text(function(t){return a.util.getLabelValue(e,t)}).transition().duration(e.config.effects.duration).delay(t*e.config.effects.duration).style("opacity",1).attr("y",function(t){return-(e.height()-e.axes.ver.scale(t.value))-10}),o.append("svg:title").text(function(n,r){return a.util.getTooltipText(e,e.categories[t],e.labels[r],n)}),e.bargroups[e.categories[t]].attr("transform","translate("+t*e.axes.hor.scale.rangeBand()/r+","+e.height()+") scale(1,-1)")},a.DonutGraph=function(t,e){var n=this;a.Graph.call(n,t,e).setDefaults().init(),n.radius=2*Math.min(n.height(),n.width())/5,n.center={x:n.width()/2,y:n.height()/2},n.category=t.categories[0];var r=a.util.getCategoryData(n.graphdef,[n.category]),o=d3.svg.arc().innerRadius(n.radius*n.config.donut.factor).outerRadius(n.radius),s=d3.layout.pie();n.chart.data(r),n.arcs=n.chart.selectAll("g.arc").data(s).enter().append("g").classed(a.constants.classes.arc+a.util.formatClassName(n.category),!0).attr("transform","translate("+n.center.x+","+n.center.y+")"),n.arcs.append("path").attr("d",o).style("fill",function(t,e){return a.util.getColorBand(n.config,e)}).style("stroke",n.config.donut.strokecolor).style("stroke-width",n.config.donut.strokewidth).on("mouseover",a.effects.donut.mouseover(n.center,o,n.config)).on("mouseout",a.effects.donut.mouseout(n.center,n.config)),"function"==typeof n.config.graph.clickCallback&&n.arcs.on("click",function(t){n.config.graph.clickCallback.apply(null,[t])}),n.arcs.append("text").attr("transform",function(t){return"translate("+o.centroid(t)+")"}).attr("dy",".35em").attr("text-anchor","middle").style("fill",n.config.label.showlabel?n.config.donut.fontfill:"none").style("font-family",n.config.donut.fontfamily).style("font-size",n.config.donut.fontsize).style("font-weight",n.config.donut.fontweight).style("font-variant",n.config.donut.fontvariant).text(function(t){return a.util.getLabelValue(n,t)}),n.arcs.append("svg:title").text(function(t,e){return a.util.getTooltipText(n,n.category,n.labels[e],t)})},a.DonutGraph.prototype=a.util.inherits(a.Graph),a.DonutGraph.prototype.setDefaults=function(){var t=this;return t.graphdef.stepup="normal",t.config.legend.legendtype="labels",this},a.LineGraph=function(t,e){var n=this;a.Graph.call(n,t,e).setDefaults().init(),n.linegroups={},n.dataset=a.util.getDataArray(n.graphdef);var r,o,s,i=n.categories.length,l=n.labels;for(n.axes["Horizontal"===n.config.graph.orientation?"ver":"hor"].scale.domain(l),s=0;i>s;s+=1)o=n.chart.append("g").classed("cg-"+a.util.formatClassName(n.categories[s]),!0).append("g").classed("cge-"+a.util.formatClassName(n.categories[s]),!0).datum(n.dataset[s]),r={path:o,func:void 0},n["draw"+n.config.graph.orientation+"Lines"](r,s),n.linegroups[n.categories[s]]=r;n.finalize()},a.LineGraph.prototype=a.util.inherits(a.Graph),a.LineGraph.prototype.setDefaults=function(){var t=this;return t.graphdef.stepup="normal",t.config.scale.ordinality=0,this},a.LineGraph.prototype.drawHorizontalLines=function(t,e){var n=this,r=n.axes,o=(n.config,a.util.getColorBand(n.config,e));return n.axes.ver.scale.rangePoints([0,n.height()]),t.func=d3.svg.line().x(function(t){return r.hor.scale(t.value)}).y(function(t){return r.ver.scale(t.name)+r.ver.scale.rangeBand()/2}).interpolate(a.config.line.interpolation),t.path.append("path").classed("cr-"+a.util.formatClassName(n.categories[e]),!0).attr("d",t.func).style("fill","none").style("stroke",o).style("stroke-width",n.config.line.strokewidth).style("stroke-opacity",n.config.line.strokeopacity).transition().duration(3*n.config.effects.duration).delay(2*e*n.config.effects.duration).style("stroke-opacity",1).call(a.util.endAll,function(t,r){d3.select(this.parentNode.parentNode).selectAll("path").on("mouseover",a.effects.line.mouseover(n,e)),d3.select(this.parentNode.parentNode).selectAll("path").on("mouseout",a.effects.line.mouseout(n,e)),d3.select(this.parentNode.parentNode).selectAll("circle").on("mouseover",a.effects.line.mouseover(n,e)),d3.select(this.parentNode.parentNode).selectAll("circle").on("mouseout",a.effects.line.mouseout(n,e))}),n.config.line.showcircles&&t.path.selectAll("circle").data(n.dataset[e]).enter().append("circle").classed("cr-"+a.util.formatClassName(n.categories[e]),!0).attr("cx",t.func.x()).attr("cy",t.func.y()).attr("r",n.config.line.circleradius).style("fill",o).style("fill-opacity",n.config.line.circleopacity).style("stroke","#fff").append("svg:title").text(function(t,r){return a.util.getTooltipText(n,n.categories[e],n.labels[r],t)}),t.path.selectAll("text").data(n.dataset[e]).enter().append("text").attr("x",function(t){return r.hor.scale(t.value)}).attr("y",function(t){return r.ver.scale(t.name)+r.ver.scale.rangeBand()/2}).attr("dx",10).attr("dy",".35em").attr("text-anchor","start").style("opacity",0).classed("cr-"+a.util.formatClassName(n.categories[e]),!0).style("fill",n.config.label.showlabel?a.util.getColorBand(n.config,e):"none").style("font-family",n.config.line.fontfamily).style("font-size",n.config.line.fontsize).style("font-weight",n.config.line.fontweight).text(function(t){return a.util.getLabelValue(n,t)}).transition().duration(3*n.config.effects.duration).delay(2*e*n.config.effects.duration).style("opacity",1),this},a.LineGraph.prototype.drawVerticalLines=function(t,e){var n=this,r=n.axes,o=(n.config,a.util.getColorBand(n.config,e));return n.axes.hor.scale.rangePoints([0,n.width()]),t.func=d3.svg.line().x(function(t){return r.hor.scale(t.name)+r.hor.scale.rangeBand()/2}).y(function(t){return r.ver.scale(t.value)}).interpolate(a.config.line.interpolation),t.path.append("path").attr("d",t.func).classed("cr-"+a.util.formatClassName(n.categories[e]),!0).style("fill","none").style("stroke",o).style("stroke-width",n.config.line.strokewidth).style("stroke-opacity",n.config.line.strokeopacity).transition().duration(n.config.effects.duration).delay(2*e*n.config.effects.duration).style("stroke-opacity",1).call(a.util.endAll,function(t,r){d3.select(this.parentNode.parentNode).selectAll("path").on("mouseover",a.effects.line.mouseover(n,e)),d3.select(this.parentNode.parentNode).selectAll("path").on("mouseout",a.effects.line.mouseout(n,e)),d3.select(this.parentNode.parentNode).selectAll("circle").on("mouseover",a.effects.line.mouseover(n,e)),d3.select(this.parentNode.parentNode).selectAll("circle").on("mouseout",a.effects.line.mouseout(n,e))}),n.config.line.showcircles&&t.path.selectAll("circle").data(n.dataset[e]).enter().append("circle").attr("cx",t.func.x()).attr("cy",t.func.y()).attr("r",n.config.line.circleradius).classed("cr-"+a.util.formatClassName(n.categories[e]),!0).style("fill",o).style("fill-opacity",n.config.line.circleopacity).style("stroke","#fff").append("svg:title").text(function(t,r){return a.util.getTooltipText(n,n.categories[e],n.labels[r],t)}),t.path.selectAll("text").data(n.dataset[e]).enter().append("text").attr("x",function(t){return r.hor.scale(t.name)+r.hor.scale.rangeBand()/2}).attr("y",function(t){return r.ver.scale(t.value)-20}).attr("dx",0).attr("dy",".71em").attr("text-anchor","middle").classed("cr-"+a.util.formatClassName(n.categories[e]),!0).style("fill",n.config.label.showlabel?a.util.getColorBand(n.config,e):"none").style("font-family",n.config.line.fontfamily).style("font-size",n.config.line.fontsize).style("font-weight",n.config.line.fontweight).style("opacity",0).text(function(t){return a.util.getLabelValue(n,t)}).transition().duration(3*n.config.effects.duration).delay(2*e*n.config.effects.duration).style("opacity",1),this},a.PercentAreaGraph=function(t,e){var n=this;a.Graph.call(n,t,e).setDefaults().init();{var r=d3.layout.stack().offset("zero")(n.categories.map(function(e){return t.dataset[e].map(function(t){return{x:t.name,y:+t.value}})})),o=n.labels;n.categories}n.axes["Horizontal"===n.config.graph.orientation?"ver":"hor"].scale.domain(o),n.areagroup=n.chart.selectAll("g.areagroup").data(r).enter().append("g").attr("class",function(t,e){return a.util.getClassName(this,"cge-"+n.categories[e])}),n["draw"+n.config.graph.orientation+"Area"](),n.finalize()},a.PercentAreaGraph.prototype=a.util.inherits(a.Graph),a.PercentAreaGraph.prototype.setDefaults=function(){var t=this;return t.graphdef.stepup="percent",this},a.PercentAreaGraph.prototype.drawHorizontalArea=function(){var t=this,e=t.axes,n=t.categories,r=t.config,o=a.util.getSumUpArray(t.graphdef);e.ver.scale.rangePoints([0,t.height()]);for(var s=0;s<n.length;s+=1)a.effects.area.mouseover(t,s),a.effects.area.mouseout(t,s);t.areagroup.append("path").attr("class",function(t,e){return a.util.getClassName(this,a.constants.classes.area+a.util.formatClassName(n[e]))}).style("fill",function(t,e){return a.util.getColorBand(r,e)}).attr("d",d3.svg.area().y(function(t){return e.ver.scale(t.x)+e.ver.scale.rangeBand()/2}).x0(function(t,n){return e.hor.scale(a.util.getPercentage(t.y0,o[n]))}).x1(function(t,n){return e.hor.scale(a.util.getPercentage(t.y0+t.y,o[n]))}).interpolate(t.config.area.interpolation)).on("mouseover",function(e,a){t.effects[n[a]].mouseover()}).on("mouseout",function(e,a){t.effects[n[a]].mouseout()}),t.areagroup.append("path").attr("class",function(t,e){return a.util.getClassName(this,a.constants.classes.line+a.util.formatClassName(n[e]))}).style("stroke","white").style("fill","none").style("stroke-width",2).attr("d",d3.svg.line().y(function(t){return e.ver.scale(t.x)+e.ver.scale.rangeBand()/2}).x(function(t,n){return e.hor.scale(a.util.getPercentage(t.y0+t.y,o[n]))}).interpolate(t.config.area.interpolation))},a.PercentAreaGraph.prototype.drawVerticalArea=function(){var t=this,e=t.axes,n=t.categories,r=t.config,o=a.util.getSumUpArray(t.graphdef);e.hor.scale.rangePoints([0,t.width()]);for(var s=0;s<n.length;s+=1)a.effects.area.mouseover(t,s),a.effects.area.mouseout(t,s);t.areagroup.append("path").attr("class",function(t,e){return a.util.getClassName(this,a.constants.classes.area+a.util.formatClassName(n[e]))}).style("fill",function(t,e){return a.util.getColorBand(r,e)}).attr("d",d3.svg.area().x(function(t){return e.hor.scale(t.x)+e.hor.scale.rangeBand()/2}).y0(function(t,n){return e.ver.scale(a.util.getPercentage(t.y0,o[n]))}).y1(function(t,n){return e.ver.scale(a.util.getPercentage(t.y0+t.y,o[n]))}).interpolate(t.config.area.interpolation)).on("mouseover",function(e,a){t.effects[n[a]].mouseover()}).on("mouseout",function(e,a){t.effects[n[a]].mouseout()}),t.areagroup.append("path").attr("class",function(t,e){return a.util.getClassName(this,a.constants.classes.line+a.util.formatClassName(n[e]))}).style("stroke","white").style("fill","none").style("stroke-width",2).attr("d",d3.svg.line().x(function(t,a){return e.hor.scale(t.x)+e.hor.scale.rangeBand()/2}).y(function(t,n){return e.ver.scale(a.util.getPercentage(t.y0+t.y,o[n]))}).interpolate(t.config.area.interpolation))},a.PercentBarGraph=function(t,e){var n=this;a.Graph.call(n,t,e).setDefaults().init(),n.bargroups=[];var r,o,s,i,l,c=n.labels,f=c.map(function(t){return 0}),u=c.map(function(t){return 0});for(n.axes["Horizontal"===n.config.graph.orientation?"ver":"hor"].scale.domain(c),s=0,i=n.categories.length;i>s;s+=1)l=a.util.getColorBand(n.config,s),r=n.chart.append("g").classed("cg-"+n.categories[s],!0),o=r.selectAll("g").data(n.graphdef.dataset[n.categories[s]]).enter().append("g").classed("cge-"+a.util.formatClassName(n.categories[s]),!0),n["draw"+a.util.getPascalCasedName(n.config.graph.orientation)+"Bars"](o,f,u,s),"Vertical"===n.config.graph.orientation&&r.attr("transform","translate(0,"+2*n.height()+") scale(1,-1)"),n.bargroups.push(r);n.finalize()},a.PercentBarGraph.prototype=a.util.inherits(a.Graph),a.PercentBarGraph.prototype.setDefaults=function(){var t=this;return t.graphdef.stepup="percent",t.config.scale.ordinality=0,this},a.PercentBarGraph.prototype.drawHorizontalBars=function(t,e,n,r){var o=this,s=this.axes,i=a.util.getColorBand(this.config,r),l=(this.config,a.util.getSumUpArray(this.graphdef));t.append("rect").attr("height",s.ver.scale.rangeBand()).attr("width",0).attr("x",function(t,n){var r=s.hor.scale(a.util.getPercentage(e[n],l[n]));return e[n]+=t.value,r}).attr("y",function(t){return s.ver.scale(t.name)}).classed("cr-"+a.util.formatClassName(o.categories[r]),!0).style("stroke","none").style("fill",i).transition().duration(o.config.effects.duration).delay(r*o.config.effects.duration).attr("width",function(t,e){return s.hor.scale(a.util.getPercentage(t.value,l[e]))}).call(a.util.endAll,function(t,e){d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseover",a.effects.bar.mouseover(o,r,o.config.effects.textcolor)),d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseout",a.effects.bar.mouseout(o,r,o.config.effects.textcolor))}),t.append("text").attr("y",function(t){return s.ver.scale(t.name)+s.ver.scale.rangeBand()/2}).attr("dx",0).attr("dy",".35em").attr("text-anchor","end").classed("cr-"+a.util.formatClassName(o.categories[r]),!0).style("fill",o.config.label.showlabel?o.config.effects.textcolor:"none").style("font-family",this.config.bar.fontfamily).style("font-size",this.config.bar.fontsize).style("font-weight",this.config.bar.fontweight).text(function(t,n){return s.hor.scale(a.util.getPercentage(e[n],l[n]))>15?String(Math.round(a.util.getPercentage(t.value,l[n]))):null}).transition().duration(o.config.effects.duration).delay(r*o.config.effects.duration).attr("x",function(t,e){return n[e]+=t.value,s.hor.scale(a.util.getPercentage(n[e],l[e]))-5})},a.PercentBarGraph.prototype.drawVerticalBars=function(t,e,n,r){var o=this,s=this.height(),i=this.axes,l=a.util.getColorBand(this.config,r),c=(this.config,a.util.getSumUpArray(this.graphdef));t.append("rect").attr("height",0).attr("width",i.hor.scale.rangeBand()).attr("x",function(t){return i.hor.scale(t.name)}).attr("y",function(t,n){var r=i.ver.scale(a.util.getPercentage(e[n],c[n]));return e[n]-=t.value,r}).classed("cr-"+a.util.formatClassName(o.categories[r]),!0).style("stroke","none").style("fill",l).transition().duration(o.config.effects.duration).delay(r*o.config.effects.duration).attr("height",function(t,e){return s-i.ver.scale(a.util.getPercentage(t.value,c[e]))}).call(a.util.endAll,function(t,e){d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseover",a.effects.bar.mouseover(o,r,o.config.effects.textcolor)),d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseout",a.effects.bar.mouseout(o,r,o.config.effects.textcolor))}),t.append("text").attr("transform","scale(1,-1)").attr("x",function(t){return i.hor.scale(t.name)+i.hor.scale.rangeBand()/2}).attr("y",-s+5).attr("dy",".71em").attr("text-anchor","middle").classed("cr-"+a.util.formatClassName(o.categories[r]),!0).style("fill",o.config.label.showlabel?o.config.effects.textcolor:"none").style("font-family",this.config.bar.fontfamily).style("font-size",this.config.bar.fontsize).style("font-weight",this.config.bar.fontweight).text(function(t,e){return s-i.ver.scale(a.util.getPercentage(t.value,c[e]))>15?String(Math.round(a.util.getPercentage(t.value,c[e]))):null}).transition().duration(o.config.effects.duration).delay(r*o.config.effects.duration).attr("y",function(t,e){return n[e]+=t.value,-(2*s-i.ver.scale(a.util.getPercentage(n[e],c[e])))+5})},a.PieGraph=function(t,e){var n=this;a.Graph.call(n,t,e).setDefaults().init(),n.radius=2*Math.min(n.height(),n.width())/5,n.center={x:n.width()/2,y:n.height()/2},n.category=t.categories[0];var r=a.util.getCategoryData(n.graphdef,[n.category]),o=d3.svg.arc().innerRadius(0).outerRadius(n.radius),s=d3.layout.pie();n.chart.data(r),n.arcs=n.chart.selectAll("g.arc").data(s).enter().append("g").classed(a.constants.classes.arc+a.util.formatClassName(n.category),!0).attr("class",function(t,e){return a.util.getClassName(this,"cge-"+n.labels[e])}).attr("transform","translate("+n.center.x+","+n.center.y+")"),n.arcs.append("path").attr("d",o).style("fill",function(t,e){return a.util.getColorBand(n.config,e)}).style("stroke",n.config.pie.strokecolor).style("stroke-width",n.config.pie.strokewidth).on("mouseover",a.effects.pie.mouseover(n,n.center,o,n.config)).on("mouseout",a.effects.pie.mouseout(n,n.center,n.config)),n.arcs.append("text").attr("transform",function(t){return"translate("+o.centroid(t)+")"}).attr("dy",".35em").attr("text-anchor","middle").style("fill",n.config.label.showlabel?n.config.pie.fontfill:"none").style("font-family",n.config.pie.fontfamily).style("font-size",n.config.pie.fontsize).style("font-weight",n.config.pie.fontweight).style("font-variant",n.config.pie.fontvariant).text(function(t){return a.util.getLabelValue(n,t)}),n.arcs.append("svg:title").text(function(t,e){return a.util.getTooltipText(n,n.category,n.labels[e],t)}),"function"==typeof n.config.graph.clickCallback&&n.arcs.on("click",function(t){n.config.graph.clickCallback.apply(null,[t])})},a.PieGraph.prototype=a.util.inherits(a.Graph),a.PieGraph.prototype.setDefaults=function(){var t=this;return t.graphdef.stepup="normal",t.config.legend.legendtype="labels",this},a.PolarAreaGraph=function(t,e){var n=this;a.Graph.call(n,t,e).setDefaults().init(),n.maxRadius=2*Math.min(n.height(),n.width())/5,n.center={x:n.width()/2,y:n.height()/2},n.category=n.categories[0];for(var r=a.util.getCategoryData(n.graphdef,[n.category]),o=r[0].map(function(t,e){return t}),s=d3.layout.pie().value(function(t){return n.max()/r[0].length}),i=[],l=d3.svg.arc().innerRadius(0).outerRadius(function(t,e){return o[e]*n.maxRadius/n.max()}),c=1;c<=n.config.axis.ticks;c++)i[c]=n.maxRadius/n.config.axis.ticks*c;n.chart.data(r),n.arcs=n.chart.selectAll("g.arc").data(s).enter().append("g").classed(a.constants.classes.arc+a.util.formatClassName(n.category),!0).attr("transform","translate("+n.center.x+","+n.center.y+")"),n.arcs.append("path").attr("d",l).style("fill",function(t,e){return a.util.getColorBand(n.config,e)}).style("stroke",n.config.pie.strokecolor).style("stroke-width",n.config.pie.strokewidth),n.arcs.append("svg:title").text(function(t,e){return a.util.getTooltipText(n,n.category,n.labels[e],t)}),n.chart.selectAll("."+a.constants.classes.circleticks).data(i).enter().append("svg:g").classed(a.constants.classes.circleticks,!0).append("svg:circle").attr("r",function(t,e){return t}).style("stroke",n.config.axis.strokecolor).style("opacity",n.config.axis.opacity).style("fill","none").attr("transform","translate("+n.center.x+","+n.center.y+")"),"function"==typeof n.config.graph.clickCallback&&n.arcs.on("click",function(t){n.config.graph.clickCallback.apply(null,[t])})},a.PolarAreaGraph.prototype=a.util.inherits(a.Graph),a.PolarAreaGraph.prototype.setDefaults=function(){var t=this;return t.graphdef.stepup="normal",t.config.legend.legendtype="labels",this},a.StackedAreaGraph=function(t,e){var n=this;a.Graph.call(n,t,e).setDefaults().init();var r=d3.layout.stack().offset(n.config.area.offset)(n.categories.map(function(e){return t.dataset[e].map(function(t){return{x:t.name,y:+t.value}})}));n.axes["Horizontal"===n.config.graph.orientation?"ver":"hor"].scale.domain(n.labels.map(function(t){return t})),n.areagroup=n.chart.append("g").selectAll("g").data(r).enter().append("g").attr("class",function(t,e){return a.util.getClassName(this,"cge-"+n.categories[e])}),n["draw"+n.config.graph.orientation+"Area"](),n.finalize()},a.StackedAreaGraph.prototype=a.util.inherits(a.Graph),a.StackedAreaGraph.prototype.setDefaults=function(){var t=this;return t.graphdef.stepup="stepup",this},a.StackedAreaGraph.prototype.drawHorizontalArea=function(){var t=this,e=t.axes,n=t.categories,r=t.config;e.ver.scale.rangePoints([0,t.height()]);for(var o=0;o<n.length;o+=1)a.effects.area.mouseover(t,o),a.effects.area.mouseout(t,o);return t.areagroup.append("path").attr("class",function(t,e){return a.util.getClassName(this,a.constants.classes.area+n[e])}).style("fill",function(t,e){return a.util.getColorBand(r,e)}).attr("d",d3.svg.area().y(function(t){return e.ver.scale(t.x)+e.ver.scale.rangeBand()/2}).x0(function(t){return e.hor.scale(t.y0)}).x1(function(t){return e.hor.scale(t.y0+t.y)}).interpolate(t.config.area.interpolation)).on("mouseover",function(e,a){t.effects[n[a]].mouseover()}).on("mouseout",function(e,a){t.effects[n[a]].mouseout()}),t.areagroup.append("path").attr("class",function(t,e){return a.util.getClassName(this,a.constants.classes.line+n[e])}).style("stroke","white").style("fill","none").style("stroke-width",2).attr("d",d3.svg.line().y(function(t){return e.ver.scale(t.x)+e.ver.scale.rangeBand()/2}).x(function(t){return e.hor.scale(t.y0+t.y)}).interpolate(t.config.area.interpolation)),t},a.StackedAreaGraph.prototype.drawVerticalArea=function(){var t=this,e=t.axes,n=t.categories,r=t.config;e.hor.scale.rangePoints([0,t.width()]);for(var o=0;o<n.length;o+=1)a.effects.area.mouseover(t,o),a.effects.area.mouseout(t,o);return t.areagroup.append("path").attr("class",function(t,e){return a.util.getClassName(this,a.constants.classes.area+n[e])}).style("fill",function(t,e){return a.util.getColorBand(r,e)}).attr("d",d3.svg.area().x(function(t){return e.hor.scale(t.x)+e.hor.scale.rangeBand()/2}).y0(function(t){return e.ver.scale(t.y0)}).y1(function(t){return e.ver.scale(t.y0+t.y)}).interpolate(t.config.area.interpolation)).on("mouseover",function(e,a){t.effects[n[a]].mouseover()}).on("mouseout",function(e,a){t.effects[n[a]].mouseout()}),t.areagroup.append("path").attr("class",function(t,e){return a.util.getClassName(this,a.constants.classes.line+n[e])}).style("stroke","white").style("fill","none").style("stroke-width",2).attr("d",d3.svg.line().x(function(t){return e.hor.scale(t.x)+e.hor.scale.rangeBand()/2}).y(function(t){return e.ver.scale(t.y0+t.y)}).interpolate(t.config.area.interpolation)),t},a.StackedBarGraph=function(t,e){var n=this;a.Graph.call(n,t,e).setDefaults().init(),n.bargroups={};var r,o,s=n.labels,i=s.map(function(t){return 0}),l=s.map(function(t){return 0});for(n.axes["Horizontal"===n.config.graph.orientation?"ver":"hor"].scale.domain(s),r=0,o=n.categories.length;o>r;r+=1)n.bargroups[n.categories[r]]=n.chart.append("g").classed("cg-"+a.util.formatClassName(n.categories[r]),!0),n["draw"+n.config.graph.orientation+"Bars"](r,i,l);n.finalize()},a.StackedBarGraph.prototype=a.util.inherits(a.Graph),a.StackedBarGraph.prototype.setDefaults=function(){var t=this;return t.graphdef.stepup="stepup",this},a.StackedBarGraph.prototype.drawHorizontalBars=function(t,e,n){var r=this,o=this.axes,s=a.util.getColorBand(this.config,t),i=this.config,l=this.bargroups[this.categories[t]],c=l.selectAll("g").data(this.graphdef.dataset[r.categories[t]]).enter().append("g").classed("cge-"+a.util.formatClassName(r.categories[t]),!0);c.append("rect").attr("height",o.ver.scale.rangeBand()).attr("width",0).attr("x",function(t,a){var n=o.hor.scale(e[a]);return e[a]+=t.value,n}).attr("y",function(t){return o.ver.scale(t.name)}).classed("cr-"+a.util.formatClassName(r.categories[t]),!0).style("stroke","none").style("fill",s).transition().duration(r.config.effects.duration).delay(t*r.config.effects.duration).attr("width",function(t,a){return o.hor.scale(e[a])-o.hor.scale(e[a]-t.value)}).each("end",function(e,n){d3.select(this).on("mouseover",a.effects.bar.mouseover(r,t,r.config.effects.textcolor)),d3.select(this).on("mouseout",a.effects.bar.mouseout(r,t,r.config.effects.textcolor)),"function"==typeof r.config.graph.clickCallback&&d3.select(this).on("click",function(t){r.config.graph.clickCallback.apply(null,[t])})}),c.append("text").attr("y",function(t){return o.ver.scale(t.name)+o.ver.scale.rangeBand()/2}).attr("dx",0).attr("dy",".35em").attr("text-anchor","end").classed("cr-"+a.util.formatClassName(r.categories[t]),!0).style("fill",r.config.label.showlabel?r.config.effects.textcolor:"none").style("font-family",i.bar.fontfamily).style("font-size",i.bar.fontsize).style("font-weight",i.bar.fontweight).style("opacity",0).text(function(t){return o.hor.scale(t.value)>15?a.util.getLabelValue(r,t):null}).transition().duration(r.config.effects.duration).delay(t*r.config.effects.duration).style("opacity",1).attr("x",function(t,e){return n[e]+=t.value,o.hor.scale(n[e])-5}),c.append("svg:title").text(function(e,n){return a.util.getTooltipText(r,r.categories[t],r.labels[n],e)})},a.StackedBarGraph.prototype.drawVerticalBars=function(t,e,n){var r=this,o=this.height(),s=this.axes,i=a.util.getColorBand(this.config,t),l=this.config,c=this.bargroups[r.categories[t]],f=c.selectAll("g").data(this.graphdef.dataset[r.categories[t]]).enter().append("g").classed("cge-"+a.util.formatClassName(r.categories[t]),!0);f.append("rect").attr("height",0).attr("width",s.hor.scale.rangeBand()).attr("x",function(t){return s.hor.scale(t.name)}).attr("y",function(t,a){var n=s.ver.scale(e[a]);return e[a]-=t.value,n}).classed("cr-"+a.util.formatClassName(r.categories[t]),!0).style("stroke","none").style("fill",i).transition().duration(r.config.effects.duration).delay(t*r.config.effects.duration).attr("height",function(t,a){return-(s.ver.scale(-e[a])-s.ver.scale(-e[a]-t.value))}).each("end",function(e,n){d3.select(this).on("mouseover",a.effects.bar.mouseover(r,t,r.config.effects.textcolor)),d3.select(this).on("mouseout",a.effects.bar.mouseout(r,t,r.config.effects.textcolor)),"function"==typeof r.config.graph.clickCallback&&d3.select(this).on("click",function(t){r.config.graph.clickCallback.apply(null,[t])})}),f.append("text").attr("transform","scale(1,-1)").attr("x",function(t){return s.hor.scale(t.name)+s.hor.scale.rangeBand()/2}).attr("y",-o+5).attr("dy",".71em").attr("text-anchor","middle").classed("cr-"+a.util.formatClassName(r.categories[t]),!0).style("fill",r.config.label.showlabel?r.config.effects.textcolor:"none").style("font-family",l.bar.fontfamily).style("font-size",l.bar.fontsize).style("font-weight",l.bar.fontweight).style("opacity",0).text(function(t){ 
     3return o-s.ver.scale(t.value)>15?a.util.getLabelValue(r,t):null}).transition().duration(r.config.effects.duration).delay(t*r.config.effects.duration).style("opacity",1).attr("y",function(t,e){return n[e]+=t.value,-(2*o-s.ver.scale(n[e]))+5}),f.append("svg:title").text(function(e,n){return a.util.getTooltipText(r,r.categories[t],r.labels[n],e)}),c.attr("transform","translate(0,"+2*this.height()+") scale(1,-1)")},a.StepUpBarGraph=function(t,e){var n=this;a.Graph.call(n,t,e).setDefaults().init(),this.bargroups={};var r,o=n.categories.length,s=n.labels.map(function(t){return 0}),i=n.labels.map(function(t){return 0});for(n.axes["Horizontal"===this.config.graph.orientation?"ver":"hor"].scale.domain(this.labels),r=0;o>r;r+=1)n.bargroups[n.categories[r]]=this.chart.append("g").classed("cg-"+a.util.formatClassName(n.categories[r]),!0),n["draw"+n.config.graph.orientation+"Bars"](r,s,i);n.finalize()},a.StepUpBarGraph.prototype=a.util.inherits(a.Graph),a.StepUpBarGraph.prototype.setDefaults=function(){var t=this;return t.graphdef.stepup="stepup",this},a.StepUpBarGraph.prototype.drawHorizontalBars=function(t,e,n){var r=this,o=r.categories.length,s=a.util.getColorBand(r.config,t),i=r.bargroups[r.categories[t]],l=i.selectAll("g").data(r.graphdef.dataset[r.categories[t]]).enter().append("g").classed("cge-"+a.util.formatClassName(r.categories[t]),!0);l.append("rect").attr("height",r.axes.ver.scale.rangeBand()/o).attr("width",0).attr("transform",function(t){return t.value<0?"scale(-1,1)":"scale(1,1)"}).attr("x",function(t,a){t.resetSum===!0&&(e[a]=0);var n=r.axes.hor.scale(e[a]);return e[a]+=t.value,t.value<0?-n:n}).attr("y",function(t){return r.axes.ver.scale(t.name)}).classed("cr-"+a.util.formatClassName(r.categories[t]),!0).style("stroke","none").style("fill",s).transition().duration(r.config.effects.duration).delay(t*r.config.effects.duration).attr("width",function(t,a){return Math.abs(r.axes.hor.scale(e[a])-r.axes.hor.scale(e[a]-t.value))}).call(a.util.endAll,function(e,n){d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseover",a.effects.bar.mouseover(r,t)),d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseout",a.effects.bar.mouseout(r,t))}),l.append("text").attr("y",function(t){return r.axes.ver.scale(t.name)+r.axes.ver.scale.rangeBand()/o/2}).attr("dx",function(t){return t.value<0?-16:4}).attr("dy",".35em").attr("text-anchor","start").classed("cr-"+a.util.formatClassName(r.categories[t]),!0).style("fill",r.config.label.showlabel?a.util.getColorBand(r.config,t):"none").style("opacity",0).style("font-family",r.config.bar.fontfamily).style("font-size",r.config.bar.fontsize).style("font-weight",r.config.bar.fontweight).text(function(t){return a.util.getLabelValue(r,t)}).transition().duration(r.config.effects.duration).delay(t*r.config.effects.duration).style("opacity",1).attr("x",function(t,e){return t.resetSum===!0&&(n[e]=0),n[e]+=t.value,r.axes.hor.scale(n[e])}),l.append("svg:title").text(function(e,n){return a.util.getTooltipText(r,r.categories[t],r.labels[n],e)}),i.attr("transform","translate(0,"+t*r.axes.ver.scale.rangeBand()/o+")")},a.StepUpBarGraph.prototype.drawVerticalBars=function(t,e,n){var r=this,o=r.categories.length,s=a.util.getColorBand(r.config,t),i=r.bargroups[r.categories[t]],l=i.selectAll("g").data(r.graphdef.dataset[r.categories[t]]).enter().append("g").classed("cge-"+a.util.formatClassName(r.categories[t]),!0);l.append("rect").attr("height",0).attr("width",r.axes.hor.scale.rangeBand()/o).attr("transform",function(t){return t.value<0?"scale(1,-1)":"scale(1,1)"}).attr("x",function(t){return r.axes.hor.scale(t.name)}).attr("y",function(t,a){t.resetSum===!0&&(e[a]=0);var n=2*r.height()-r.axes.ver.scale(e[a]);return e[a]+=t.value,t.value<0?-n:n}).classed("cr-"+a.util.formatClassName(r.categories[t]),!0).style("stroke","none").style("fill",s).transition().duration(r.config.effects.duration).delay(t*r.config.effects.duration).attr("height",function(t,a){return Math.abs(r.axes.ver.scale(-e[a])-r.axes.ver.scale(-e[a]-t.value))}).call(a.util.endAll,function(e,n){d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseover",a.effects.bar.mouseover(r,t)),d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseout",a.effects.bar.mouseout(r,t))}),l.append("text").attr("transform","scale(1,-1)").attr("x",function(t){return r.axes.hor.scale(t.name)+r.axes.hor.scale.rangeBand()/o/2}).attr("y",-r.height()-10).attr("dy",function(t){return t.value<0?"2.3em":".71em"}).attr("text-anchor","middle").classed("cr-"+a.util.formatClassName(r.categories[t]),!0).style("fill",r.config.label.showlabel?a.util.getColorBand(r.config,t):"none").style("font-family",r.config.bar.fontfamily).style("font-size",r.config.bar.fontsize).style("font-weight",r.config.bar.fontweight).style("opacity",0).text(function(t){return a.util.getLabelValue(r,t)}).transition().duration(r.config.effects.duration).delay(t*r.config.effects.duration).style("opacity",1).attr("y",function(t,e){return t.resetSum===!0&&(n[e]=0),n[e]+=t.value,-(2*r.height()-r.axes.ver.scale(n[e]))-10}),l.append("svg:title").text(function(e,n){return a.util.getTooltipText(r,r.categories[t],r.labels[n],e)}),i.attr("transform","translate("+t*r.axes.hor.scale.rangeBand()/o+","+2*r.height()+") scale(1,-1)")},a.Table=function(){this.caption=void 0,this.position=void 0,this.graphdef=void 0,this.table=void 0,this.header=void 0,this.body=void 0,this.bodyrows={}},a.Table.prototype.init=function(t,e){this.graphdef=t,this.config=a.util.extend({},e),this.position=this.config.meta.pos||"body",this.table=d3.select(this.position).append("table").classed(this.config.table.tableclass,!0),this.header=this.table.append("thead").classed(this.config.table.headerclass,!0),this.body=this.table.append("tbody").classed(this.config.table.bodyclass,!0),this.footer=this.table.append("tfoot").classed(this.config.table.footerclass,!0)},a.Table.prototype.finalize=function(){},a.TableGraph=function(t,e){a.Table.apply(this,[t]),this.init(t,e),"Horizontal"===this.config.graph.orientation?this.setHorTable():this.setVerTable(),this.finalize()},a.TableGraph.prototype=a.util.inherits(a.Table),a.TableGraph.prototype.setHorTable=function(){var t=this.graphdef.categories,e=a.util.getTabularArray(this.graphdef);t.unshift(""),this.header.append("tr").selectAll("td").data(t).enter().append("td").text(function(t){return t}),t.shift(),this.bodyrows=this.body.selectAll("tr").data(e).enter().append("tr"),this.bodyrows.selectAll("td").data(function(t,a){return e[a]}).enter().append("td").attr("class",function(t,e){var a=0===e?"chart3rtablelabel":"chart3rtabledata";return d3.select(this).attr("class")+a}).text(function(t){return t})},a.TableGraph.prototype.setVerTable=function(){var t=a.util.getLabelArray(this.graphdef),e=this.graphdef.dataset;t.unshift(""),this.header.append("tr").selectAll("td").data(t).enter().append("td").text(function(t){return t}),t.shift(),this.bodyrows=this.body.selectAll("tr").data(this.graphdef.categories).enter().append("tr"),this.bodyrows.selectAll("td").data(function(t){var a,n,r=[];for(r.push(t),a=0,n=e[t].length;n>a;a+=1)r.push(e[t][a].value);return r}).enter().append("td").attr("class",function(t,e){var a=0===e?"chart3rtablelabel":"chart3rtabledata";return d3.select(this).attr("class")+a}).text(function(t){return t})},a.WaterfallGraph=function(t,e){var n=this;a.Graph.call(n,t,e).setDefaults().init(),n.bargroups={},n.axes["Horizontal"===n.config.graph.orientation?"ver":"hor"].scale.domain(n.labels);{var r;n.categories.length}r=n.categories[0],n.bargroups[r]=n.chart.append("g").classed("cg-"+a.util.formatClassName(r),!0),n["draw"+n.config.graph.orientation+"Bars"](0),n.finalize()},a.WaterfallGraph.prototype=a.util.inherits(a.Graph),a.WaterfallGraph.prototype.setDefaults=function(){var t=this;return t.graphdef.stepup="waterfall",t.config.legend.showlegends=!1,this},a.WaterfallGraph.prototype.drawHorizontalBars=function(t){var e=this,n=e.categories.length,r=a.util.getColorBand(e.config,t),o=e.bargroups[e.categories[t]],s=0,i=0,l=o.selectAll("g").data(e.graphdef.dataset[e.categories[t]]).enter().append("g").classed("cge-"+a.util.formatClassName(e.categories[t]),!0);l.append("rect").attr("height",e.axes.ver.scale.rangeBand()/n-2).attr("width",0).attr("x",function(t,a){var n=t.value<0?s+t.value:s;return s+=t.value,e.axes.hor.scale(n)}).attr("y",function(t){return e.axes.ver.scale(t.name)}).classed("cr-"+a.util.formatClassName(e.categories[t]),!0).style("stroke","none").style("fill",r).transition().duration(e.config.effects.duration).delay(t*e.config.effects.duration).attr("width",function(t){return e.axes.hor.scale(Math.abs(t.value))}).call(a.util.endAll,function(n,r){d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseover",a.effects.bar.mouseover(e,t)),d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseout",a.effects.bar.mouseout(e,t))}),l.append("text").attr("y",function(t){return e.axes.ver.scale(t.name)+e.axes.ver.scale.rangeBand()/n/2}).attr("dx",4).attr("dy",".35em").attr("text-anchor","start").classed("cr-"+a.util.formatClassName(e.categories[t]),!0).style("fill",e.config.label.showlabel?a.util.getColorBand(e.config,t):"none").style("font-family",e.config.bar.fontfamily).style("font-size",e.config.bar.fontsize).style("font-weight",e.config.bar.fontweight).text(function(t){return a.util.getLabelValue(e,t)}).transition().duration(e.config.effects.duration).delay(t*e.config.effects.duration).attr("x",function(t,a){var n=t.value<0?i:i+t.value;return i+=t.value,e.axes.hor.scale(n)}),l.append("svg:title").text(function(n,r){return a.util.getTooltipText(e,e.categories[t],e.labels[r],n)}),o.attr("transform","translate(0,"+t*e.axes.ver.scale.rangeBand()/n+")")},a.WaterfallGraph.prototype.drawVerticalBars=function(t){var e=this,n=a.util.getColorBand(this.config,t),r=e.categories.length,o=0,s=0,i=e.bargroups[e.categories[t]].selectAll("g").data(e.graphdef.dataset[e.categories[t]]).enter().append("g").classed("cge-"+a.util.formatClassName(e.categories[t]),!0);i.append("rect").classed("cr-"+a.util.formatClassName(e.categories[t]),!0).attr("height",0).attr("width",0).attr("x",function(t){return e.axes.hor.scale(t.name)}).attr("y",function(t){var a=t.value<0?o+t.value:o;return o+=t.value,e.height()-e.axes.ver.scale(a)}).style("stroke",e.config.bar.strokecolor).style("fill",n).transition().duration(e.config.effects.duration).delay(t*e.config.effects.duration).attr("height",function(t){return e.height()-e.axes.ver.scale(Math.abs(t.value))}).attr("width",e.axes.hor.scale.rangeBand()/r-2).call(a.util.endAll,function(n,r){d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseover",a.effects.bar.mouseover(e,t)),d3.select(this.parentNode.parentNode).selectAll("rect").on("mouseout",a.effects.bar.mouseout(e,t))}),i.append("text").attr("transform","scale(1,-1)").attr("x",function(t){return e.axes.hor.scale(t.name)+e.axes.hor.scale.rangeBand()/r/2}).attr("y",-10).attr("dx",0).attr("dy",".35em").attr("text-anchor","middle").classed("cr-"+a.util.formatClassName(e.categories[t]),!0).style("fill",e.config.label.showlabel?a.util.getColorBand(e.config,t):"none").style("font-family",e.config.bar.fontfamily).style("font-size",e.config.bar.fontsize).style("font-weight",e.config.bar.fontweight).text(function(t){return a.util.getLabelValue(e,t)}).transition().duration(e.config.effects.duration).delay(t*e.config.effects.duration).attr("y",function(t){s+=t.value;var a=t.value<0?s-t.value:s;return-(e.height()-e.axes.ver.scale(a))-10}),i.append("svg:title").text(function(n,r){return a.util.getTooltipText(e,e.categories[t],e.labels[r],n)}),e.bargroups[e.categories[t]].attr("transform","translate("+t*e.axes.hor.scale.rangeBand()/r+","+e.height()+") scale(1,-1)")},e||(t.uv={chart:a.chart}),{chart:a.chart}}); 
Note: See TracChangeset for help on using the changeset viewer.