igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
145 lines (142 loc) • 4.13 kB
JavaScript
import { IgrSeries } from "./igr-series";
import { IgrAnnotationLayer } from "./igr-annotation-layer";
import { ItemToolTipLayer } from "./ItemToolTipLayer";
import { ensureBool, brushToString, stringToBrush } from "igniteui-react-core";
/**
* Represents an annotation layer that displays tooltips for all target series individually.
*/
export class IgrItemToolTipLayer extends IgrAnnotationLayer {
createImplementation() {
return new ItemToolTipLayer();
}
/**
* @hidden
*/
get i() {
return this._implementation;
}
constructor(props) {
super(props);
}
/**
* Gets whether the series is an annotation layer displayed only when hovering over the chart.
*/
get isAnnotationHoverLayer() {
return this.i.eu;
}
get isToolTipLayer() {
return this.i.f7;
}
/**
* Gets whether the default tooltip behaviors for the chart are disabled if this layer is present.
*/
get isDefaultTooltipBehaviorDisabled() {
return this.i.e5;
}
/**
* Gets or sets the name of the series series to target this annotation to. If null, this annotation targets all series simultaneously.
*/
get targetSeriesName() {
return this.i.aa0;
}
set targetSeriesName(v) {
this.i.aa0 = v;
}
/**
* Gets or sets the series to target this annotation to. If null, this annotation targets all series simultaneously.
*/
get targetSeries() {
const r = this.i.aat;
if (r == null) {
return null;
}
if (!r.externalObject) {
let e = IgrSeries._createFromInternal(r);
if (e) {
e._implementation = r;
}
r.externalObject = e;
}
return r.externalObject;
}
set targetSeries(v) {
if (v != null && this._stylingContainer && v._styling)
v._styling(this._stylingContainer, this, this);
v == null ? this.i.aat = null : this.i.aat = v.i;
}
/**
* Gets or sets whether to use value interpolation when drawing the tooltips.
*/
get useInterpolation() {
return this.i.aaw;
}
set useInterpolation(v) {
this.i.aaw = ensureBool(v);
}
/**
* Gets or sets whether to skip past unknown values when searching for series values.
*/
get skipUnknownValues() {
return this.i.aav;
}
set skipUnknownValues(v) {
this.i.aav = ensureBool(v);
}
/**
* Gets or sets the background of the tooltip containers.
*/
get toolTipBackground() {
return brushToString(this.i.abg);
}
set toolTipBackground(v) {
this.i.abg = stringToBrush(v);
}
/**
* Gets or sets the border color of the tooltip containers.
*/
get toolTipBorderBrush() {
return brushToString(this.i.abh);
}
set toolTipBorderBrush(v) {
this.i.abh = stringToBrush(v);
}
/**
* Gets or sets the border thickness of the tooltip containers.
*/
get toolTipBorderThickness() {
return this.i.aax;
}
set toolTipBorderThickness(v) {
this.i.aax = +v;
}
findByName(name) {
var baseResult = super.findByName(name);
if (baseResult) {
return baseResult;
}
if (this.targetSeries && this.targetSeries.name && this.targetSeries.name == name) {
return this.targetSeries;
}
return null;
}
_styling(container, component, parent) {
super._styling(container, component, parent);
this._inStyling = true;
if (this.targetSeries && this.targetSeries._styling) {
this.targetSeries._styling(container, component, this);
}
this._inStyling = false;
}
/**
* Hides any tooltips presented by the layer, if any.
*/
hideToolTips() {
this.i.ql();
}
/**
* Hides any tooltips presented by the layer, if any.
*/
hideToolTipsImmediate() {
this.i.qm();
}
}