constructor()

in src/visualComponent/sparkline/svgComponent.ts [68:112]


    constructor(options: IVisualComponentConstructorOptions) {
        super();

        this.initElement(
            options.element,
            this.className,
            "svg",
        );

        this.constructorOptions = {
            ...options,
            element: this.element,
        };

        this.multiLineComponent = new MultiLineComponent(this.constructorOptions);
        this.axisComponent = new AxisComponent(this.constructorOptions);

        this.components = [
            this.multiLineComponent,
            this.axisComponent,
        ];

        this.dynamicComponents = [
            new DotsComponent(this.constructorOptions),
        ];

        this.constructorOptions.eventDispatcher.on(
            `${EventName.onCurrentDataPointIndexChange}.${this.className}.${this.constructorOptions.id}`,
            this.onCurrentDataPointIndexChange.bind(this),
        );

        this.constructorOptions.eventDispatcher.on(
            `${EventName.onCurrentDataPointIndexReset}.${this.className}.${this.constructorOptions.id}`,
            this.onCurrentDataPointIndexChange.bind(this),
        );

        this.element.on("mouseenter", (event) => {
            this.constructorOptions.eventDispatcher.call(
                EventName.onChartChangeHover,
                undefined,
                event,
                this.renderOptions && this.renderOptions.current && this.renderOptions.current.name
            );
        });
    }