igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
73 lines (72 loc) • 2.58 kB
JavaScript
import { __extends } from "tslib";
import * as React from 'react';
import { IgrLegendBase } from './igr-legend-base';
import { Legend } from "./Legend";
import { ReactRenderer } from "igniteui-react-core";
import { DataChartStylingDefaults } from './DataChartStylingDefaults';
/**
* Represents a legend that displays information about each series, most often used in financial charting.
*/
var IgrFinancialLegend = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgrFinancialLegend, _super);
function IgrFinancialLegend(props) {
var _this = _super.call(this, props) || this;
var container;
if (document) {
container = document.createElement("div");
container.style.display = "block";
container.style.width = "100%";
container.style.height = "100%";
}
var root;
root = container;
var ren = new ReactRenderer(root, document, true, DataChartStylingDefaults);
_this.container = ren.getWrapper(container);
_this._wrapper = ren;
_this.i.provideContainer(ren);
return _this;
}
IgrFinancialLegend.prototype.render = function () {
var div = React.createElement("div", {
className: "ig-financial-legend igr-financial-legend",
ref: this._getMainRef
});
return div;
};
IgrFinancialLegend.prototype._getMainRef = function (div) {
this._elRef = div;
};
IgrFinancialLegend.prototype.componentDidMount = function () {
_super.prototype.componentDidMount.call(this);
this.initializeContent();
};
IgrFinancialLegend.prototype.initializeContent = function () {
this._elRef.appendChild(this.container.getNativeElement());
};
IgrFinancialLegend.prototype.destroy = function () {
this._wrapper.destroy();
this.i.provideContainer(null);
};
IgrFinancialLegend.prototype.createImplementation = function () {
return new Legend();
};
Object.defineProperty(IgrFinancialLegend.prototype, "i", {
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgrFinancialLegend.prototype, "isFinancial", {
/**
* Gets if the legend is a financial legend.
*/
get: function () {
return this.i.isFinancial;
},
enumerable: false,
configurable: true
});
return IgrFinancialLegend;
}(IgrLegendBase));
export { IgrFinancialLegend };