/*!@license * Infragistics.Web.ClientUI charting and map common widget 19.1.20191.172 * * Copyright (c) 2011-2019 Infragistics Inc. * * http://www.infragistics.com/ * * Depends on: * jquery-1.9.1.js * jquery.ui.core.js * jquery.ui.widget.js * infragistics.dataSource.js * infragistics.templating.js (Optional) * infragistics.util.js * infragistics.util.jquery.js * infragistics.dv_jquerydom.js */ (function(factory){if(typeof define==="function"&&define.amd){define(["jquery","jquery-ui","./infragistics.util","./infragistics.util.jquery","./infragistics.dv_jquerydom"],factory)}else{factory(jQuery)}})(function($){/*!@license * Infragistics.Web.ClientUI common DV widget localization resources 19.1.20191.172 * * Copyright (c) 2011-2019 Infragistics Inc. * * http://www.infragistics.com/ * */ (function($){$.ig=$.ig||{};$.ig.locale=$.ig.locale||{};$.ig.locale.en=$.ig.locale.en||{};$.ig.DataChart=$.ig.DataChart||{};$.ig.PieChart=$.ig.PieChart||{};$.ig.Map=$.ig.Map||{};$.ig.Financial=$.ig.Financial||{};$.ig.ShapeChartWidget=$.ig.ShapeChartWidget||{};$.ig.locale.en.DataChart={seriesName:"must specify series name option when setting options.",axisName:"must specify axis name option when setting options.",invalidLabelBinding:"There is no such value for the labels to bind.",invalidSeriesAxisCombination:"Invalid combination of series and axis types: ",close:"Close",overview:"Overview",zoomOut:"Zoom Out",zoomIn:"Zoom In",resetZoom:"Reset Zoom",seriesUnsupportedOption:"the current series type does not support the option: ",seriesTypeNotLoaded:"the JavaScript file containing the requested series type has not been loaded or the series type is invalid: ",axisTypeNotLoaded:"the JavaScript file containing the requested axis type has not been loaded or the axis type is invalid: ",axisUnsupportedOption:"the current axis type does not support the option: ",dataChart_TrendLinesNotLoaded:"Trend lines functionality was accessed but chart trend line module was not loaded.",dataChart_NumberAbbreviatorNotLoaded:"Number abbreviation functionality was used, but the number abbreviator module has not been loaded.",dataChart_VisualDataNotLoaded:"VisualData functionality was accessed but chart interaction module has not been loaded.",dataChart_InteractivityNotLoaded:"Interactivity functionality was accessed but chart interaction module has not been loaded.",financialSeries_Close:"Close",financialSeries_High:"High",financialSeries_Low:"Low",financialSeries_Open:"Open",financialSeries_Volume:"Volume"};$.ig.locale.en.Map={seriesName:"must specify series name option when setting options.",axisName:"must specify axis name option when setting options.",invalidLabelBinding:"There is no such value for the labels to bind.",invalidSeriesAxisCombination:"Invalid combination of series and axis types: ",close:"Close",overview:"Overview",zoomOut:"Zoom Out",zoomIn:"Zoom In",resetZoom:"Reset Zoom",seriesUnsupportedOption:"the current series type does not support the option: ",seriesTypeNotLoaded:"the JavaScript file containing the requested series type has not been loaded or the series type is invalid: ",axisTypeNotLoaded:"the JavaScript file containing the requested axis type has not been loaded or the axis type is invalid: ",axisUnsupportedOption:"the current axis type does not support the option: ",dataChart_TrendLinesNotLoaded:"Trend lines functionality was accessed but chart trend line module was not loaded.",dataChart_NumberAbbreviatorNotLoaded:"Number abbreviation functionality was used, but the number abbreviator module has not been loaded.",dataChart_VisualDataNotLoaded:"VisualData functionality was accessed but chart interaction module has not been loaded.",dataChart_InteractivityNotLoaded:"Interactivity functionality was accessed but chart interaction module has not been loaded."};$.ig.locale.en.Financial={financialChart_RangeSelector_OneMonth:"1M",financialChart_RangeSelector_ThreeMonths:"3M",financialChart_RangeSelector_SixMonths:"6M",financialChart_RangeSelector_YTD:"YTD",financialChart_RangeSelector_OneYear:"1Y",financialChart_RangeSelector_All:"All",financialChart_IndicatorMenu_Header:"Indicators",financialChart_IndicatorMenu_OverlaysCategoryHeader:"Overlays",financialChart_IndicatorMenu_TrendlinesCategoryHeader:"Trendlines",financialChart_IndicatorMenu_VolumeCategoryHeader:"Volumes",financialChart_IndicatorMenu_IndicatorsCategoryHeader:"Standalone Indicators",financialChart_IndicatorsMenu_Overlay_BollingerBands:"Bollinger Bands",financialChart_IndicatorsMenu_Overlay_PriceChannel:"Price Channel",financialChart_IndicatorsMenu_TrendLine_LinearFit:"Linear Fit",financialChart_IndicatorsMenu_TrendLine_QuadraticFit:"Quadratic Fit",financialChart_IndicatorsMenu_TrendLine_CubicFit:"Cubic Fit",financialChart_IndicatorsMenu_TrendLine_QuarticFit:"Quartic Fit",financialChart_IndicatorsMenu_TrendLine_QuinticFit:"Quintic Fit",financialChart_IndicatorsMenu_TrendLine_LogarithmicFit:"Logarithmic Fit",financialChart_IndicatorsMenu_TrendLine_ExponentialFit:"Exponential Fit",financialChart_IndicatorsMenu_TrendLine_PowerLawFit:"PowerLaw Fit",financialChart_IndicatorsMenu_TrendLine_SimpleAverage:"Simple Average",financialChart_IndicatorsMenu_TrendLine_ExponentialAverage:"Exponential Average",financialChart_IndicatorsMenu_TrendLine_ModifiedAverage:"Modified Average",financialChart_IndicatorsMenu_TrendLine_CumulativeAverage:"Cumulative Average",financialChart_IndicatorsMenu_TrendLine_WeightedAverage:"Weighted Average",financialChart_IndicatorsMenu_Volume_Column:"Column",financialChart_IndicatorsMenu_Volume_Line:"Line",financialChart_IndicatorsMenu_Volume_Area:"Area",financialChart_IndicatorsMenu_Indicator_AbsoluteVolumeOscillator:"Absolute Volume Oscillator",financialChart_IndicatorsMenu_Indicator_AccumulationDistribution:"Accumulation Distribution",financialChart_IndicatorsMenu_Indicator_AverageDirectionalIndex:"Average Directional Index",financialChart_IndicatorsMenu_Indicator_AverageTrueRange:"Average True Range",financialChart_IndicatorsMenu_Indicator_BollingerBandWidth:"Bollinger Band Width",financialChart_IndicatorsMenu_Indicator_ChaikinOscillator:"Chaikin Oscillator",financialChart_IndicatorsMenu_Indicator_ChaikinVolatility:"Chaikin Volatility",financialChart_IndicatorsMenu_Indicator_CommodityChannelIndex:"Commodity Channel Index",financialChart_IndicatorsMenu_Indicator_DetrendedPriceOscillator:"Detrended Price Oscillator",financialChart_IndicatorsMenu_Indicator_EaseOfMovement:"Ease Of Movement",financialChart_IndicatorsMenu_Indicator_FastStochasticOscillator:"Fast Stochastic Oscillator",financialChart_IndicatorsMenu_Indicator_ForceIndex:"Force Index",financialChart_IndicatorsMenu_Indicator_FullStochasticOscillator:"Full Stochastic Oscillator",financialChart_IndicatorsMenu_Indicator_MarketFacilitationIndex:"Market Facilitation Index",financialChart_IndicatorsMenu_Indicator_MassIndex:"Mass Index",financialChart_IndicatorsMenu_Indicator_MedianPrice:"Median Price",financialChart_IndicatorsMenu_Indicator_MoneyFlowIndex:"Money Flow Index",financialChart_IndicatorsMenu_Indicator_MovingAverageConvergenceDivergence:"MACD",financialChart_IndicatorsMenu_Indicator_NegativeVolumeIndex:"Negative Volume Index",financialChart_IndicatorsMenu_Indicator_OnBalanceVolume:"On Balance Volume",financialChart_IndicatorsMenu_Indicator_PercentagePriceOscillator:"Percentage Price Oscillator",financialChart_IndicatorsMenu_Indicator_PercentageVolumeOscillator:"Percentage Volume Oscillator",financialChart_IndicatorsMenu_Indicator_PositiveVolumeIndex:"Positive Volume Index",financialChart_IndicatorsMenu_Indicator_PriceVolumeTrend:"Price Volume Trend",financialChart_IndicatorsMenu_Indicator_RateOfChangeAndMomentum:"ROC",financialChart_IndicatorsMenu_Indicator_RelativeStrengthIndex:"RSI",financialChart_IndicatorsMenu_Indicator_SlowStochasticOscillator:"Slow Stochastic Oscillator",financialChart_IndicatorsMenu_Indicator_StandardDeviation:"Standard Deviation",financialChart_IndicatorsMenu_Indicator_StochRSI:"Stoch RSI",financialChart_IndicatorsMenu_Indicator_TRIX:"TRIX",financialChart_IndicatorsMenu_Indicator_TypicalPrice:"Typical Price",financialChart_IndicatorsMenu_Indicator_UltimateOscillator:"Ultimate Oscillator",financialChart_IndicatorsMenu_Indicator_WeightedClose:"Weighted Close",financialChart_IndicatorsMenu_Indicator_WilliamsPercentR:"Williams %R"};$.extend($.ig.locale.en.Financial,$.ig.locale.en.DataChart);$.ig.locale.en.ShapeChartWidget={breakEvenTitle_BreakEven:"Break Even",breakEvenTitle_FixedCost:"Fixed Cost",breakEvenTitle_LossArea:"Loss Area",breakEvenTitle_MarginalProfit:"Marginal Profit",breakEvenTitle_ProfitArea:"Profit Area",breakEvenTitle_SafetyMargin:"Safety Margin",breakEvenTitle_SalesRevenue:"Sales Revenue",breakEvenTitle_TotalCost:"Total Cost",breakEvenTitle_VariableCost:"Variable Cost"};$.extend($.ig.locale.en.ShapeChartWidget,$.ig.locale.en.DataChart);$.ig.DataChart.locale=$.ig.DataChart.locale||$.ig.locale.en.DataChart;$.ig.PieChart.locale=$.ig.PieChart.locale||$.ig.locale.en.PieChart;$.ig.Map.locale=$.ig.Map.locale||$.ig.locale.en.Map;$.ig.Financial.locale=$.ig.Financial.locale||$.ig.locale.en.Financial;$.ig.ShapeChartWidget.locale=$.ig.ShapeChartWidget.locale||$.ig.locale.en.ShapeChartWidget;return $.ig.locale.en})($);$.ig.dvCommonWidget=$.ig.dvCommonWidget||Class.extend({init:function(widget){this.widget=widget},_createWidget:function(options,element,widget){var self=this;this.widget=widget;this.widget._duringInit=true;options=$.extend(false,{},options);this.widget._creationOptions=options;this.widget._defaultOptions=this.widget.options;this.widget.options={};this.widget.options.language=this.widget._defaultOptions.language;this.widget.options.locale=this.widget._defaultOptions.locale;this.widget.options.regional=this.widget._defaultOptions.regional;if(this.widget._creationOptions.language){this.widget.options.language=this.widget._creationOptions.language}if(this.widget._creationOptions.locale){this.widget.options.locale=this.widget._creationOptions.locale}if(this.widget._creationOptions.regional){this.widget.options.regional=this.widget._creationOptions.regional}if(options.dataSource&&$.type(options.dataSource)==="array"||$.type(options.dataSource)==="object"&&(typeof options.dataSource._xmlToArray!=="function"||typeof options.dataSource._encodePkParams!=="function")){this.widget._initialDataSource=options.dataSource;options.dataSource=null}this.widget._initialSeriesDataSource={};this.widget._initialAxesDataSource={};if(options.series){options.series=options.series.slice(0);$.each(options.series,function(i,val){if(val.name&&val.dataSource&&$.type(val.dataSource)==="array"||$.type(val.dataSource)==="object"&&(typeof val.dataSource._xmlToArray!=="function"||typeof val.dataSource._encodePkParams!=="function")){self.widget._initialSeriesDataSource[val.name]=val.dataSource;val.dataSource=null}})}if(options.axes){options.axes=options.axes.slice(0);$.each(options.axes,function(i,val){if(val.name&&val.dataSource&&$.type(val.dataSource)==="array"||$.type(val.dataSource)==="object"&&(typeof val.dataSource._xmlToArray!=="function"||typeof val.dataSource._encodePkParams!=="function")){self.widget._initialAxesDataSource[val.name]=val.dataSource;val.dataSource=null}})}switch(this.widget.widgetName){case"igDataChart":this.widget._axisTemplate=$.extend(false,{},{});this.widget._seriesTemplate=$.extend(false,{},{});if(options.series===undefined){options.series=[]}if(options.axes===undefined){options.axes=[]}break;case"igPieChart":break;case"igMap":this.widget._seriesTemplate=$.extend(false,{},{});if(options.series===undefined){options.series=[]}this.widget.options.backgroundContent=null;break}$.ui.igWidget.prototype._createWidget.apply(this.widget,[options,element])},option:function(key,value){var val=$.ui.igWidget.prototype.option.apply(this.widget,arguments);if(val===undefined){if(typeof key==="string"){if(value===undefined){return this.widget._defaultOptions[key]}}}return val},_create:function(){var widget=this.widget;this._chartElement=$("
");var chartEle=this._chartElement[0];var wrap=new $.ig.JQueryDomWrapper(chartEle,this._chartElement);var renderer=new $.ig.JQueryDomRenderer(wrap,$.proxy(this.widget._getLocaleValue,this.widget));this._renderer=renderer;if(!$.ig.util._isCanvasSupported()){$.ig.util._renderUnsupportedBrowser(widget)}else{this.widget._notInitialized=true;if(widget._initialDataSource){widget._creationOptions.dataSource=this.widget._initialDataSource;widget.options.dataSource=this.widget._initialDataSource}if(widget.options.series){$.each(widget.options.series,function(i,val){if(val.name&&widget._initialSeriesDataSource[val.name]!==undefined){val.dataSource=widget._initialSeriesDataSource[val.name]}})}if(widget.options.axes){$.each(widget.options.axes,function(i,val){if(val.name&&widget._initialAxesDataSource[val.name]!==undefined){val.dataSource=widget._initialAxesDataSource[val.name]}})}widget._pendingCrossingAxes=[];widget._tooltipTemplate=null;widget._tooltipTtemplates=null;widget._tooltip={};this.widget._tooltipTemplates={};switch(this.widget.widgetName){case"igDataChart":widget._chart=new $.ig.XamDataChart;widget._chart.manageDataSources(true);widget._axes={};widget._series={};widget._axisOpt={};widget._seriesOpt={};widget._seriesSubOpt={};widget._seriesSub={};if(widget._chart.widget)widget._chart.widget(widget);this._bindDataChartEvents(widget._chart);this._renderChartContainer(this.widget);this._initialDataBind();break;case"igPieChart":widget._chart=new $.ig.XamPieChart;this._bindPieChartEvents(widget._chart);this._renderChartContainer(this.widget);this._initialDataBind();break;case"igMap":widget._chart=new $.ig.XamGeographicMap;widget._chart.manageDataSources(true);widget._axes={};widget._series={};widget._axisOpt={};widget._seriesOpt={};widget._seriesSubOpt={};widget._seriesSub={};this._bindMapEvents(widget._chart);this._setBackgroundContent(widget.options.backgroundContent);if(widget._creationOptions.backgroundContent!==undefined&&widget.dsCount){this._setCoreWidgetOption(widget._chart,"backgroundContent",widget.options.backgroundContent)}break}if(this.widget._creationOptions.name){this.widget._chart.name(this.widget._creationOptions.name)}if(this.widget.dsCount===0&&this.widget._notInitialized){this._initializeWidget(this.widget)}}},_converterCallback:function(){var context=this.settings.callee;context.widget.dsCount--;if(context.widget.dsCount===0){context._initializeWidget(context.widget)}},_initDataOptions:function(options,callBack){var widget=this.widget,dataOptions;if(options.dataSourceUrl){options.dataSource=options.dataSourceUrl}widget._containerSourceID=widget.id();dataOptions={id:options.name||widget._containerSourceID,rowAdded:this._itemAdded,rowDeleted:this._itemRemoved,rowUpdated:this._itemUpdated,rowInserted:this._itemInserted,callback:callBack,callee:this,responseDataKey:options.responseDataKey,primaryKey:options.primaryKey,responseTotalRecCountKey:options.responseTotalRecCountKey,dataSource:options.dataSource};if(options.dataSourceType!==null){dataOptions.type=options.dataSourceType}return dataOptions},_setupDataSource:function(options,callback){var dataOptions=this._initDataOptions(options,callback);if(this.widget.dataSources===undefined){this.widget.dataSources={}}if(!dataOptions.dataSource||typeof dataOptions.dataSource._xmlToArray!=="function"||typeof dataOptions.dataSource._encodePkParams!=="function"){if($.type(dataOptions.dataSource)==="string"&&dataOptions.dataSource.indexOf("$callback=?")!==-1){this.widget.dataSources[dataOptions.id]=new $.ig.JSONPDataSource(dataOptions)}else{this.widget.dataSources[dataOptions.id]=new $.ig.DataSource(dataOptions)}}else{this.widget.dataSources[dataOptions.id]=dataOptions.dataSource;dataOptions.dataSource=this.widget.dataSources[dataOptions.id].settings.dataSource;if(this.widget.dataSources[dataOptions.id].settings.responseDataKey!==null){delete dataOptions.responseDataKey;if(dataOptions.schema){dataOptions.schema.searchField=this.widget.dataSource.settings.responseDataKey}}this.widget.dataSources[dataOptions.id].settings=this._mergeDataSourceSettings(this.widget.dataSources[dataOptions.id].settings,dataOptions);if(dataOptions.schema){this.widget.dataSources[dataOptions.id]._initSchema()}}},_initCallback:function(success,error,dataSource){var context=dataSource.settings.callee;context.widget.dsCount--;if(context.widget.dsCount===0&&success){context._initializeWidget(context.widget)}},_initializeWidget:function(widget){if(widget._chart&&widget._chart._destroyed){return}this.widget=widget;if(this.widget.dataSources[this.widget._containerSourceID]){this._setItemsSource(this.widget,this.widget._chart,this.widget._containerSourceID)}this._setWidgetOptions(this.widget._creationOptions,widget._chart);this.widget._duringInit=false;if(widget._creationOptions.series){this._setCoreWidgetOption(widget._chart,"series",this.widget._creationOptions.series)}widget._notInitialized=false},_getNotifyTarget:function(targetName){var target;if(this.widget.widgetName==="igPieChart"){target=this.widget._chart}else{if(targetName===this.widget.id()){target=this.widget._chart}else{target=this._getSeriesByName(targetName);if(!target){target=this._getAxisByName(targetName);if(!target){target=this._getSubSeriesByName(null,targetName)}}}}return target!==undefined?target:null},_notifyItemAdded:function(dataSource,newItem,index){this.widget._chart.notifyInsertItem(dataSource,index,newItem.row)},_itemAdded:function(item,dataSource){this._notifyItemAdded(dataSource,item,dataSource.dataView().length-1)},_itemInserted:function(item,dataSource){this._notifyItemAdded(dataSource,item,item.rowIndex)},_itemUpdated:function(item,dataSource){this.widget._chart.notifySetItem(dataSource,item.rowIndex,item.oldRow,item.newRow)},_itemRemoved:function(item,dataSource){this.widget._chart.notifyRemoveItem(dataSource,item.rowIndex,item.row)},_setWidgetOptions:function(options,chart){var self=this;$.each(options,function(key,value){if(!self._setWidgetOption(chart,key,value)){self._setCoreWidgetOption(chart,key,value)}else{self.widget.options[key]=value}})},_createBrushFromValue:function(val){var b,stops,colorStop,currOffset;if(!val){return null}if(typeof val==="string"){if($.ig.CssGradientUtil.prototype.isGradient(val)){b=$.ig.CssGradientUtil.prototype.brushFromGradientString(val)}else{b=new $.ig.Brush;b.fill(val)}}else if(val.type==="linearGradient"){b=new $.ig.LinearGradientBrush;if(val.startPoint&&val.endPoint){b._useCustomDirection=true;b._startX=val.startPoint.x;b._startY=val.startPoint.y;b._endX=val.endPoint.x;b._endY=val.endPoint.y}if(val.colorStops){stops=[];for(var i=0;i0){if(a[i]&&a[i].name===obj.name){a[i]=obj;return}}a.push(obj)},_setCoreWidgetOption:function(chart,key,value){var self=this,widget=this.widget,axis=null,axisOpt=null,axisIsNew=false,merged,settings,newLink,oldLink,seriesIsNew,series=null,seriesOpt=null,exploded,templ;switch(key){case"axes":if(this.widget.widgetName==="igMap"){return}$.each(value,function(i,val){if(!val.name){throw new Error(self.widget._getLocaleValue("axisName"))}if(self.widget._series[val.name]){throw new Error(self.widget._getLocaleValue("nameInUse"))}axis=self._getAxisByName(val.name);if(axis&&val.remove){delete widget._axes[val.name];delete widget._axisOpt[val.name];var ind=self._getIndexByName(widget.options.axes,val.name);widget.options.axes.splice(ind,1);widget._chart.axes().remove(axis);if(widget.dataSources[val.name]){delete widget.dataSources[val.name].settings;delete widget.dataSources[val.name]}if(widget._target&&widget._target.name()===val.name){widget._target=null}return}if(axis){axisOpt=widget._axisOpt[val.name]}if(!axis&&!val.remove){axis=self._createAxisFromType(val.type);axis.name(val.name);axisIsNew=true}if(axis){if(axisIsNew){widget._axes[val.name]=axis;merged=self._mergeIntoNewWithDataSource(widget._axisTemplate,val);self._setForName(widget.options.axes,merged);widget._axisOpt[val.name]=merged}if(val.coercionMethods){axis.coercionMethods(val.coercionMethods)}if(widget.options.expectFunctions!==undefined&&widget.options.expectFunctions){axis.expectFunctions(widget.options.expectFunctions)}if(val.expectFunctions!==undefined){axis.expectFunctions(val.expectFunctions)}self._setAxisOptions(val,axis);if(axisIsNew){if(widget.dataSources[axis.name()]){self._setItemsSource(self.widget,axis,axis.name())}}else{self._mergeIntoWithDataSource(axisOpt,val)}if(axisIsNew){widget._chart.axes().add(axis)}}});if(widget._pendingCrossingAxes&&widget._pendingCrossingAxes.length>0){$.each(widget._pendingCrossingAxes,function(i,val){val()});widget._pendingCrossingAxes.length=0}return;case"series":if(!widget._duringInit){seriesIsNew=false;$.each(value,function(i,val){if(!val.name){throw new Error(self.widget._getLocaleValue("seriesName"))}if(self.widget._axes[val.name]){throw new Error(self.widget._getLocaleValue("nameInUse"))}series=self._getSeriesByName(val.name);if(series&&val.remove){delete widget._series[val.name];delete widget._seriesOpt[val.name];delete widget._seriesSubOpt[val.name];delete widget._seriesSub[val.name];delete widget._tooltip[val.name];if(widget.dataSources[val.name]){delete widget.dataSources[val.name].settings;delete widget.dataSources[val.name]}var ind=self._getIndexByName(widget.options.series,val.name);widget.options.series.splice(ind,1);widget._chart.series().remove(series);self._clearAxes(series);return}if(!series&&!val.remove){series=self._createSeriesFromType(val.type);self._bindSeriesEvents(series);series.name(val.name);seriesIsNew=true}if(series){seriesOpt=widget._seriesOpt[val.name]}if(series){if(seriesIsNew){widget._series[val.name]=series;widget._seriesSub[val.name]={};merged=self._mergeIntoNewWithDataSource(widget._seriesTemplate,val);self._setForName(widget.options.series,merged);widget._seriesOpt[val.name]=merged;widget._seriesSubOpt[val.name]={}}if(val.coercionMethods){series.coercionMethods(val.coercionMethods)}if(widget.options.expectFunctions!==undefined&&widget.options.expectFunctions){series.expectFunctions(widget.options.expectFunctions)}if(val.expectFunctions!==undefined){series.expectFunctions(val.expectFunctions)}self._setSeriesOptions(val,series,widget);if(seriesIsNew){if(widget.dataSources[series.name()]){self._setItemsSource(self.widget,series,series.name())}}else{self._mergeIntoWithDataSource(seriesOpt,val)}if(seriesIsNew){widget._chart.series().add(series)}}})}return;case"syncChannel":newLink=null;if(value&&value.length>0){newLink=$.ig.SyncLinkManager.prototype.instance().getLink(value)}oldLink=widget._chart.actualSyncLink();if(oldLink){$.ig.SyncLinkManager.prototype.instance().releaseLink(oldLink)}if(newLink){widget._chart.actualSyncLink(newLink)}else{widget._chart.actualSyncLink(new $.ig.SyncLink)}widget._chart.syncChannel(value);break;case"synchronizeVertically":settings=widget._chart.syncSettings();settings.synchronizeVertically(value);break;case"synchronizeHorizontally":settings=widget._chart.syncSettings();settings.synchronizeHorizontally(value);break;case"legend":this._setLegend(widget._chart,value);break;case"width":case"height":this._setSize(widget._chart,key,value);break;case"size":if(value.width){this._setSize(widget._chart,"width",value.width);widget.options.width=value.width}if(value.height){this._setSize(widget._chart,"height",value.height);widget.options.height=value.height}return;case"explodedSlices":if(value.length){exploded=new $.ig.IndexCollection;$.each(value,function(i,val){exploded.add(val)});widget._chart.explodedSlices(exploded)}break;case"selectedSlices":if(value.length){var selected=new $.ig.IndexCollection;$.each(value,function(i,val){selected.add(val)});widget._chart.selectedSlices(selected)}break;case"showTooltip":if(value===true){this._addTooltip(widget,widget._chart,widget.css.tooltip)}if(value===false){this._removeTooltip(widget,widget._chart)}break;case"tooltipTemplate":if($.ig.tmpl){if(this._htmlCheckExpr.test(value)){templ=value}else{if($("#"+value).length>0){templ=$("#"+value).text()}else if($(value).length>0){templ=$(value).text()}else{templ=value}}widget._tooltipTemplate=templ;if(widget._chart.tooltipTemplate){widget._chart.tooltipTemplate(templ)}}break;case"backgroundContent":if(value===null){widget._chart.backgroundContent(null)}if(!widget._duringInit){this._setBackgroundContent(value)}break;default:return}widget.options[key]=value},_htmlCheckExpr:/^[^<]*(<[\w\W]+>)[^>]*$/,_getAxisByName:function(name){if(this.widget._axes[name]===undefined){if(this.widget.widgetName==="igMap"){if(name==="xAxis"){return this.widget._chart.xAxis()}if(name==="yAxis"){return this.widget._chart.yAxis()}}return null}return this.widget._axes[name]},_getSeriesByName:function(name){if(this.widget._series[name]===undefined){return null}return this.widget._series[name]},_setAxisOptions:function(options,axis){var self=this;$.each(options,function(key,value){if(!self._setAxisOption(axis,key,value)){self._setCoreAxisOption(axis,key,value)}self.widget._axisOpt[axis.name()][key]=value})},_setSeriesOptions:function(options,series){var self=this;$.each(options,function(key,value){if(!self._setCoreSeriesOption(series,key,value)){self._seriesSetOption(series,key,value)}if(key!=="series"){self.widget._seriesOpt[series.name()][key]=value}})},_setSubSeriesOptions:function(options,parentSeries,series){var self=this;$.each(options,function(key,value){if(!self._setCoreSeriesOption(series,key,value)){self._seriesSetOption(series,key,value)}self.widget._seriesSubOpt[parentSeries.name()][series.name()][key]=value})},_setCoreSeriesOption:function(series,key,value){var templ;switch(key){case"legend":this._setLegend(series,value);return true;case"showTooltip":if(value===true){this._addTooltip(this.widget,series,this.widget.css.tooltip);if(!series.tooltipTemplate||series.tooltipTemplate()===null){this._setCoreSeriesOption(series,"tooltipTemplate","default")}}else{this._removeTooltip(this.widget,series)}return true;case"tooltipTemplate":if($.ig.tmpl){if(this._htmlCheckExpr.test(value)){templ=value}else{if($("#"+value).length>0){templ=$("#"+value).text()}else if($(value).length>0){templ=$(value).text()}else{templ=value}}this.widget._tooltipTemplates[series.name()]=templ;if(series.tooltipTemplate){series.tooltipTemplate(templ)}if(series.flattenEventArgs){series.flattenEventArgs($.proxy(this._getChartEvt,this))}}return true;case"displayType":switch(value){case"candlestick":series.displayType(0);break;case"ohlc":series.displayType(1);break;case"line":series.displayType(0);break;case"area":series.displayType(1);break;case"column":series.displayType(2);break}return true;case"tileImagery":if(value===null){series.backgroundContent(null)}this._setSeriesBackgroundContent(series,value);return true}return false},_initMap:function(){if(this.widget._duringInit){this._renderChartContainer(this.widget);this._initialDataBind();if(this.widget.dsCount===0&&this.widget._notInitialized){this._initializeWidget(this.widget)}}},_setSeriesBackgroundContent:function(series,bgOptions){var seriesOpt=this.widget._seriesOpt[series.name()];seriesOpt.tileImagery=bgOptions;switch(bgOptions.type){case"cloudMade":series.tileImagery(this._setBackgroundOptions(new $.ig.CloudMadeMapImagery,bgOptions));break;case"bing":this._initializeBingMapsImageryForSeries(series,bgOptions);break;case"openStreet":series.tileImagery(this._setBackgroundOptions(new $.ig.OpenStreetMapImagery,bgOptions));break;default:return}},_setBackgroundContent:function(bgOptions){if(!bgOptions){this._initMap()}else{this.widget.options.backgroundContent=bgOptions;switch(bgOptions.type){case"cloudMade":this.widget._chart.backgroundContent(this._setBackgroundOptions(new $.ig.CloudMadeMapImagery,bgOptions));this._initMap();break;case"bing":this._initializeBingMapsImagery(bgOptions);break;case"openStreet":this.widget._chart.backgroundContent(this._setBackgroundOptions(new $.ig.OpenStreetMapImagery,bgOptions));this._initMap();break;default:return}}},_initializeBingMapsImagery:function(bgOptions){var bingUrl=bgOptions.bingUrl||"http://dev.virtualearth.net/REST/v1/Imagery/Metadata/",imagerySet=bgOptions.imagerySet||"AerialWithLabels",bingKey=bgOptions.key;$.ajax({url:bingUrl+imagerySet,data:"key="+bingKey+"&include=ImageryProviders",success:$.proxy(this._setBingBackground,this),dataType:"jsonp",jsonp:"jsonp"})},_initializeBingMapsImageryForSeries:function(series,bgOptions){var bingUrl=bgOptions.bingUrl||"http://dev.virtualearth.net/REST/v1/Imagery/Metadata/",imagerySet=bgOptions.imagerySet||"AerialWithLabels",bingKey=bgOptions.key,self=this;$.ajax({url:bingUrl+imagerySet,data:"key="+bingKey+"&include=ImageryProviders",success:function(res){self._setBingBackgroundForSeries(series,res)},dataType:"jsonp",jsonp:"jsonp"})},_setBingBackgroundForSeries:function(series,res){var i,bg=new $.ig.BingMapsMapImagery,meta=res.resourceSets[0].resources[0],culture=this.widget.options.backgroundContent.cultureName||"en-US";bg.tilePath(meta.imageUrl);bg.cultureName(culture);if(this.widget.options.backgroundContent.downloadingImage!==undefined){bg.downloadingImage=this._getDownloadingImageHandler(this.widget.options.backgroundContent.downloadingImage)}if(this.widget.options.backgroundContent.opacity!==undefined){bg.opacity(this.widget.options.opacity)}for(i=0;i0){this._setSize(chart,size=key,v||500)}}}if(!size){this._setSize(chart,"width")}},_setSize:function(chart,key,val){$.ig.util.setSize(this.widget.element,key,val,chart,"notifyContainerResized")},_renderChartContainer:function(chart){var opt=chart.options;if(!chart._isRendered){this._chartElement.appendTo(chart.element);this._chartElement.addClass(chart.css.chart||chart.css.map);chart._chart.provideContainer(this._renderer);this._initSize(chart,opt)}},_setLegend:function(item,value){var legend;if(value!==null){value.owner=this.widget;if(value.type===undefined){value.type=this.widget.widgetName==="igPieChart"?"item":"legend"}if(item.legend()===null){if($("#"+value.element).data("igChartLegend")||value.data&&value.data("igChartLegend")){legend=!value.element?value.data("igChartLegend"):$("#"+value.element).data("igChartLegend");legend.options.owner=this.widget.options;legend._owner=this.widget}else{legend=$("#"+value.element).igChartLegend(value).data("igChartLegend")}item.legend(legend.legend)}else{$("#"+item.legend().name()).igChartLegend(value)}}else{if(item.legend()!==null&&$("#"+item.legend().name()).length>0){$("#"+item.legend().name()).igChartLegend("destroy")}}},_mergeDataSourceSettings:function(s1,s2){if(!s1){return s2}if(!s2){return s1}var source1=s1.dataSource,source2=s2.dataSource,newSettings;if(source1&&($.type(source1)==="array"||$.type(source1)==="object")){s1.dataSource=null}if(source2&&($.type(source2)==="array"||$.type(source2)==="object")){s2.dataSource=null}newSettings=$.extend(true,{},s1,s2);if(source2&&($.type(source2)==="array"||$.type(source2)==="object")){s2.dataSource=source2;newSettings.dataSource=source2}else if(source1&&($.type(source1)==="array"||$.type(source1)==="object")){s1.dataSource=source1}if(source2===null){newSettings.dataSource=null}return newSettings},_mergeIntoWithDataSource:function(o1,o2){var ds1,ds2,setToNull,s1=null,s2=null;if(o1.dataSource){ds1=o1.dataSource}if(o2.dataSource){ds2=o2.dataSource}setToNull=false;if(o2.dataSource===null){setToNull=true}if(o1.dataSource){o1.dataSource=null}if(o2.dataSource){o2.dataSource=null}$.extend(true,o1,o2);if(ds1){o1.dataSource=ds1}if(ds2){o2.dataSource=ds2;o1.dataSource=ds2}if(o1.dataSource){if(o1.dataSource&&o1.dataSource.settings){s1=o1.dataSource.settings}if(o2.dataSource&&o2.dataSource.settings){s2=o2.dataSource.settings}o1.dataSource.settings=this._mergeDataSourceSettings(s1,s2)}},_mergeIntoNewWithDataSource:function(o1,o2){var ds1,ds2,setToNull,newObj,s1=null,s2=null;if(o1.dataSource){ds1=o1.dataSource}if(o2.dataSource){ds2=o2.dataSource}setToNull=false;if(o2.dataSource===null){setToNull=true}if(o1.dataSource){o1.dataSource=null}if(o2.dataSource){o2.dataSource=null}newObj=$.extend(true,{},o1,o2);if(ds1){o1.dataSource=ds1;newObj.dataSource=ds1}if(ds2){o2.dataSource=ds2;newObj.dataSource=ds2}if(newObj.dataSource){if(o1.dataSource&&o1.dataSource.settings){s1=o1.dataSource.settings}if(o2.dataSource&&o2.dataSource.settings){s2=o2.dataSource.settings}newObj.dataSource.settings=this._mergeDataSourceSettings(s1,s2)}return newObj},_addTooltip:function(widget,series,clss){var tt,tt1,ttWrap,ttWrap1;if(typeof widget._chart.toolTip==="function"){if(widget._tooltip[widget.id()]===undefined){tt1=$('
');ttWrap1=new $.ig.JQueryDomWrapper(tt1[0],tt1);widget._tooltip[widget.id()]=tt1}this._bindTooltipEvents(widget,ttWrap1);widget._chart.toolTip(ttWrap1)}else{if(widget._tooltip[series.name()]===undefined){tt=$('
');ttWrap=new $.ig.JQueryDomWrapper(tt[0],tt);widget._tooltip[series.name()]=tt}else{tt=widget._tooltip[series.name()];ttWrap=new $.ig.JQueryDomWrapper(tt[0],tt)}this._bindTooltipEvents(widget,ttWrap);series.toolTip(ttWrap)}},_removeTooltip:function(widget,series){if(typeof widget._chart.toolTip==="function"){if(widget._tooltip[widget.id()]!==undefined){this._removeTooltipEvents(widget,widget._tooltip[widget.id()]);delete widget._tooltip[widget.id()];widget._chart.toolTip(null)}}else{if(widget._tooltip[series.name()]!==undefined){this._removeTooltipEvents(widget,widget._tooltip[series.name()]);delete widget._tooltip[series.name()];series.toolTip(null)}}},_bindTooltipEvents:function(chart,tooltip){tooltip.updateToolTip=$.ig.Delegate.prototype.combine(tooltip.updateToolTip,$.proxy(this._fireToolTipUpdateToolTip,this));tooltip.hideToolTip=$.ig.Delegate.prototype.combine(tooltip.hideToolTip,$.proxy(this._fireToolTipHideToolTip,this))},_removeTooltipEvents:function(chart,tooltip){delete tooltip.updateToolTip;delete tooltip.hideToolTip},_bindMapEvents:function(chart){chart.seriesCursorMouseMove=$.ig.Delegate.prototype.combine(chart.seriesCursorMouseMove,$.proxy(this._fireChartSeriesCursorMouseMove,this));chart.seriesMouseLeftButtonDown=$.ig.Delegate.prototype.combine(chart.seriesMouseLeftButtonDown,$.proxy(this._fireChartSeriesMouseLeftButtonDown,this));chart.seriesMouseLeftButtonUp=$.ig.Delegate.prototype.combine(chart.seriesMouseLeftButtonUp,$.proxy(this._fireChartSeriesMouseLeftButtonUp,this));chart.seriesMouseMove=$.ig.Delegate.prototype.combine(chart.seriesMouseMove,$.proxy(this._fireChartSeriesMouseMove,this));chart.seriesMouseEnter=$.ig.Delegate.prototype.combine(chart.seriesMouseEnter,$.proxy(this._fireChartSeriesMouseEnter,this));chart.seriesMouseLeave=$.ig.Delegate.prototype.combine(chart.seriesMouseLeave,$.proxy(this._fireChartSeriesMouseLeave,this));chart.windowRectChanged=$.ig.Delegate.prototype.combine(chart.windowRectChanged,$.proxy(this._fireChartWindowRectChanged,this));chart.actualWindowRectChanged=$.ig.Delegate.prototype.combine(chart.actualWindowRectChanged,$.proxy(this._fireChartActualWindowRectChanged,this));chart.gridAreaRectChanged=$.ig.Delegate.prototype.combine(chart.gridAreaRectChanged,$.proxy(this._fireChartGridAreaRectChanged,this));chart.refreshCompleted=$.ig.Delegate.prototype.combine(chart.refreshCompleted,$.proxy(this._fireChartRefreshCompleted,this));chart.imageTilesReady=$.ig.Delegate.prototype.combine(chart.imageTilesReady,$.proxy(this._fireChartImageTilesReady,this));chart.notifyCrosshairUpdate=$.ig.Delegate.prototype.combine(chart.notifyCrosshairUpdate,$.proxy(this._notifyCrosshairUpdate,this))},_bindSeriesEvents:function(series){if(series.basedOnColumns!==undefined){series.basedOnColumns($.ig.Delegate.prototype.combine(series.basedOnColumns(),$.proxy(this._fireChartBasedOnColumns,this)))}if(series.indicator!==undefined){series.indicator($.ig.Delegate.prototype.combine(series.indicator(),$.proxy(this._fireChartIndicator,this)))}if(series.typical!==undefined){series.typical=$.ig.Delegate.prototype.combine(series.typical,$.proxy(this._fireChartTypical,this))}if(series.typicalBasedOn!==undefined){series.typicalBasedOn=$.ig.Delegate.prototype.combine(series.typicalBasedOn,$.proxy(this._fireChartTypicalBasedOn,this))}if(series.triangulationStatusChanged!==undefined){series.triangulationStatusChanged=$.ig.Delegate.prototype.combine(series.triangulationStatusChanged,$.proxy(this._fireMapTriangulationStatusChanged,this))}if(series.progressiveLoadStatusChanged!==undefined){series.progressiveLoadStatusChanged=$.ig.Delegate.prototype.combine(series.progressiveLoadStatusChanged,$.proxy(this._fireChartProgressiveLoadStatusChanged,this))}if(series.assigningCategoryStyle!==undefined){series.assigningCategoryStyle=$.ig.Delegate.prototype.combine(series.assigningCategoryStyle,$.proxy(this._fireChartAssigningCategoryStyle,this))}if(series.assigningCategoryMarkerStyle!==undefined){series.assigningCategoryMarkerStyle=$.ig.Delegate.prototype.combine(series.assigningCategoryMarkerStyle,$.proxy(this._fireChartAssigningCategoryMarkerStyle,this))}},_getWidgetName:function(){switch(this.widget.widgetName){case"igPieChart":case"igDataChart":return"chart";case"igMap":return"map"}},_fireChartProgressiveLoadStatusChanged:function(sender,evtArgs){var e={},widget=this._getWidgetName(),seriesOpt=this.widget._seriesOpt[sender.name()];e.currentStatus=evtArgs.currentStatus();e[widget]=this.widget.options;e.series=seriesOpt;seriesOpt.progressiveStatus=e.currentStatus;this.widget._trigger("progressiveLoadStatusChanged",null,e)},_fireChartScatterMouseOver:function(sender,evtArgs){var e={},widget=this._getWidgetName();e[widget]=this.widget.options;e.args=evtArgs;e.series=sender;this.widget._trigger("scatterMouseOver",null,e)},_fireChartTypicalBasedOn:function(sender,evtArgs){var e={},widget=this._getWidgetName(),seriesOpt=this.widget._seriesOpt[sender.name()],i,intSeries=this.widget._series[sender.name()],self=this;e[widget]=this.widget.options;e.series=seriesOpt;e.position=evtArgs.position();e.count=evtArgs.count();e.getDataSource=function(){return self._flattenDataSource(intSeries,evtArgs.dataSource())};e.basedOn=[];e.minimumValue=evtArgs.dataSource().minimumValue();e.maximumValue=evtArgs.dataSource().maximumValue();this.widget._trigger("typicalBasedOn",null,e);if(e.basedOn!==null&&e.basedOn.length&&e.basedOn.length>0){for(i=0;i0){for(i=0;i0){typicalRet=new $.ig.List$1(Number,1,e.typicalColumn);evtArgs.dataSource().typicalColumn(new $.ig.CalculatedColumn(1,typicalRet,tBasedOn))}else{evtArgs.dataSource().typicalColumn(null)}if(!isNaN(e.minimum)){evtArgs.dataSource().minimumValue(e.minimumValue)}if(!isNaN(e.maximum)){evtArgs.dataSource().maximumValue(e.maximumValue)}},_flattenHighlightingInfo:function(info){var ret=null;if(info===null){return ret}ret={};ret.startIndex=info.startIndex();ret.endIndex=info.endIndex();switch(info.state()){case 0:ret.state="out";break;case 1:ret.state="in";break;case 2:ret.state="static";break}ret.progress=info.progress();ret.isMarker=info.isMarker();return ret},_fireChartAssigningCategoryMarkerStyle:function(sender,evtArgs){var e={},widget=this._getWidgetName(),seriesOpt=this.widget._seriesOpt[sender.name()],inFill,inStroke;if(!sender.isCustomCategoryMarkerStyleAllowed){return}e[widget]=this.widget.options;e.series=seriesOpt;e.startIndex=evtArgs.startIndex();e.endIndex=evtArgs.endIndex();e.hasDateRange=evtArgs.hasDateRange();if(e.hasDateRange){e.startDate=evtArgs.startDate();e.endDate=evtArgs.endDate()}e.getItems=$.proxy(evtArgs.getItems(),sender);e.fill=inFill=this._getValueFromBrush(evtArgs.fill());e.stroke=inStroke=this._getValueFromBrush(evtArgs.stroke());e.opacity=evtArgs.opacity();e.highlightingHandled=evtArgs.highlightingHandled();e.maxAllSeriesHighlightingProgress=evtArgs.maxAllSeriesHighlightingProgress();e.sumAllSeriesHighlightingProgress=evtArgs.sumAllSeriesHighlightingProgress();e.highlightingInfo=this._flattenHighlightingInfo(evtArgs.highlightingInfo());e.isNegativeShape=evtArgs.isNegativeShape();e.isThumbnail=evtArgs.isThumbnail();this.widget._trigger("assigningCategoryMarkerStyle",null,e);if(e.fill!==inFill){evtArgs.fill(this._createBrushFromValue(e.fill))}if(e.stroke!==inStroke){evtArgs.stroke(this._createBrushFromValue(e.stroke))}evtArgs.opacity(e.opacity);evtArgs.highlightingHandled(e.highlightingHandled)},_fireChartAssigningCategoryStyle:function(sender,evtArgs){var e={},widget=this._getWidgetName(),seriesOpt=this.widget._seriesOpt[sender.name()],inFill,inStroke,inStrokeDashArray,outStrokeDashArray,i;if(!sender.isCustomCategoryStyleAllowed){return}e[widget]=this.widget.options;e.series=seriesOpt;e.startIndex=evtArgs.startIndex();e.endIndex=evtArgs.endIndex();e.hasDateRange=evtArgs.hasDateRange();if(e.hasDateRange){e.startDate=evtArgs.startDate();e.endDate=evtArgs.endDate()}e.getItems=$.proxy(evtArgs.getItems(),sender);e.fill=inFill=this._getValueFromBrush(evtArgs.fill());e.stroke=inStroke=this._getValueFromBrush(evtArgs.stroke());e.strokeThickness=evtArgs.strokeThickness();var sda=evtArgs.strokeDashArray();if(sda!==undefined&&sda!==null){e.strokeDashArray=inStrokeDashArray=sda.toArray()}e.strokeDashCap=evtArgs.strokeDashCap();e.radiusX=evtArgs.radiusX();e.radiusY=evtArgs.radiusY();e.opacity=evtArgs.opacity();e.highlightingHandled=evtArgs.highlightingHandled(); e.maxAllSeriesHighlightingProgress=evtArgs.maxAllSeriesHighlightingProgress();e.sumAllSeriesHighlightingProgress=evtArgs.sumAllSeriesHighlightingProgress();e.highlightingInfo=this._flattenHighlightingInfo(evtArgs.highlightingInfo());e.isNegativeShape=evtArgs.isNegativeShape();e.isThumbnail=evtArgs.isThumbnail();this.widget._trigger("assigningCategoryStyle",null,e);if(e.fill!==inFill){evtArgs.fill(this._createBrushFromValue(e.fill))}if(e.stroke!==inStroke){evtArgs.stroke(this._createBrushFromValue(e.stroke))}evtArgs.strokeThickness(e.strokeThickness);if(e.strokeDashArray!==inStrokeDashArray){outStrokeDashArray=new $.ig.DoubleCollection;for(i=0;i