igniteui-webcomponents-charts
Version:
Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.
1,107 lines • 64.5 kB
JavaScript
import { WebComponentRenderer, WebComponentWrapper } from "igniteui-webcomponents-core";
import { TypeRegistrar } from "igniteui-webcomponents-core";
import { FinancialChart } from './FinancialChart';
import { FinancialChartType_$type } from './FinancialChartType';
import { fromBrushCollection, toBrushCollection, ensureEnum, ensureBool, NamePatcher, enumToString, brushCollectionToString, getAllPropertyNames, toSpinal, brushToString, stringToBrush } from "igniteui-webcomponents-core";
import { IgcXYChartComponent } from './igc-xy-chart-component';
import { DataChartStylingDefaults } from './DataChartStylingDefaults';
import { DataSeriesType } from "igniteui-webcomponents-core";
import { IgcDataContext } from "igniteui-webcomponents-core";
import { FinancialChartVolumeType_$type } from './FinancialChartVolumeType';
import { FinancialChartXAxisMode, FinancialChartXAxisMode_$type } from './FinancialChartXAxisMode';
import { FinancialChartYAxisMode, FinancialChartYAxisMode_$type } from './FinancialChartYAxisMode';
import { HorizontalAlignment_$type } from "igniteui-webcomponents-core";
import { FinancialChartZoomSliderType_$type } from './FinancialChartZoomSliderType';
import { IgcFinancialChartDefaultTemplatesComponent } from './igc-financial-chart-default-templates-component';
import { delegateCombine, delegateRemove } from "igniteui-webcomponents-core";
import { IgcFinancialIndicatorTypeCollection } from './igc-financial-indicator-type-collection';
import { FinancialIndicatorTypeCollection as FinancialIndicatorTypeCollection_internal } from './FinancialIndicatorTypeCollection';
import { SyncableObservableCollection$1 } from "igniteui-webcomponents-core";
import { FinancialIndicatorType_$type } from './FinancialIndicatorType';
import { IgcFinancialOverlayTypeCollection } from './igc-financial-overlay-type-collection';
import { FinancialOverlayTypeCollection as FinancialOverlayTypeCollection_internal } from './FinancialOverlayTypeCollection';
import { FinancialOverlayType_$type } from './FinancialOverlayType';
import { IgcIndicatorDisplayTypeCollection } from './igc-indicator-display-type-collection';
import { IndicatorDisplayTypeCollection as IndicatorDisplayTypeCollection_internal } from './IndicatorDisplayTypeCollection';
import { IndicatorDisplayType_$type } from './IndicatorDisplayType';
import { IgcFinancialChartRangeSelectorOptionCollection } from './igc-financial-chart-range-selector-option-collection';
import { FinancialChartRangeSelectorOptionCollection as FinancialChartRangeSelectorOptionCollection_internal } from './FinancialChartRangeSelectorOptionCollection';
import { FinancialChartRangeSelectorOption_$type } from './FinancialChartRangeSelectorOption';
import { IgcFinancialChartCustomIndicatorArgs } from './igc-financial-chart-custom-indicator-args';
import { CustomIndicatorNameCollection as CustomIndicatorNameCollection_internal } from './CustomIndicatorNameCollection';
import { IgcCustomIndicatorNameCollection } from './igc-custom-indicator-name-collection';
import { String_$type } from "igniteui-webcomponents-core";
import { RegisterElementHelper } from "igniteui-webcomponents-core";
let fg = window && window.CSS && window.CSS.supports &&
/*@__PURE__*/ window.CSS.supports("display", "grid");
let financialChartToolbarStyle = {
gridRow: 1,
msGridRow: 1
};
let financialChartPriceStyle = {
gridRow: 3,
msGridRow: 3
};
let financialChartIndicatorsStyle = {
gridRow: 4,
msGridRow: 4
};
let financialChartVolumeStyle = {
gridRow: 5,
msGridRow: 5
};
let financialChartZoomSliderStyle = {
gridRow: 6,
msGridRow: 6
};
let financialChartMainGridStyle = {
height: '100%',
width: '100%',
textAlign: 'left',
display: fg ? 'grid' : '-ms-grid',
msGridColumns: '100%'
};
let financialChartLegendStyle = {
gridRow: 2,
msGridRow: 2
};
export let IgcFinancialChartComponent = /*@__PURE__*/ (() => {
class IgcFinancialChartComponent extends IgcXYChartComponent {
set height(value) {
this._height = value;
this.style.height = value;
this.notifyResized();
}
get height() {
return this._height;
}
set width(value) {
this._width = value;
this.style.width = value;
this.notifyResized();
}
get width() {
return this._width;
}
get rangeSelectorTemplate() {
return this._rangeSelectorTemplate;
}
set rangeSelectorTemplate(value) {
this._rangeSelectorTemplate = value;
}
get chartTypePickerTemplate() {
return this._chartTypePickerTemplate;
}
set chartTypePickerTemplate(value) {
this._chartTypePickerTemplate = value;
}
get indicatorMenuTemplate() {
return this._indicatorMenuTemplate;
}
set indicatorMenuTemplate(value) {
this._indicatorMenuTemplate = value;
}
get toolbarTemplate() {
return this._toolbarTemplate;
}
set toolbarTemplate(value) {
this._toolbarTemplate = value;
}
get chartTemplate() {
return this._chartTemplate;
}
set chartTemplate(value) {
this._chartTemplate = value;
}
constructor() {
super();
this._wrapper = null;
this._initialized = false;
this._toolbarElement = null;
this._renderer = null;
this._disconnected = false;
this._dataSource = null;
this._defaultTooltips = null;
this._dynamicContent = {};
this._xAxisBreaks = null;
this._indicatorTypes = null;
this._overlayTypes = null;
this._indicatorDisplayTypes = null;
this._rangeSelectorOptions = null;
this._customIndicatorNames = null;
this._applyCustomIndicators = null;
this._applyCustomIndicators_wrapped = null;
if (this._styling) {
NamePatcher.ensureStylablePatched(Object.getPrototypeOf(this));
}
this.onDocumentClick = this.onDocumentClick.bind(this);
if (document) {
document.addEventListener("click", this.onDocumentClick);
}
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 != null) {
root = this._container;
}
this._wrapper = this._renderer;
var chart = this.i;
this._chart = chart;
if (chart.xAxis) {
this.rewrapAxis(chart.xAxis);
}
if (chart.yAxis) {
this.rewrapAxis(chart.yAxis);
}
if (chart.volumeAxis) {
this.rewrapAxis(chart.volumeAxis);
}
if (chart.volumeXAxis) {
this.rewrapAxis(chart.volumeXAxis);
}
if (chart.indicatorAxis) {
this.rewrapAxis(chart.indicatorAxis);
}
if (chart.indicatorXAxis) {
this.rewrapAxis(chart.indicatorXAxis);
}
if (chart.zoomSliderAxis) {
this.rewrapAxis(chart.zoomSliderAxis);
}
if (chart.zoomSliderXAxis) {
this.rewrapAxis(chart.zoomSliderXAxis);
}
chart.provideContainer(this._renderer);
this.bindData();
chart.notifyResized();
this._renderer.addSizeWatcher(() => {
this._checkToolbarSize();
this._chart.notifyResized();
});
this._initialized = true;
}
destroy() {
this._chart.destroy();
this._wrapper.destroy();
if (document) {
document.removeEventListener("click", this.onDocumentClick);
}
}
disconnectedCallback() {
this._disconnected = true;
if (this.i) {
this.i.onDetachedFromUI();
}
}
connectedCallback() {
if (this._disconnected) {
this._disconnected = false;
if (this.i) {
this.i.onAttachedToUI();
}
return;
}
this.classList.add("ig-financial-chart");
this.classList.add("igc-financial-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.afterContentInit();
}
afterContentInit() {
this.initializeContent();
}
_checkToolbarSize() {
if (this._toolbarElement) {
let start = this._toolbarElement;
if (start.children.length == 1) {
start = start.children[0];
}
if (start.children.length == 1) {
start = start.children[0];
}
let toolbarRoot = start.querySelector(".financialChartToolbar");
let rootRect = toolbarRoot.getBoundingClientRect();
let hideRemaining = false;
for (let i = 0; i < toolbarRoot.children.length; i++) {
let child = toolbarRoot.children[i];
if (child.nodeType == Node.ELEMENT_NODE) {
if (!hideRemaining) {
child.style.display = "";
}
let childRect = child.getBoundingClientRect();
if (hideRemaining ||
childRect.left + childRect.width >
rootRect.left + rootRect.width) {
child.style.display = "none";
hideRemaining = true;
}
else {
child.style.display = "";
}
}
}
}
}
onDocumentClick(ev) {
this._chart.onDocumentClick(ev);
}
rewrapAxis(axis) {
let axisName = axis.$type.name;
let componentName = "Igc" + axisName + "Component";
if (TypeRegistrar.isRegistered(componentName)) {
let x = TypeRegistrar.create(componentName);
x._implementation = axis;
axis.externalObject = x;
}
else {
throw new Error("Axis type not loaded: " + componentName);
}
}
createImplementation() {
return new FinancialChart();
}
get i() {
return this._implementation;
}
createSeriesComponent(type) {
if (TypeRegistrar.isRegistered(type)) {
let s = TypeRegistrar.create(type);
s.owner = this;
return s;
}
else {
//we shouldn't get here, hopefully.
throw Error("series type not loaded: " + type);
}
}
createIndicator(typeName) {
return this.createSeriesComponent("Igc" + typeName + "Component");
}
createOverlay(typeName) {
return this.createSeriesComponent("Igc" + typeName + "Component");
}
createSeries(type) {
switch (type) {
case DataSeriesType.Area:
return this.createSeriesComponent('IgcAreaSeriesComponent');
case DataSeriesType.Column:
return this.createSeriesComponent('IgcColumnSeriesComponent');
case DataSeriesType.Line:
return this.createSeriesComponent('IgcLineSeriesComponent');
case DataSeriesType.FinancialPrice:
return this.createSeriesComponent('IgcFinancialPriceSeriesComponent');
case DataSeriesType.ItemToolTipLayer:
return this.createSeriesComponent('IgcItemToolTipLayerComponent');
case DataSeriesType.CategoryToolTipLayer:
return this.createSeriesComponent('IgcCategoryToolTipLayerComponent');
case DataSeriesType.CrosshairLayer:
return this.createSeriesComponent('IgcCrosshairLayerComponent');
case DataSeriesType.FinalValueLayer:
return this.createSeriesComponent('IgcFinalValueLayerComponent');
case DataSeriesType.CalloutLayer:
return this.createSeriesComponent('IgcCalloutLayerComponent');
case DataSeriesType.DataToolTipLayer:
return this.createSeriesComponent('IgcDataToolTipLayerComponent');
case DataSeriesType.TrendLineLayer:
return this.createSeriesComponent('IgcTrendLineLayerComponent');
default:
return this.createSeriesComponent('IgcColumnSeriesComponent');
}
}
createXAxis(type) {
switch (type) {
case FinancialChartXAxisMode.Ordinal:
if (TypeRegistrar.isRegistered("IgcOrdinalTimeXAxisComponent")) {
return TypeRegistrar.create("IgcOrdinalTimeXAxisComponent");
}
else if (TypeRegistrar.isRegistered("IgcTimeXAxisComponent")) {
return TypeRegistrar.create("IgcTimeXAxisComponent");
}
else {
throw new Error("not valid axes components loaded");
}
case FinancialChartXAxisMode.Time:
if (TypeRegistrar.isRegistered("IgcTimeXAxisComponent")) {
return TypeRegistrar.create("IgcTimeXAxisComponent");
}
else if (TypeRegistrar.isRegistered("IgcOrdinalTimeXAxisComponent")) {
return TypeRegistrar.create("IgcOrdinalTimeXAxisComponent");
}
else {
throw new Error("not valid axes components loaded");
}
}
}
createYAxis(type) {
switch (type) {
case FinancialChartYAxisMode.Numeric:
if (TypeRegistrar.isRegistered("IgcNumericYAxisComponent")) {
return TypeRegistrar.create("IgcNumericYAxisComponent");
}
else if (TypeRegistrar.isRegistered("IgcPercentChangeYAxisComponent")) {
return TypeRegistrar.create("IgcPercentChangeYAxisComponent");
}
else {
throw new Error("not valid axes components loaded");
}
case FinancialChartYAxisMode.PercentChange:
if (TypeRegistrar.isRegistered("IgcPercentChangeYAxisComponent")) {
return TypeRegistrar.create("IgcPercentChangeYAxisComponent");
}
else if (TypeRegistrar.isRegistered("IgcNumericYAxisComponent")) {
return TypeRegistrar.create("IgcNumericYAxisComponent");
}
else {
throw new Error("not valid axes components loaded");
}
}
}
set dataSource(value) {
this._dataSource = value;
this.bindData();
}
get dataSource() {
return this._dataSource;
}
bindData() {
if (this._chart != null && this._chart !== undefined) {
this._chart.itemsSource = this._dataSource;
}
}
initializeContent() {
if (TypeRegistrar.isRegistered("IgcDataChartDefaultTooltipsComponent")) {
let d = TypeRegistrar.create("IgcDataChartDefaultTooltipsComponent");
this._defaultTooltips = d;
this._onDefaultTooltipsReady(d);
//this._container.appendChild(cr.location.nativeElement);
}
let context = this._chart.getContext();
if (!this._defaultTemplates) {
this._defaultTemplates = new IgcFinancialChartDefaultTemplatesComponent(this);
}
let mainGrid = this._renderer.createElement("div");
mainGrid.addClass("financialChartMainGrid");
mainGrid.setStyleProperty("width", "100%");
mainGrid.setStyleProperty("height", "100%");
mainGrid.setStyleProperty("text-align", "left");
mainGrid.setStyleProperty("display", "-ms-grid");
mainGrid.setStyleProperty("display", "grid");
mainGrid.setStyleProperty("-ms-grid-columns", "100%");
this._container.append(mainGrid);
let toolArea = this._renderer.createElement("div");
toolArea.addClass("financialChartToolbarArea");
toolArea.setStyleProperty("-ms-grid-row", "1");
toolArea.setStyleProperty("grid-row", "1");
mainGrid.append(toolArea);
this._toolbarElement = toolArea.getNativeElement();
let legend = this._renderer.createElement("div");
legend.addClass("financialChartLegend");
legend.setStyleProperty("-ms-grid-row", "2");
legend.setStyleProperty("grid-row", "2");
mainGrid.append(legend);
let price = this._renderer.createElement("div");
price.addClass("financialChartPrice");
price.setStyleProperty("-ms-grid-row", "3");
price.setStyleProperty("grid-row", "3");
mainGrid.append(price);
let indicators = this._renderer.createElement("div");
indicators.addClass("financialChartIndicators");
indicators.setStyleProperty("-ms-grid-row", "4");
indicators.setStyleProperty("grid-row", "4");
mainGrid.append(indicators);
let volume = this._renderer.createElement("div");
volume.addClass("financialChartVolume");
volume.setStyleProperty("-ms-grid-row", "5");
volume.setStyleProperty("grid-row", "5");
mainGrid.append(volume);
let slider = this._renderer.createElement("div");
slider.addClass("financialChartZoomSlider");
slider.setStyleProperty("-ms-grid-row", "6");
slider.setStyleProperty("grid-row", "6");
mainGrid.append(slider);
this._mainGridElement = mainGrid.getNativeElement();
this._toolbarTemplateComponent = TypeRegistrar.create("IgcTemplateContentComponent");
this._toolbarTemplateComponent.style.display = "block";
this._toolbarTemplateComponent.style.width = "100%";
this._toolbarTemplateComponent.style.height = "100%";
this._toolbarElement.appendChild(this._toolbarTemplateComponent);
let toolbarArea = this._toolbarTemplateComponent;
let toolbarContext = context.vm.toolbar;
toolbarContext.vm.financialChartIndicatorMenu.template = this.indicatorMenuTemplate ? this.indicatorMenuTemplate : this._defaultTemplates.financialChartIndicatorMenuTemplate;
toolbarContext.vm.financialChartIndicatorMenu.vm.notifyChanged = () => { toolbarArea.context = toolbarContext; };
toolbarContext.vm.financialChartTypePicker.template = this.chartTypePickerTemplate ? this.chartTypePickerTemplate : this._defaultTemplates.financialChartTypePickerTemplate;
toolbarContext.vm.financialChartTypePicker.vm.notifyChanged = () => { toolbarArea.context = toolbarContext; };
toolbarContext.vm.financialChartRangeSelector.template = this.rangeSelectorTemplate ? this.rangeSelectorTemplate : this._defaultTemplates.financialChartRangeSelectorTemplate;
toolbarContext.vm.financialChartRangeSelector.vm.notifyChanged = () => {
toolbarArea.context = toolbarContext;
};
toolbarContext.template = this.toolbarTemplate ? this.toolbarTemplate : this._defaultTemplates.financialChartToolbarTemplate;
let toolContainer = this._toolbarElement;
//let toolbarArea = this._templates.toArray()[0];
//let mainArea = this._templates.toArray()[1];
//toolbarArea.contentReady = () => {
// toolbarArea.contentReady = null;
//}
toolbarArea.context = toolbarContext;
toolbarArea.template = toolbarContext.template;
let ele = this._toolbarElement;
//ele.style.width = "100%";
//ele.style.height = "100%";
//if (ele.parentElement != null) {
// ele.parentElement.removeChild(ele);
//}
//toolContainer.appendChild(ele);
//this._wrapper.setStyleProperty(ele, "display", "")
ele.style.display = "";
let legendContainer = context.legendContainer.rootWrapper.getNativeElement();
let mainContainer = context.container.rootWrapper.getNativeElement();
let indicatorContainer = context.indicatorsContainer.rootWrapper.getNativeElement();
let volumeContainer = context.volumeContainer.rootWrapper.getNativeElement();
let zoomSliderContainer = context.zoomContainer.rootWrapper.getNativeElement();
var main = this._mainGridElement;
let templateMain = main.querySelector(".financialChartPrice");
let templateToolbar = main.querySelector(".financialChartToolbar");
let templateLegend = main.querySelector(".financialChartLegend");
let templateIndicator = main.querySelector(".financialChartIndicators");
let templateVolume = main.querySelector(".financialChartVolume");
let templateZoomSlider = main.querySelector(".financialChartZoomSlider");
let grid = main; // main.querySelector(".financialChartMainGrid");
let gridWrapper = new WebComponentWrapper(grid, this._wrapper);
this._chart.provideGrid(gridWrapper);
this._checkToolbarSize();
templateMain.appendChild(mainContainer);
//templateToolbar.appendChild(toolContainer);
templateLegend.appendChild(legendContainer);
templateIndicator.appendChild(indicatorContainer);
templateVolume.appendChild(volumeContainer);
templateZoomSlider.appendChild(zoomSliderContainer);
this._styling(this, this);
//this._mainElement.nativeElement.parentElement.removeChild(this._mainElement.nativeElement);
//this.container.appendChild(this._mainElement.nativeElement);
}
_createZoomSlider(hostEle, onReady) {
if (!TypeRegistrar.isRegistered("IgcZoomSliderComponent")) {
//shouldn't happen.
throw new Error("zoom slider component isn't loaded");
}
let slider = TypeRegistrar.create("IgcZoomSliderComponent");
slider.className = "test";
slider.width = "100%";
slider.height = "100%";
onReady(slider);
}
createTooltip() {
if (!TypeRegistrar.isRegistered("IgcTooltipContainerComponent")) {
return null;
}
let cr = TypeRegistrar.create("IgcTooltipContainerComponent");
let ele = cr;
let self = this;
ele.updateToolTip = function (c, isSubContent) {
if (c.externalObject) {
c = c.externalObject;
}
else {
let ext = new IgcDataContext();
ext._implementation = c;
c = ext;
}
if (!isSubContent) {
if (ele.parentElement != self._container.getNativeElement()) {
if (ele.parentElement != null) {
ele.parentElement.removeChild(ele);
}
self._container.getNativeElement().appendChild(ele);
}
}
else {
c.isSubContent = true;
}
cr.context = c;
ele.style.display = "block";
return true;
};
ele.hideToolTip = function () {
ele.style.display = "none";
};
ele.style.display = "none";
return cr;
}
_ensureTooltipCreated(series) {
series._ensureTooltipCreated(() => this.createTooltip(), (ele) => {
let wrapper = new WebComponentWrapper(ele, this._renderer);
wrapper.updateToolTip = ele.updateToolTip;
wrapper.hideToolTip = ele.hideToolTip;
return wrapper;
});
}
// private _createXAxis(): any {
// let x = new IgxCategoryXAxisComponent();
// return x.i;
// }
// private _createYAxis(): any {
// let y = new IgxNumericYAxisComponent();
// return y.i;
// }
_ensureDefaultTooltip(series) {
if (this._defaultTooltips == null) {
return;
}
this._defaultTooltips["ensureDefaultTooltip"](series);
}
_onDefaultTooltipsReady(cr) {
if (this.i.dataChart) {
var currSeries = this.i.dataChart.series;
for (var i = 0; i < currSeries.count; i++) {
if (currSeries.item(i).externalObject.showDefaultTooltip) {
this._ensureDefaultTooltip(currSeries.item(i).externalObject);
}
}
}
}
/**
* TimeAxisBreaks to apply to this chart when in time axis mode, representing spans of time to omit, such as weekends.
*/
get xAxisBreaks() {
if (this._xAxisBreaks === null) {
if (!TypeRegistrar.isRegistered("IgcTimeAxisBreakCollection")) {
return null;
}
let coll = TypeRegistrar.create("IgcTimeAxisBreakCollection");
let innerColl = this.i.xAxisBreaks;
if (!innerColl) {
innerColl = TypeRegistrar.create("TimeAxisBreakCollection");
}
this._xAxisBreaks = coll._fromInner(innerColl);
this.i._xAxisBreaks = innerColl;
}
return this._xAxisBreaks;
}
set xAxisBreaks(v) {
if (this._xAxisBreaks !== null) {
this._xAxisBreaks._setSyncTarget(null);
this._xAxisBreaks = null;
}
if (!TypeRegistrar.isRegistered("IgxTimeAxisBreakCollection")) {
return;
}
let coll = TypeRegistrar.create("IgxTimeAxisBreakCollection");
let t = TypeRegistrar.get("TimeAxisBreak");
this._xAxisBreaks = coll._fromOuter(v);
let syncColl = new SyncableObservableCollection$1(t.$type);
let innerColl = this.i.xAxisBreaks;
if (!innerColl) {
innerColl = TypeRegistrar.create("TimeAxisBreakCollection");
}
syncColl._inner = innerColl;
syncColl.clear();
this._xAxisBreaks._setSyncTarget(syncColl);
this.i._xAxisBreaks = innerColl;
}
static get observedAttributes() {
if (IgcFinancialChartComponent._observedAttributesIgcFinancialChartComponent == null) {
let names = getAllPropertyNames(IgcFinancialChartComponent);
for (let i = 0; i < names.length; i++) {
names[i] = toSpinal(names[i]);
}
IgcFinancialChartComponent._observedAttributesIgcFinancialChartComponent = names;
}
return IgcFinancialChartComponent._observedAttributesIgcFinancialChartComponent;
}
static register() {
if (!IgcFinancialChartComponent._isElementRegistered) {
IgcFinancialChartComponent._isElementRegistered = true;
RegisterElementHelper.registerElement(IgcFinancialChartComponent.htmlTagName, IgcFinancialChartComponent);
}
}
get leftMargin() {
return this.i.j6;
}
set leftMargin(v) {
this.i.j6 = +v;
this._a("leftMargin", this.i.j6);
}
get isHorizontalZoomEnabled() {
return this.i.ha;
}
set isHorizontalZoomEnabled(v) {
this.i.ha = ensureBool(v);
this._a("isHorizontalZoomEnabled", this.i.ha);
}
get toolbarHeight() {
return this.i.ama;
}
set toolbarHeight(v) {
this.i.ama = +v;
this._a("toolbarHeight", this.i.ama);
}
/**
* Gets domain type of this chart
*/
get domainType() {
return this.i.cb;
}
/**
* Gets or sets whether the Y-axis should use a logarithmic scale instead of a linear one.
* Since log(-1) is imaginary and log(0) is undefined, it is recommended to enable this property only when the Y-axis minimum is greater than zero.
*/
get yAxisIsLogarithmic() {
return this.i.ak9;
}
set yAxisIsLogarithmic(v) {
this.i.ak9 = ensureBool(v);
this._a("yAxisIsLogarithmic", this.i.ak9);
}
/**
* Gets or sets the base value to use in the log function when mapping the position of data items along the Y-axis.
* This property is effective only when YAxisIsLogarithmic is true.
*/
get yAxisLogarithmBase() {
return this.i.am7;
}
set yAxisLogarithmBase(v) {
this.i.am7 = +v;
this._a("yAxisLogarithmBase", this.i.am7);
}
/**
* Gets or sets the distance between each label and grid line along the Y-axis.
*
* The `YAxisInterval` determines how often to show a label, tickmark, and/or gridline along the y-axis. Set this property to a number less than the numeric range of the y-axis.
*/
get yAxisInterval() {
return this.i.amj;
}
set yAxisInterval(v) {
this.i.amj = +v;
this._a("yAxisInterval", this.i.amj);
}
/**
* Gets or sets the data value corresponding to the minimum value of the Y-axis.
*
* The `YAxisMinimumValue` determines starting value of labels, tickmarks, and gridlines on the y-axis.
*/
get yAxisMinimumValue() {
return this.i.aml;
}
set yAxisMinimumValue(v) {
this.i.aml = +v;
this._a("yAxisMinimumValue", this.i.aml);
}
/**
* Gets or sets the data value corresponding to the maximum value of the Y-axis.
*
* The `YAxisMaximumValue` determines ending value of labels, tickmarks, and gridlines on the y-axis.
*/
get yAxisMaximumValue() {
return this.i.amk;
}
set yAxisMaximumValue(v) {
this.i.amk = +v;
this._a("yAxisMaximumValue", this.i.amk);
}
/**
* Gets or sets the frequency of displayed minor lines along the Y-axis.
*
* The `YAxisMinorInterval` determines how often to show minor gridline along the y-axis. Set this property to a number less than the `YAxisInterval` and the numeric range of the y-axis.
*/
get yAxisMinorInterval() {
return this.i.amm;
}
set yAxisMinorInterval(v) {
this.i.amm = +v;
this._a("yAxisMinorInterval", this.i.amm);
}
/**
* Gets the current minimum value for the Y-axis.
*/
get yAxisActualMinimum() {
return this.i.ami;
}
/**
* Gets the current maximum value for the Y-axis.
*/
get yAxisActualMaximum() {
return this.i.amh;
}
/**
* The type of series to display in the volume pane.
*
* Use the `VolumeType` property to set a type of all series that will be rendered in the volume pane, e.g.
*/
get volumeType() {
return this.i.ai9;
}
set volumeType(v) {
this.i.ai9 = ensureEnum(FinancialChartVolumeType_$type, v);
this._a("volumeType", enumToString(FinancialChartVolumeType_$type, this.i.ai9));
}
/**
* The scaling mode of the X-axis.
*
* Use the `XAxisMode` property to plot data items without any breaks in data range (Ordinal mode) or with breaks in data range (Time mode) such as weekends/holidays. Note that the Ordinal axis mode is less expensive to use in the financial chart than the Time axis mode.
*/
get xAxisMode() {
return this.i.ajb;
}
set xAxisMode(v) {
this.i.ajb = ensureEnum(FinancialChartXAxisMode_$type, v);
this._a("xAxisMode", enumToString(FinancialChartXAxisMode_$type, this.i.ajb));
}
/**
* Gets or sets number of visible categories at maximum zooming level
* This property works only with ordinal XAxisMode and it is overridden by chart's WindowRectMinWidth property
*/
get xAxisZoomMaximumCategoryRange() {
return this.i.amc;
}
set xAxisZoomMaximumCategoryRange(v) {
this.i.amc = +v;
this._a("xAxisZoomMaximumCategoryRange", this.i.amc);
}
/**
* Gets or sets starting category that chart will move its zoom window. Acceptable value is between 0 and number of data items
* This property works only with ordinal XAxisMode and it is overridden by chart's WindowRect or WindowScaleHorizontal properties
*/
get xAxisZoomToCategoryStart() {
return this.i.amf;
}
set xAxisZoomToCategoryStart(v) {
this.i.amf = +v;
this._a("xAxisZoomToCategoryStart", this.i.amf);
}
/**
* Gets or sets maximum pixel span of series item that will be visible at maximum zooming level
* This property ensures that series item does not get stretch above specified value.
* This property works only with ordinal XAxisMode and it is overridden by chart's WindowRectMinWidth property
*/
get xAxisZoomMaximumItemSpan() {
return this.i.amd;
}
set xAxisZoomMaximumItemSpan(v) {
this.i.amd = +v;
this._a("xAxisZoomMaximumItemSpan", this.i.amd);
}
/**
* Gets or sets number of categories that the chart will zoom in and fill plot area
* This property is overridden by chart's WindowRect or WindowScaleHorizontal properties
*/
get xAxisZoomToCategoryRange() {
return this.i.ame;
}
set xAxisZoomToCategoryRange(v) {
this.i.ame = +v;
this._a("xAxisZoomToCategoryRange", this.i.ame);
}
/**
* Gets or sets pixel span of series item that will be used to zoom chart such that the item has desired span
* Chart will automatically zoom in until series item has specified pixel span.
* This property works only with ordinal XAxisMode and it is overridden by chart's WindowRect or WindowScaleHorizontal properties
*/
get xAxisZoomToItemSpan() {
return this.i.amg;
}
set xAxisZoomToItemSpan(v) {
this.i.amg = +v;
this._a("xAxisZoomToItemSpan", this.i.amg);
}
/**
* The scaling mode of the Y-axis.
*
* Use the `YAxisMode` property to plot data items using their actual values (Numeric) or using percent changes from the first data point (PercentChange), e.g.
*/
get yAxisMode() {
return this.i.ajd;
}
set yAxisMode(v) {
this.i.ajd = ensureEnum(FinancialChartYAxisMode_$type, v);
this._a("yAxisMode", enumToString(FinancialChartYAxisMode_$type, this.i.ajd));
}
/**
* A boolean property controlling the visibility of the toolbar.
*/
get isToolbarVisible() {
return this.i.ak2;
}
set isToolbarVisible(v) {
this.i.ak2 = ensureBool(v);
this._a("isToolbarVisible", this.i.ak2);
}
/**
* The type of price series to display in the main chart.
*
* Use the `ChartType` property to set a type of series that will be used to render prices in the Financial Chart control, e.g.
*/
get chartType() {
return this.i.ai4;
}
set chartType(v) {
this.i.ai4 = ensureEnum(FinancialChartType_$type, v);
this._a("chartType", enumToString(FinancialChartType_$type, this.i.ai4));
}
/**
* Gets or sets Horizontal alignment of Y-axis labels.
*/
get yAxisLabelHorizontalAlignment() {
return this.i.agw;
}
set yAxisLabelHorizontalAlignment(v) {
this.i.agw = ensureEnum(HorizontalAlignment_$type, v);
this._a("yAxisLabelHorizontalAlignment", enumToString(HorizontalAlignment_$type, this.i.agw));
}
/**
* A boolean indicating whether the chart should automatically zoom in vertically on the currently visible range of data.
* When this property is set to true, panning and zooming along the X-axis will result in a corresponding zoom on the Y-axis, so that the visible range of data fills the zoom window as fully as possible.
*/
get isWindowSyncedToVisibleRange() {
return this.i.ak3;
}
set isWindowSyncedToVisibleRange(v) {
this.i.ak3 = ensureBool(v);
this._a("isWindowSyncedToVisibleRange", this.i.ak3);
}
/**
* A collection indicating what financial indicator types to display on the Financial Chart.
*
* Use the `IndicatorTypes` property to set types of indicators that will be rendered below the price pane in the Financial Chart control, e.g.
*/
get indicatorTypes() {
if (this._indicatorTypes === null) {
let coll = new IgcFinancialIndicatorTypeCollection();
let innerColl = this.i.aji;
if (!innerColl) {
innerColl = new FinancialIndicatorTypeCollection_internal(0);
}
this._indicatorTypes = coll._fromInner(innerColl);
this.i.aji = innerColl;
}
return this._indicatorTypes;
}
set indicatorTypes(v) {
if (this._indicatorTypes !== null) {
this._indicatorTypes._setSyncTarget(null);
this._indicatorTypes = null;
}
let coll = new IgcFinancialIndicatorTypeCollection();
this._indicatorTypes = coll._fromOuter(v);
let syncColl = new SyncableObservableCollection$1(FinancialIndicatorType_$type);
let innerColl = this.i.aji;
if (!innerColl) {
innerColl = new FinancialIndicatorTypeCollection_internal(0);
}
syncColl._inner = innerColl;
syncColl.clear();
this._indicatorTypes._setSyncTarget(syncColl);
this.i.aji = innerColl;
}
/**
* A collection indicating what financial overlay types to display on the Financial Chart.
*
* Use the `OverlayTypes` property to set types of overlays that will be rendered behind price series in the Financial Chart control, e.g.
*/
get overlayTypes() {
if (this._overlayTypes === null) {
let coll = new IgcFinancialOverlayTypeCollection();
let innerColl = this.i.ajk;
if (!innerColl) {
innerColl = new FinancialOverlayTypeCollection_internal(0);
}
this._overlayTypes = coll._fromInner(innerColl);
this.i.ajk = innerColl;
}
return this._overlayTypes;
}
set overlayTypes(v) {
if (this._overlayTypes !== null) {
this._overlayTypes._setSyncTarget(null);
this._overlayTypes = null;
}
let coll = new IgcFinancialOverlayTypeCollection();
this._overlayTypes = coll._fromOuter(v);
let syncColl = new SyncableObservableCollection$1(FinancialOverlayType_$type);
let innerColl = this.i.ajk;
if (!innerColl) {
innerColl = new FinancialOverlayTypeCollection_internal(0);
}
syncColl._inner = innerColl;
syncColl.clear();
this._overlayTypes._setSyncTarget(syncColl);
this.i.ajk = innerColl;
}
/**
* Gets or sets whether the large numbers on the Y-axis labels are abbreviated.
*/
get yAxisAbbreviateLargeNumbers() {
return this.i.ak7;
}
set yAxisAbbreviateLargeNumbers(v) {
this.i.ak7 = ensureBool(v);
this._a("yAxisAbbreviateLargeNumbers", this.i.ak7);
}
/**
* Gets or sets the rendering resolution for all series in this chart.
* Where n = Resolution, for every n horizontal pixels, combine all items into a single datapoint. When Resolution = 0, all datapoints will be rendered as graphical objects. Charts with a higher resolution will have faster performance.
*/
get resolution() {
return this.i.ke;
}
set resolution(v) {
this.i.ke = +v;
this._a("resolution", this.i.ke);
}
/**
* Gets or sets whether the x axis enhanced interval management should prefer to show all the labels if possible without collisions for supported types of category axes. This is for use with EnhancedIntervalMinimumCharacters = -1 and axes that have an integral interval.
*/
get xAxisEnhancedIntervalPreferMoreCategoryLabels() {
return this.i.ak6;
}
set xAxisEnhancedIntervalPreferMoreCategoryLabels(v) {
this.i.ak6 = ensureBool(v);
this._a("xAxisEnhancedIntervalPreferMoreCategoryLabels", this.i.ak6);
}
/**
* Gets or sets whether the y axis enhanced interval management should prefer to show all the labels if possible without collisions for supported types of category axes. This is for use with EnhancedIntervalMinimumCharacters = -1 and axes that have an integral interval.
*/
get yAxisEnhancedIntervalPreferMoreCategoryLabels() {
return this.i.ak8;
}
set yAxisEnhancedIntervalPreferMoreCategoryLabels(v) {
this.i.ak8 = ensureBool(v);
this._a("yAxisEnhancedIntervalPreferMoreCategoryLabels", this.i.ak8);
}
/**
* Gets or sets type of series to display in the zoom slider pane.
*
* Use the `ZoomSliderType` property to set a type of all series that will be rendered in the zoom pane, e.g.
*/
get zoomSliderType() {
return this.i.ajg;
}
set zoomSliderType(v) {
this.i.ajg = ensureEnum(FinancialChartZoomSliderType_$type, v);
this._a("zoomSliderType", enumToString(FinancialChartZoomSliderType_$type, this.i.ajg));
}
/**
* Gets or sets the palette used for coloring negative items of Waterfall chart type.
*
* Use the `NegativeBrushes` property to set a collection of brushes that will be used to render fill area of negative elements in the price pane, e.g.
*/
get negativeBrushes() {
return fromBrushCollection(this.i.aid);
}
set negativeBrushes(v) {
this.i.aid = toBrushCollection(v);
this._a("negativeBrushes", brushCollectionToString(this.i.aid));
}
/**
* Brushes to use for drawing negative elements, when using a chart type with contextual coloring, such as Waterfall.
*
* Use the `NegativeOutlines` property to set a collection of brushes that will be used to render outline of negative elements in the price pane, e.g.
*/
get negativeOutlines() {
return fromBrushCollection(this.i.aie);
}
set negativeOutlines(v) {
this.i.aie = toBrushCollection(v);
this._a("negativeOutlines", brushCollectionToString(this.i.aie));
}
/**
* Brushes to use for filling financial overlays.
*
* Use the `OverlayBrushes` property to set a collection of brushes that will be used to render fill area of overlays in the Financial Chart control, e.g.
*/
get overlayBrushes() {
return fromBrushCollection(this.i.aif);
}
set overlayBrushes(v) {
this.i.aif = toBrushCollection(v);
this._a("overlayBrushes", brushCollectionToString(this.i.aif));
}
/**
* Brushes to use for outlining financial overlays.
*
* Use the `OverlayOutlines` property to set a collection of brushes that will be used to render outlines of overlays in the Financial Chart control, e.g.
*/
get overlayOutlines() {
return fromBrushCollection(this.i.aig);
}
set overlayOutlines(v) {
this.i.aig = toBrushCollection(v);
this._a("overlayOutlines", brushCollectionToString(this.i.aig));
}
/**
* Brushes to use for outlining volume series in the volume pane.
*
* Use the `VolumeOutlines` property to set a collection of brushes that will be used to render outline of multiple series in the volume pane of the Financial Chart control, e.g.
*/
get volumeOutlines() {
return fromBrushCollection(this.i.aii);
}
set volumeOutlines(v) {
this.i.aii = toBrushCollection(v);
this._a("volumeOutlines", brushCollectionToString(this.i.aii));
}
/**
* Brushes to use for filling volume series in the volume pane.
*
* Use the `VolumeBrushes` property to set a collection of brushes that will be used to render fill area of multiple series in the volume pane of the Financial Chart control, e.g.
*/
get volumeBrushes() {
return fromBrushCollection(this.i.aih);
}
set volumeBrushes(v) {
this.i.aih = toBrushCollection(v);
this._a("volumeBrushes", brushCollectionToString(this.i.aih));
}
/**
* Brushes to use for negative elements in financial indicators.
*
* Use the `IndicatorNegativeBrushes` property to set a collection of brushes that will be used to render negative elements of indicators in the Financial Chart control, e.g.
*/
get indicatorNegativeBrushes() {
return fromBrushCollection(this.i.aic);
}
set indicatorNegativeBrushes(v) {
this.i.aic = toBrushCollection(v);
this._a("indicatorNegativeBrushes", brushCollectionToString(this.i.aic));
}
/**
* Brushes to use for financial indicators.
*
* Use the `IndicatorBrushes` property to set a collection of brushes that will be used to render positive elements of indicators in the Financial Chart control, e.g.
*/
get indicatorBrushes() {
return fromBrushCollection(this.i.aib);
}
set indicatorBrushes(v) {
this.i.aib = toBrushCollection(v);
this._a("indicatorBrushes", brushCollectionToString(this.i.aib));
}
/**
* The outline thickness of volume series in the volume pane.
*
* Use the `VolumeThickness` property to set a number that will be used to render outline thickness of all series in the volume pane, e.g.
*/
get volumeThickness() {
return this.i.amb;
}
set volumeThickness(v) {
this.i.amb = +v;
this._a("volumeThickness", this.i.amb);
}
/**
* The outline thickness of financial overlays.
*
* Use the `OverlayThickness` property to set a number that will be used to render outline thickness of all overlays in the Financial Chart contr