igniteui-webcomponents-charts
Version:
Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.
1,065 lines (1,062 loc) • 42.2 kB
JavaScript
/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { __extends, __values } from "tslib";
import { IgcAxisComponent } from './igc-axis-component';
import { IgcSeriesComponent } from './igc-series-component';
import { GridMode_$type } from './GridMode';
import { IgcSeriesViewerComponent } from './igc-series-viewer-component';
import { WebComponentRenderer, WebComponentWrapper } from "igniteui-webcomponents-core";
import { TypeRegistrar } from "igniteui-webcomponents-core";
import { XamDataChart } from './XamDataChart';
import { CollectionAdapter, brushToString, stringToBrush, ensureBool, ensureEnum, enumToString, getAllPropertyNames, toSpinal } from "igniteui-webcomponents-core";
import { Axis } from './Axis';
import { DataChartStylingDefaults } from './DataChartStylingDefaults';
import { IgcDataContext } from "igniteui-webcomponents-core";
import { IgcSeriesCollection } from './igc-series-collection';
import { SyncableObservableCollection$1 } from "igniteui-webcomponents-core";
import { NotifyCollectionChangedAction } from "igniteui-webcomponents-core";
import { IgcAxisCollection } from './igc-axis-collection';
import { AxisCollection as AxisCollection_internal } from './AxisCollection';
import { SyncLinkManager } from './SyncLinkManager';
import { SyncLink } from './SyncLink';
import { RegisterElementHelper } from "igniteui-webcomponents-core";
import { ComputedPlotAreaMarginMode_$type } from './ComputedPlotAreaMarginMode';
import { AutoMarginsAndAngleUpdateMode_$type } from './AutoMarginsAndAngleUpdateMode';
import { SeriesPlotAreaMarginHorizontalMode_$type } from './SeriesPlotAreaMarginHorizontalMode';
import { SeriesPlotAreaMarginVerticalMode_$type } from './SeriesPlotAreaMarginVerticalMode';
export var IgcDataChartComponent = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgcDataChartComponent, _super);
function IgcDataChartComponent() {
var _this = _super.call(this) || this;
_this.contentAxes = [];
_this.contentSeries = [];
/**
* The series actually present in the chart. Do not directly modify this array.
* This array's contents can be modified by causing Angular to reproject the child content.
* Or adding and removing series from the manual series collection on the series property.
*/
_this.actualSeries = [];
/**
* The axes actually present in the chart. Do not directly modify this array.
* This array's contents can be modified by causing Angular to reproject the child content.
* Or adding and removing axes from the manual axes collection on the axes property.
*/
_this.actualAxes = [];
_this._series = null;
_this._axes = null;
_this._dataSource = null;
_this._highlightedDataSource = null;
_this._axesAdapter = null;
_this._seriesAdapter = null;
_this._disconnected = false;
_this._defaultTooltips = null;
_this._fullAxes = null;
_this._renderer = new WebComponentRenderer(_this, document, true, DataChartStylingDefaults);
//this._implementation = this.createImplementation();
_this._container = _this._renderer.createElement("div");
_this._renderer.updateRoot(_this._container);
//this._renderer.rootWrapper.append(this._container);
_this._container.setStyleProperty("display", "block");
_this._container.setStyleProperty("width", "100%");
_this._container.setStyleProperty("height", "100%");
var root;
root = _this._container;
if (_this._container.nativeElement != null) {
root = _this._container.nativeElement;
}
_this._wrapper = _this._renderer;
var chart = _this.i;
_this._chart = chart;
_this._axesAdapter = new CollectionAdapter(_this.contentAxes, _this.i.axes, _this.actualAxes, function (c) { return c.i; }, function (i) {
i._provideRenderer(_this._wrapper);
i.provideData(_this._dataSource);
for (var j = 0; j < _this.actualSeries.length; j++) {
_this.actualSeries[j].bindAxes(_this.actualAxes);
}
for (var j = 0; j < _this.actualAxes.length; j++) {
_this.actualAxes[j].bindAxes(_this.actualAxes);
}
if (_this.parentElement) {
i._styling(_this, _this, _this);
}
}, function (i) { i._provideRenderer(null); i.provideData(null); });
_this._seriesAdapter = new CollectionAdapter(_this.contentSeries, _this.i.series, _this.actualSeries, function (c) { return c.i; }, function (i) {
i.owner = _this;
i._provideRenderer(_this._dataSource);
i.provideData(_this._dataSource);
i.provideHighlightedData(_this._highlightedDataSource);
i.bindAxes(_this.actualAxes);
for (var j = 0; j < _this.actualSeries.length; j++) {
_this.actualSeries[j].bindSeries(_this.actualSeries);
}
if (_this.parentElement) {
i._styling(_this, _this, _this);
}
_this._ensureDefaultTooltip(i);
_this._ensureTooltipCreated(i);
}, function (i) { i._provideRenderer(null); i.provideData(null); });
chart.provideContainer(_this._renderer);
var mut = new MutationObserver(function (list) {
var e_1, _b;
try {
for (var list_1 = __values(list), list_1_1 = list_1.next(); !list_1_1.done; list_1_1 = list_1.next()) {
var mutation = list_1_1.value;
if (mutation.type == 'childList') {
_this.updateContentChildren();
}
}
}
catch (e_1_1) {
e_1 = { error: e_1_1 };
}
finally {
try {
if (list_1_1 && !list_1_1.done && (_b = list_1.return))
_b.call(list_1);
}
finally {
if (e_1)
throw e_1.error;
}
}
});
mut.observe(_this, {
childList: true
});
_this._renderer.addSizeWatcher(function () {
_this.notifyContainerResized();
});
return _this;
}
Object.defineProperty(IgcDataChartComponent.prototype, "height", {
get: function () {
return this._height;
},
set: function (value) {
this._height = value;
this.style.height = value;
this.notifyContainerResized();
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent.prototype, "width", {
get: function () {
return this._width;
},
set: function (value) {
this._width = value;
this.style.width = value;
this.notifyContainerResized();
},
enumerable: false,
configurable: true
});
IgcDataChartComponent.prototype.notifyContainerResized = function () {
this._chart.notifyContainerResized();
};
Object.defineProperty(IgcDataChartComponent.prototype, "legend", {
/**
* Gets or sets the legend used for the current chart.
*/
get: function () {
if (this.i.legend != null)
return this.i.legend.externalObject;
},
set: function (v) {
if (v != undefined && v != null)
this.i.legend = v.i;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent.prototype, "series", {
/**
* A collection or manually added series for the chart.
*/
get: function () {
var _this = this;
if (this._series === null) {
var coll = new IgcSeriesCollection();
var inner = coll._innerColl;
inner.addListener(function (sender, e) {
switch (e.action) {
case NotifyCollectionChangedAction.Add:
_this._seriesAdapter.insertManualItem(e.newStartingIndex, e.newItems.item(0));
break;
case NotifyCollectionChangedAction.Remove:
_this._seriesAdapter.removeManualItemAt(e.oldStartingIndex);
break;
case NotifyCollectionChangedAction.Replace:
_this._seriesAdapter.removeManualItemAt(e.oldStartingIndex);
_this._seriesAdapter.insertManualItem(e.newStartingIndex, e.newItems.item(0));
break;
case NotifyCollectionChangedAction.Reset:
_this._seriesAdapter.clearManualItems();
break;
}
});
this._series = coll;
}
return this._series;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent.prototype, "axes", {
/**
* A collection or manually added axes for the chart.
*/
get: function () {
var _this = this;
if (this._axes === null) {
var coll = new IgcAxisCollection();
var inner = coll._innerColl;
inner.addListener(function (sender, e) {
switch (e.action) {
case NotifyCollectionChangedAction.Add:
_this._axesAdapter.insertManualItem(e.newStartingIndex, e.newItems.item(0));
break;
case NotifyCollectionChangedAction.Remove:
_this._axesAdapter.removeManualItemAt(e.oldStartingIndex);
break;
case NotifyCollectionChangedAction.Replace:
_this._axesAdapter.removeManualItemAt(e.oldStartingIndex);
_this._axesAdapter.insertManualItem(e.newStartingIndex, e.newItems.item(0));
break;
case NotifyCollectionChangedAction.Reset:
_this._axesAdapter.clearManualItems();
break;
}
});
this._axes = coll;
}
return this._axes;
},
enumerable: false,
configurable: true
});
IgcDataChartComponent.prototype.destroy = function () {
this._chart.destroy();
this._wrapper.destroy();
};
IgcDataChartComponent.prototype.createImplementation = function () {
return new XamDataChart();
};
Object.defineProperty(IgcDataChartComponent.prototype, "dataSource", {
get: function () {
return this._dataSource;
},
set: function (value) {
this._dataSource = value;
this.bindData();
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent.prototype, "highlightedDataSource", {
get: function () {
return this._highlightedDataSource;
},
set: function (value) {
this._highlightedDataSource = value;
this.bindHighlightedData();
},
enumerable: false,
configurable: true
});
IgcDataChartComponent.prototype.bindData = function () {
//console.log("binding data: " + this._dataSource);
if (this.actualAxes && this.actualAxes.length > 0) {
var currAxes = this.actualAxes;
for (var i = 0; i < currAxes.length; i++) {
currAxes[i].provideData(this._dataSource);
}
}
if (this.actualSeries && this.actualSeries.length > 0) {
var currSeries = this.actualSeries;
for (var i = 0; i < currSeries.length; i++) {
currSeries[i].provideData(this._dataSource);
}
}
};
IgcDataChartComponent.prototype.bindHighlightedData = function () {
if (this.actualSeries && this.actualSeries.length > 0) {
var currSeries = this.actualSeries;
for (var i = 0; i < currSeries.length; i++) {
currSeries[i].provideHighlightedData(this._highlightedDataSource);
}
}
};
IgcDataChartComponent.prototype.updateContentChildren = function () {
this.contentAxes.length = 0;
this.contentSeries.length = 0;
for (var i = 0; i < this.children.length; i++) {
if (this.children[i] instanceof IgcAxisComponent) {
this.contentAxes.push(this.children[i]);
}
}
for (var i = 0; i < this.children.length; i++) {
if (this.children[i] instanceof IgcSeriesComponent) {
this.contentSeries.push(this.children[i]);
}
}
if (this._axesAdapter != null) {
this._axesAdapter.notifyContentChanged();
}
if (this._seriesAdapter != null) {
this._seriesAdapter.notifyContentChanged();
}
};
IgcDataChartComponent.prototype.disconnectedCallback = function () {
this._disconnected = true;
if (this.i) {
this.i.onDetachedFromUI();
}
};
IgcDataChartComponent.prototype.connectedCallback = function () {
if (this._disconnected) {
this._disconnected = false;
if (this.i) {
this.i.onAttachedToUI();
}
return;
}
this.classList.add("ig-data-chart");
this.classList.add("igc-data-chart");
this.appendChild(this._renderer.rootWrapper.getNativeElement());
this._attached = true;
this.style.display = "block";
this.style.height = this._height;
this.style.width = this._width;
this._flushQueuedAttributes();
// supports themes or custom properties set in CSS
this._styling(this, this);
this.updateContentChildren();
for (var i = 0; i < this.actualAxes.length; i++) {
var a = this.actualAxes[i];
a._styling(this, this, this);
}
for (var i = 0; i < this.actualSeries.length; i++) {
var s = this.actualSeries[i];
s._styling(this, this, this);
}
this.afterContentInit();
};
IgcDataChartComponent.prototype.afterContentInit = function () {
if (TypeRegistrar.isRegistered("IgcDataChartDefaultTooltipsComponent")) {
var cr = TypeRegistrar.create("IgcDataChartDefaultTooltipsComponent");
//let cr = cf.create(this._injector);
this._defaultTooltips = cr;
//(<any>cr).onContentReady = () => {
// this._onDefaultTooltipsReady(cr);
//};
this._onDefaultTooltipsReady(cr);
//this._container.appendChild(cr.location.nativeElement);
}
this.i.notifyContainerResized();
};
IgcDataChartComponent.prototype._ensureTooltipCreated = function (series) {
var _this = this;
series._ensureTooltipCreated(function () { return _this.createTooltip(); }, function (ele) {
var wrapper = new WebComponentWrapper(ele, _this._renderer);
wrapper.updateToolTip = ele.updateToolTip;
wrapper.hideToolTip = ele.hideToolTip;
return wrapper;
});
};
IgcDataChartComponent.prototype._ensureDefaultTooltip = function (series) {
if (this._defaultTooltips == null) {
return;
}
this._defaultTooltips["ensureDefaultTooltip"](series);
};
IgcDataChartComponent.prototype._onDefaultTooltipsReady = function (cr) {
if (this.actualSeries && this.actualSeries.length > 0) {
var currSeries = this.actualSeries;
for (var i = 0; i < currSeries.length; i++) {
if (currSeries[i].showDefaultTooltip) {
this._ensureDefaultTooltip(currSeries[i]);
}
}
}
};
IgcDataChartComponent.prototype.createTooltip = function () {
if (!TypeRegistrar.isRegistered("IgcTooltipContainerComponent")) {
return null;
}
var cr = TypeRegistrar.create("IgcTooltipContainerComponent");
var ele = cr;
var self = this;
ele.updateToolTip = function (c, isSubContent) {
if (c.externalObject) {
c = c.externalObject;
}
else {
var ext = new IgcDataContext();
ext._implementation = c;
c = ext;
}
if (!isSubContent) {
ele.removeAttribute("popover");
//attach tooltip to chart container
if (c.series != null && !c.series.attachTooltipToRoot) {
if (ele.parentElement != self._container.getNativeElement()) {
if (ele.parentElement != null) {
ele.parentElement.removeChild(ele);
}
self._container.getNativeElement().appendChild(ele);
}
}
//attach tooltip to body
else {
this.remove();
this.renderer.appendToBody(this);
var supportsPopover = HTMLElement.prototype.hasOwnProperty("popover");
if (supportsPopover) {
ele.setAttribute("popover", "manual");
ele.showPopover();
}
}
}
else {
c.isSubContent = true;
}
cr.context = c;
ele.style.display = "block";
return true;
};
ele.hideToolTip = function () {
if (ele.hasAttribute("popover"))
ele.hidePopover();
ele.style.display = "none";
};
ele.style.display = "none";
return cr;
};
Object.defineProperty(IgcDataChartComponent.prototype, "syncChannel", {
/**
* Gets or sets the channel with which to synchronize.
*
* Synchronization is the coordination of zooming, panning and crosshairs events between multiple charts. Multiple chart controls can be synchronized horizontally (along X-Axis), vertically (along Y-Axis), or both. If you want to synchronize a set of charts, assign them the same name to the `syncChannel` and then specify whether or not synchronize chart horizontally and/or vertically.
*/
get: function () {
return this.i.syncChannel;
},
set: function (v) {
var newLink = null;
if (v && v.length > 0) {
newLink = SyncLinkManager.instance().getLink(v);
}
var oldLink = this.i.actualSyncLink;
if (oldLink) {
SyncLinkManager.instance().releaseLink(oldLink);
}
if (newLink) {
this.i.actualSyncLink = newLink;
}
else {
this.i.actualSyncLink = new SyncLink();
}
this.i.syncChannel = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent.prototype, "synchronizeVertically", {
/**
* Gets or sets the bool used to display the window preview shadow.
*
* Synchronization is the coordination of zooming, panning and crosshairs events between multiple charts. Multiple chart controls can be synchronized horizontally (along X-Axis), vertically (along Y-Axis), or both. If you want to synchronize a set of charts, assign them the same name to the `syncChannel` and then specify whether or not synchronize chart horizontally and/or vertically.
*/
get: function () {
return this.i.syncSettings ? this.i.syncSettings.synchronizeVertically : false;
},
set: function (v) {
this.i.syncSettings.synchronizeVertically = ensureBool(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent.prototype, "synchronizeHorizontally", {
/**
* Gets or sets the bool used to display the window preview shadow.
*
* Synchronization is the coordination of zooming, panning and crosshairs events between multiple charts. Multiple chart controls can be synchronized horizontally (along X-Axis), vertically (along Y-Axis), or both. If you want to synchronize a set of charts, assign them the same name to the `syncChannel` and then specify whether or not synchronize chart horizontally and/or vertically.
*/
get: function () {
return this.i.syncSettings ? this.i.syncSettings.synchronizeHorizontally : false;
},
set: function (v) {
this.i.syncSettings.synchronizeHorizontally = ensureBool(v);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent, "observedAttributes", {
get: function () {
if (IgcDataChartComponent._observedAttributesIgcDataChartComponent == null) {
var names = getAllPropertyNames(IgcDataChartComponent);
for (var i = 0; i < names.length; i++) {
names[i] = toSpinal(names[i]);
}
IgcDataChartComponent._observedAttributesIgcDataChartComponent = names;
}
return IgcDataChartComponent._observedAttributesIgcDataChartComponent;
},
enumerable: false,
configurable: true
});
IgcDataChartComponent.register = function () {
if (!IgcDataChartComponent._isElementRegistered) {
IgcDataChartComponent._isElementRegistered = true;
RegisterElementHelper.registerElement(IgcDataChartComponent.htmlTagName, IgcDataChartComponent);
}
};
Object.defineProperty(IgcDataChartComponent.prototype, "isSquare", {
/**
* Gets or sets whether to use a square aspect ratio for the chart. This is locked to true for polar and radial charts.
*
* Set `IsSquare` to true to constrain the chart to a square, using the minimum of its height and width.
*
* ```ts
* this.chart.isSquare="True";
* ```
*/
get: function () {
return this.i.aag;
},
set: function (v) {
this.i.aag = ensureBool(v);
this._a("isSquare", this.i.aag);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent.prototype, "windowScaleHorizontal", {
/**
* A number between 0 and 1 determining the scale of the horizontal zoom.
* This property is effectively a shortcut to the Width of the WindowRect property.
*
* To programmatically change the horizontal zoom level, set `WindowScaleHorizontal` to a value between 0 and 1.
*
* ```ts
* this.chart.windowScaleHorizontal="0.75";
* ```
*/
get: function () {
return this.i.abp;
},
set: function (v) {
this.i.abp = +v;
this._a("windowScaleHorizontal", this.i.abp);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent.prototype, "windowScaleVertical", {
/**
* A number between 0 and 1 determining the scale of the vertical zoom.
* This property is effectively a shortcut to the Height of the WindowRect property.
*
* To programmatically change the vertical zoom level, set `WindowScaleVertical` to a value between 0 and 1.
*
* ```ts
* this.chart.windowScaleVertical="0.75";
* ```
*/
get: function () {
return this.i.abq;
},
set: function (v) {
this.i.abq = +v;
this._a("windowScaleVertical", this.i.abq);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent.prototype, "actualWindowScaleHorizontal", {
/**
* A number between 0 and 1 determining the scale of the horizontal zoom.
* This property is effectively a shortcut to the Width of the ActualWindowRect property.
*/
get: function () {
return this.i.aba;
},
set: function (v) {
this.i.aba = +v;
this._a("actualWindowScaleHorizontal", this.i.aba);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent.prototype, "actualWindowScaleVertical", {
/**
* A number between 0 and 1 determining the scale of the vertical zoom.
* This property is effectively a shortcut to the Height of the ActualWindowRect property.
*/
get: function () {
return this.i.abb;
},
set: function (v) {
this.i.abb = +v;
this._a("actualWindowScaleVertical", this.i.abb);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent.prototype, "isHorizontalZoomEnabled", {
/**
* Gets or sets horizontal zoomability of the current control
*
* Set `IsHorizontalZoomEnabled` to enable or disable horizontal zooming.
*
* ```ts
* this.chart.IsHorizontalZoomEnabled= true;
* ```
*/
get: function () {
return this.i.aae;
},
set: function (v) {
this.i.aae = ensureBool(v);
this._a("isHorizontalZoomEnabled", this.i.aae);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent.prototype, "isVerticalZoomEnabled", {
/**
* Gets or sets vertical zoomability of the current control
*
* Set `IsVerticalZoomEnabled` to enable or disable vertical zooming.
*
* ```ts
* this.chart.isVerticalZoomEnabled="True";
* ```
*/
get: function () {
return this.i.aai;
},
set: function (v) {
this.i.aai = ensureBool(v);
this._a("isVerticalZoomEnabled", this.i.aai);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent.prototype, "gridMode", {
/**
* Gets or sets how grid lines are rendered in relation to series.
*
* Try setting the `GridMode` property to bring your grid lines in front of the data series.
*/
get: function () {
return this.i.zu;
},
set: function (v) {
this.i.zu = ensureEnum(GridMode_$type, v);
this._a("gridMode", enumToString(GridMode_$type, this.i.zu));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent.prototype, "alignsGridLinesToPixels", {
/**
* Gets or sets a value indicating whether grid and tick lines are aligned to device pixels.
*/
get: function () {
return this.i.aaa;
},
set: function (v) {
this.i.aaa = ensureBool(v);
this._a("alignsGridLinesToPixels", this.i.aaa);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent.prototype, "autoExpandMarginMaximumValue", {
/**
* Gets or sets the maximum amount the series viewer should auto expand margins to accomodate the initial horizontal axis labels.
*/
get: function () {
return this.i.abd;
},
set: function (v) {
this.i.abd = +v;
this._a("autoExpandMarginMaximumValue", this.i.abd);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent.prototype, "autoExpandMarginExtraPadding", {
/**
* Gets or sets the extra amount the series viewer should auto expand margins to accomodate the initial horizontal axis labels.
*/
get: function () {
return this.i.abc;
},
set: function (v) {
this.i.abc = +v;
this._a("autoExpandMarginExtraPadding", this.i.abc);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent.prototype, "shouldSuppressAxisLabelTruncation", {
/**
* Gets or sets a whether the series viewer should suppress truncation of axis labels.
*/
get: function () {
return this.i.aap;
},
set: function (v) {
this.i.aap = ensureBool(v);
this._a("shouldSuppressAxisLabelTruncation", this.i.aap);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent.prototype, "shouldAutoExpandMarginForInitialLabels", {
/**
* Gets or sets a whether the series viewer should auto expand margins to accomodate the initial horizontal axis labels.
*/
get: function () {
return this.i.aal;
},
set: function (v) {
this.i.aal = ensureBool(v);
this._a("shouldAutoExpandMarginForInitialLabels", this.i.aal);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent.prototype, "shouldConsiderAutoRotationForInitialLabels", {
/**
* Gets or sets a whether the series viewer should consider auto rotating labels to fit them in the initial view. This implies that ShouldAutoExpandMarginForInitialLabels is true.
*/
get: function () {
return this.i.aao;
},
set: function (v) {
this.i.aao = ensureBool(v);
this._a("shouldConsiderAutoRotationForInitialLabels", this.i.aao);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent.prototype, "suppressAutoMarginAndAngleRecalculation", {
/**
* Gets or sets a whether the series viewer should suppress auto recalculating margin and axis label angles.
*/
get: function () {
return this.i.aaq;
},
set: function (v) {
this.i.aaq = ensureBool(v);
this._a("suppressAutoMarginAndAngleRecalculation", this.i.aaq);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent.prototype, "autoMarginAndAngleUpdateMode", {
/**
* Gets or sets a whether the series viewer should consider auto rotating labels to fit them in the initial view. This implies that ShouldAutoExpandMarginForInitialLabels is true.
*/
get: function () {
return this.i.zg;
},
set: function (v) {
this.i.zg = ensureEnum(AutoMarginsAndAngleUpdateMode_$type, v);
this._a("autoMarginAndAngleUpdateMode", enumToString(AutoMarginsAndAngleUpdateMode_$type, this.i.zg));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent.prototype, "defaultAxisStroke", {
/**
* Gets or sets the DefaultAxisStroke property.
* The DefaultAxisStroke property defines the brush which is used by the axes when no
* Axis.Stroke is set.
*/
get: function () {
return brushToString(this.i.adv);
},
set: function (v) {
this.i.adv = stringToBrush(v);
this._a("defaultAxisStroke", brushToString(this.i.adv));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent.prototype, "defaultAxisMajorStroke", {
/**
* Gets or sets the DefaultAxisMajorStroke property.
* The DefaultAxisMajorStroke property defines the brush which is used by the axes when no
* Axis.MajorStroke is set.
*/
get: function () {
return brushToString(this.i.adt);
},
set: function (v) {
this.i.adt = stringToBrush(v);
this._a("defaultAxisMajorStroke", brushToString(this.i.adt));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent.prototype, "defaultAxisMinorStroke", {
/**
* Gets or sets the DefaultAxisMinorStroke property.
* The DefaultAxisMinorStroke property defines the brush which is used by the axes when no
* Axis.MinorStroke is set.
*/
get: function () {
return brushToString(this.i.adu);
},
set: function (v) {
this.i.adu = stringToBrush(v);
this._a("defaultAxisMinorStroke", brushToString(this.i.adu));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent.prototype, "fullAxes", {
get: function () {
if (this._fullAxes === null) {
var coll = new IgcAxisCollection();
var innerColl = this.i.zq;
if (!innerColl) {
innerColl = new AxisCollection_internal();
}
this._fullAxes = coll._fromInner(innerColl);
}
return this._fullAxes;
},
set: function (v) {
if (this._fullAxes !== null) {
this._fullAxes._setSyncTarget(null);
this._fullAxes = null;
}
var coll = new IgcAxisCollection();
this._fullAxes = coll._fromOuter(v);
var syncColl = new SyncableObservableCollection$1(Axis.$type);
var innerColl = this.i.zq;
if (!innerColl) {
innerColl = new AxisCollection_internal();
}
syncColl._inner = innerColl;
syncColl.clear();
this._fullAxes._setSyncTarget(syncColl);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent.prototype, "actualPlotAreaMarginLeft", {
/**
* Gets the actual resolved left plot area margin;
*/
get: function () {
return this.i.aa7;
},
set: function (v) {
this.i.aa7 = +v;
this._a("actualPlotAreaMarginLeft", this.i.aa7);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent.prototype, "actualPlotAreaMarginTop", {
/**
* Gets the actual resolved top plot area margin;
*/
get: function () {
return this.i.aa9;
},
set: function (v) {
this.i.aa9 = +v;
this._a("actualPlotAreaMarginTop", this.i.aa9);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent.prototype, "actualPlotAreaMarginRight", {
/**
* Gets the actual resolved right plot area margin;
*/
get: function () {
return this.i.aa8;
},
set: function (v) {
this.i.aa8 = +v;
this._a("actualPlotAreaMarginRight", this.i.aa8);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent.prototype, "actualPlotAreaMarginBottom", {
/**
* Gets the actual resolved bottom plot area margin;
*/
get: function () {
return this.i.aa6;
},
set: function (v) {
this.i.aa6 = +v;
this._a("actualPlotAreaMarginBottom", this.i.aa6);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent.prototype, "computedPlotAreaMarginMode", {
/**
* Gets or sets mode to use for automatically calculating the plot area margin.
*/
get: function () {
return this.i.zr;
},
set: function (v) {
this.i.zr = ensureEnum(ComputedPlotAreaMarginMode_$type, v);
this._a("computedPlotAreaMarginMode", enumToString(ComputedPlotAreaMarginMode_$type, this.i.zr));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent.prototype, "seriesPlotAreaMarginHorizontalMode", {
/**
* Gets or sets horizontal mode to use for automatically calculating the plot area margin based ont the series.
*/
get: function () {
return this.i.zz;
},
set: function (v) {
this.i.zz = ensureEnum(SeriesPlotAreaMarginHorizontalMode_$type, v);
this._a("seriesPlotAreaMarginHorizontalMode", enumToString(SeriesPlotAreaMarginHorizontalMode_$type, this.i.zz));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent.prototype, "seriesPlotAreaMarginVerticalMode", {
/**
* Gets or sets vertical mode to use for automatically calculating the plot area margin based ont the series.
*/
get: function () {
return this.i.z2;
},
set: function (v) {
this.i.z2 = ensureEnum(SeriesPlotAreaMarginVerticalMode_$type, v);
this._a("seriesPlotAreaMarginVerticalMode", enumToString(SeriesPlotAreaMarginVerticalMode_$type, this.i.z2));
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent.prototype, "plotAreaMarginLeft", {
/**
* Margin applied to the left of the plot area.
*/
get: function () {
return this.i.abl;
},
set: function (v) {
this.i.abl = +v;
this._a("plotAreaMarginLeft", this.i.abl);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent.prototype, "plotAreaMarginTop", {
/**
* Margin applied above the plot area.
*/
get: function () {
return this.i.abn;
},
set: function (v) {
this.i.abn = +v;
this._a("plotAreaMarginTop", this.i.abn);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent.prototype, "plotAreaMarginRight", {
/**
* Margin applied to the right of the plot area.
*/
get: function () {
return this.i.abm;
},
set: function (v) {
this.i.abm = +v;
this._a("plotAreaMarginRight", this.i.abm);
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgcDataChartComponent.prototype, "plotAreaMarginBottom", {
/**
* Margin applied below the plot area.
*/
get: function () {
return this.i.abk;
},
set: function (v) {
this.i.abk = +v;
this._a("plotAreaMarginBottom", this.i.abk);
},
enumerable: false,
configurable: true
});
IgcDataChartComponent.prototype.findByName = function (name) {
var baseResult = _super.prototype.findByName.call(this, name);
if (baseResult) {
return baseResult;
}
if (this.axes != null && this.axes.findByName && this.axes.findByName(name)) {
return this.axes.findByName(name);
}
if (this.fullAxes != null && this.fullAxes.findByName && this.fullAxes.findByName(name)) {
return this.fullAxes.findByName(name);
}
return null;
};
IgcDataChartComponent.prototype.refreshComputedPlotAreaMargin = function () {
this.i.ac1();
};
IgcDataChartComponent.prototype.recalculateMarginAutoExpansion = function () {
this.i.ac0();
};
IgcDataChartComponent.prototype.recalculateAutoLabelsAngle = function () {
this.i.acz();
};
/**
* Notifies the chart that the CSS styles in effect have been updated.
*/
IgcDataChartComponent.prototype.styleUpdated = function () {
this.i.ac2();
};
/**
* Export serialized visual data.
*/
IgcDataChartComponent.prototype.exportSerializedVisualData = function () {
var iv = this.i.ab7();
return (iv);
};
IgcDataChartComponent._observedAttributesIgcDataChartComponent = null;
IgcDataChartComponent.htmlTagName = "igc-data-chart";
IgcDataChartComponent._isElementRegistered = false;
return IgcDataChartComponent;
}(IgcSeriesViewerComponent));