import * as React from 'react';
import { IgrLegendBase } from './igr-legend-base';
import { Legend } from "./Legend";
import { ReactRenderer } from "igniteui-react-core/ES2015/react-renderer";
import { DataChartStylingDefaults } from './DataChartStylingDefaults';
/**
 * Represents a legend that displays information about each series, most often used in financial charting.
*/
export class IgrFinancialLegend extends IgrLegendBase {
    render() {
        let div = React.createElement("div", {
            ref: this._getMainRef
        });
        return div;
    }
    _getMainRef(div) {
        this._elRef = div;
    }
    componentDidMount() {
        super.componentDidMount();
        this.initializeContent();
    }
    initializeContent() {
        this._elRef.appendChild(this.container.getNativeElement());
    }
    constructor(props) {
        super(props);
        let 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);
    }
    destroy() {
        this._wrapper.destroy();
    }
    createImplementation() {
        return new Legend();
    }
    get i() {
        return this._implementation;
    }
    /**
 * Gets if the legend is a financial legend.
*/
    get isFinancial() {
        return this.i.isFinancial;
    }
}
