// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://@sbaseurl@/jsapi/jsapi/esri/copyright.txt and http://www.arcgis.com/apps/webappbuilder/copyright.txt for details.

//>>built
define(["dojo/_base/declare"],function(c){return c([],{constructor:function(a){this.chart=a.chart;this.chartUtils=a.chartUtils},produceOption:function(a,b){a=this.chartUtils.preProcessConfig(a,b);"curved"===b.shape?a=this.setCurvedGaugeOption(a,b):"vertical"===b.shape?a=this.setVerticalGaugeOption(a,b):"horizontal"===b.shape?a=this.setHorizontalGaugeOption(a,b):console.error("invaild gauge shape");a=this.chartUtils.settingLabelColor(a,b);return a=this.chartUtils.settingValueStyle(a,b)},setCurvedGaugeOption:function(a,
b){a=this.chartUtils.initCurvedOption(a);a=this.chartUtils.settingCurvedSeries(a,b);a=this.chartUtils.settingCurvedTooltip(a,b);a=this.chartUtils.settingCurvedGaugeColor(a,b);return a=this.chartUtils.settingCurvedTargets(a,b)},setVerticalGaugeOption:function(a,b){a=this.chartUtils.initVerticalOption(a,this.vertical);a=this.chartUtils.setVerticalGrid(a);a=this.chartUtils.settingVerticalAxis(a,b);a=this.chartUtils.settingVerticalSeries(a,b);a=this.chartUtils.settingGaugeColumnColor(a,b);return a=this.chartUtils.settingVerticalGaugeRTL(a,
b)},setHorizontalGaugeOption:function(a,b){a=this.chartUtils.initHorizontalOption(a,this.horizontal);a=this.chartUtils.setHorizontalGrid(a);a=this.chartUtils.settingHorizontalAxis(a,b);a=this.chartUtils.settingHorizontalSeries(a,b);a=this.chartUtils.settingGaugeColumnColor(a,b);return a=this.chartUtils.settingHorizontalGaugeRTL(a,b)},resetGraphic:function(a){if("horizontal"===a.shape||"vertical"===a.shape)a=this.chartUtils.createTargetGraphic(a),this.clearGraphic(),this.chart.setOption({graphic:a}),
this.cacheGraphic=null,this.cacheGraphic=a},clearGraphic:function(){this.cacheGraphic&&(this.cacheGraphic.forEach(function(a){a.$action="remove"}),this.chart.setOption({graphic:this.cacheGraphic}))},resetGrid:function(a){("horizontal"===a.shape||"vertical"===a.shape)&&(a=this.chartUtils.updateGridForVerticalGauge(a))&&this.chart.setOption({grid:a})}})});