igniteui-webcomponents-charts
Version:
Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.
334 lines (329 loc) • 12.9 kB
JavaScript
import { TrendLineType_$type } from "igniteui-webcomponents-core";
import { PriceDisplayType_$type } from "./PriceDisplayType";
import { CategoryCollisionMode_$type } from "./CategoryCollisionMode";
import { ValueLayerValueMode_$type } from "./ValueLayerValueMode";
import { IgcFinancialSeriesComponent } from "./igc-financial-series-component";
import { FinancialPriceSeries } from "./FinancialPriceSeries";
import { getAllPropertyNames, toSpinal, ensureEnum, enumToString, brushToString, stringToBrush, toDoubleCollection, fromDoubleCollection, doubleCollectionToString, toPoint, fromRect, fromPoint } from "igniteui-webcomponents-core";
import { RegisterElementHelper } from "igniteui-webcomponents-core";
let IgcFinancialPriceSeriesComponent = /*@__PURE__*/ (() => {
class IgcFinancialPriceSeriesComponent extends IgcFinancialSeriesComponent {
createImplementation() {
return new FinancialPriceSeries();
}
/**
* @hidden
*/
get i() {
return this._implementation;
}
constructor() {
super();
}
connectedCallback() {
if (super["connectedCallback"]) {
super["connectedCallback"]();
}
if (this.i.connectedCallback) {
this.i.connectedCallback();
}
if (!this._attached) {
this._attached = true;
this._flushQueuedAttributes();
}
}
disconnectedCallback() {
if (super["disconnectedCallback"]) {
super["disconnectedCallback"]();
}
if (this.i.disconnectedCallback) {
this.i.disconnectedCallback();
}
if (this._attached) {
this._attached = false;
}
}
static get observedAttributes() {
if (IgcFinancialPriceSeriesComponent._observedAttributesIgcFinancialPriceSeriesComponent == null) {
let names = getAllPropertyNames(IgcFinancialPriceSeriesComponent);
for (let i = 0; i < names.length; i++) {
names[i] = toSpinal(names[i]);
}
IgcFinancialPriceSeriesComponent._observedAttributesIgcFinancialPriceSeriesComponent = names;
}
return IgcFinancialPriceSeriesComponent._observedAttributesIgcFinancialPriceSeriesComponent;
}
static register() {
if (!IgcFinancialPriceSeriesComponent._isElementRegistered) {
IgcFinancialPriceSeriesComponent._isElementRegistered = true;
RegisterElementHelper.registerElement(IgcFinancialPriceSeriesComponent.htmlTagName, IgcFinancialPriceSeriesComponent);
}
}
/**
* Gets whether the series has financial OHLC/candlestick visuals
*/
get isFinancialSeries() {
return this.i.fd;
}
/**
* Gets or sets the trend type for the current financial series.
*
* Use the `TrendLineType` property for the trend type of the current financial series.
*
* ```ts
* series.trendLineType= "CubicFit";
* ```
*/
get trendLineType() {
return this.i.trendLineType;
}
set trendLineType(v) {
this.i.trendLineType = ensureEnum(TrendLineType_$type, v);
this._a("trendLineType", enumToString(TrendLineType_$type, this.i.trendLineType));
}
/**
* Gets or sets the brush to use to draw the trend line.
*
* Use the `TrendLineBrush` property to brush the the trend line.
*
* ```ts
* series.trendLineBrush="red";
* ```
*/
get trendLineBrush() {
return brushToString(this.i.trendLineBrush);
}
set trendLineBrush(v) {
this.i.trendLineBrush = stringToBrush(v);
this._a("trendLineBrush", brushToString(this.i.trendLineBrush));
}
/**
* Gets the effective TrendLineBrush for this FinancialPriceSeries.
*
* Use the `ActualTrendLineBrush` property to Gets the effective TrendLineBrush for the FinancialIndicator.
*/
get actualTrendLineBrush() {
return brushToString(this.i.ac6);
}
set actualTrendLineBrush(v) {
this.i.ac6 = stringToBrush(v);
this._a("actualTrendLineBrush", brushToString(this.i.ac6));
}
/**
* Gets or sets the thickness of the current FinancialPriceSeries object's trend line.
*
* Use the `TrendLineThickness` property for the thickness of the current FinancialPriceSeries object's trend line.
*
* ```ts
* series.trendLineThickness=5;
* ```
*/
get trendLineThickness() {
return this.i.trendLineThickness;
}
set trendLineThickness(v) {
this.i.trendLineThickness = +v;
this._a("trendLineThickness", this.i.trendLineThickness);
}
/**
* Gets or sets a collection of double values that indicate the pattern of dashes and gaps that
* is used to draw the trend line for the current FinancialPriceSeries object.
*/
get trendLineDashArray() {
return fromDoubleCollection(this.i.ac8);
}
set trendLineDashArray(v) {
this.i.ac8 = toDoubleCollection(v);
this._a("trendLineDashArray", doubleCollectionToString(this.i.ac8));
}
/**
* Gets or sets the trend line period for the current series.
* The typical, and initial, value for trend line period is 7.
*
* Use the `TrendLinePeriod` property for the periodo the the current series.
*
* ```ts
* series.trendLinePeriod= 7;
* ```
*/
get trendLinePeriod() {
return this.i.trendLinePeriod;
}
set trendLinePeriod(v) {
this.i.trendLinePeriod = +v;
this._a("trendLinePeriod", this.i.trendLinePeriod);
}
/**
* Gets or sets the display type for the current FinancialPriceSeries object.
*
* Use the `DisplayType` property for the display type of the current FinancialPriceSeries object.
*
* ```ts
* series.displayType=PriceDisplayType.Candlestick;
* ```
*/
get displayType() {
return this.i.abo;
}
set displayType(v) {
this.i.abo = ensureEnum(PriceDisplayType_$type, v);
this._a("displayType", enumToString(PriceDisplayType_$type, this.i.abo));
}
/**
* Gets or sets the category collision mode selection behavior to use for the series.
*/
get categoryCollisionMode() {
return this.i.abm;
}
set categoryCollisionMode(v) {
this.i.abm = ensureEnum(CategoryCollisionMode_$type, v);
this._a("categoryCollisionMode", enumToString(CategoryCollisionMode_$type, this.i.abm));
}
/**
* Brush to use for outlining negative elements in the series.
*
* Use the `NegativeOutline` property to brush the outline negative elements in the series.
*
* ```ts
* series.negativeOutline="red";
* ```
*/
get negativeOutline() {
return brushToString(this.i.ac7);
}
set negativeOutline(v) {
this.i.ac7 = stringToBrush(v);
this._a("negativeOutline", brushToString(this.i.ac7));
}
/**
* Gets or sets the label displayed before series' Low value in the Data Legend.
*/
get lowMemberAsLegendLabel() {
return this.i.ab5;
}
set lowMemberAsLegendLabel(v) {
this.i.ab5 = v;
}
/**
* Gets or sets the label displayed before series' High value in the Data Legend.
*/
get highMemberAsLegendLabel() {
return this.i.ab1;
}
set highMemberAsLegendLabel(v) {
this.i.ab1 = v;
}
/**
* Gets or sets the label displayed before series' Close value in the Data Legend.
*/
get closeMemberAsLegendLabel() {
return this.i.abw;
}
set closeMemberAsLegendLabel(v) {
this.i.abw = v;
}
/**
* Gets or sets the label displayed before series' Open value in the Data Legend.
*/
get openMemberAsLegendLabel() {
return this.i.aca;
}
set openMemberAsLegendLabel(v) {
this.i.aca = v;
}
/**
* Gets or sets the unit displayed after series' Low value in the Data Legend.
*/
get lowMemberAsLegendUnit() {
return this.i.ab7;
}
set lowMemberAsLegendUnit(v) {
this.i.ab7 = v;
}
/**
* Gets or sets the unit displayed after series' High value in the Data Legend.
*/
get highMemberAsLegendUnit() {
return this.i.ab3;
}
set highMemberAsLegendUnit(v) {
this.i.ab3 = v;
}
/**
* Gets or sets the unit displayed after series' Close value in the Data Legend.
*/
get closeMemberAsLegendUnit() {
return this.i.aby;
}
set closeMemberAsLegendUnit(v) {
this.i.aby = v;
}
/**
* Gets or sets the unit displayed after series' Open value in the Data Legend.
*/
get openMemberAsLegendUnit() {
return this.i.acc;
}
set openMemberAsLegendUnit(v) {
this.i.acc = v;
}
/**
* If possible, will return the best available value bounding box within the series that has the best value match for the world position provided.
* @param world * The world coordinate for which to get a value bounding box for
*
* The `GetSeriesValueBoundingBox` method return the best available value bounding box within the series that has the best value match for the world position provided.
*/
getSeriesValueBoundingBox(world) {
let iv = this.i.w8(toPoint(world));
return fromRect(iv);
}
/**
* Scrolls the series to display the item for the specified data item.
* The categorySeries is scrolled by the minimum amount required to place the specified data item within
* the central 80% of the visible axis.
* @param item * The data item (item) to scroll to.
*
* The `ScrollIntoView` methos scrolls the series to display the item for the specified data item.
*/
scrollIntoView(item) {
let iv = this.i.gj(item);
return (iv);
}
/**
* For a category plotted series, returns the current width of the items within the categories. This only returns a value if the items have some form of width (e.g. columns, bars, etc.) otherwise 0 is returned.
*
* The `GetItemSpan` method is used For a category plotted series, returns the current width of the items within the categories.
*
* This only returns a value if the items have some form of width (e.g. columns, bars, etc.) otherwise 0 is returned
*/
getItemSpan() {
let iv = this.i.i3();
return (iv);
}
setNegativeColors(negativeBrush, negativeOutline) {
this.i.sl(stringToBrush(negativeBrush), stringToBrush(negativeOutline));
}
/**
* Gets a numeric value from the numeric axis associated with this series that matches the desired
* value mode.
* @param mode * The type of value desired from the series numeric axis.
*/
getSeriesValueType(mode) {
let iv = this.i.aq(ensureEnum(ValueLayerValueMode_$type, mode));
return (iv);
}
getSeriesValueTypePosition(mode) {
let iv = this.i.wz(ensureEnum(ValueLayerValueMode_$type, mode));
return fromPoint(iv);
}
getSeriesValueTypePositionFromValue(values) {
let iv = this.i.w0(values);
return fromPoint(iv);
}
}
IgcFinancialPriceSeriesComponent._observedAttributesIgcFinancialPriceSeriesComponent = null;
IgcFinancialPriceSeriesComponent.htmlTagName = "igc-financial-price-series";
IgcFinancialPriceSeriesComponent._isElementRegistered = false;
return IgcFinancialPriceSeriesComponent;
})();
export { IgcFinancialPriceSeriesComponent };