scichart
Version: 
Fast WebGL JavaScript Charting Library and Framework
110 lines (109 loc) • 4.21 kB
TypeScript
import { EventHandler } from "../../Core/EventHandler";
import { EChart3DModifierType } from "../../types/ChartModifierType";
import { IThemeProvider } from "../../Charting/Themes/IThemeProvider";
import { ILegendOptionsBase } from "../../Charting/Visuals/Legend/SciChartLegendBase";
import { IRenderableSeries3D } from "../Visuals/RenderableSeries/BaseRenderableSeries3D";
import { ChartModifierBase3D, IChartModifierBase3DOptions } from "./ChartModifierBase3D";
import { SciChart3DLegend } from "../../Charting/Visuals/Legend/SciChart3DLegend";
/**
 * Optional parameters used to configure a {@link LegendModifier3D} at construct time
 */
export interface ILegendModifier3DOptions extends IChartModifierBase3DOptions, ILegendOptionsBase {
    /**
     * Sets whether the legend has visibility checkboxes in it or not
     */
    showCheckboxes?: boolean;
    /**
     * Sets whether Series markers are visible or not
     */
    showSeriesMarkers?: boolean;
    /**
     * Callback when a legend item checkbox is checked or unchecked (by default, this corresponds to {@link IRenderableSeries3D.isVisible}
     * @param series
     * @param isChecked
     */
    isCheckedChangedCallback?: (series: IRenderableSeries3D, isChecked: boolean) => void;
    /**
     * Set this only if you need to pass in a custom legend instance.
     * showCheckboxes, showSeriesMarkers and isCheckedChangedCallback will be set on the instance you pass if specified in the options.
     */
    legend?: SciChart3DLegend;
}
/**
 * Type args for the {@link LegendModifier3D.isCheckedChanged} callback
 */
export declare type TCheckedChangedArgs = {
    /**
     * The series which was checked or unchecked
     */
    series: IRenderableSeries3D;
    /**
     * Whether the corresponding legend item is checked or not (by default, this corresponds to {@link IRenderableSeries3D.isVisible})
     */
    isChecked: boolean;
};
/**
 * The LegendModifier3D provides interactive legend behavior on a 3D {@link SciChart3DSurface}
 * within SciChart - High Performance {@link https://www.scichart.com/javascript-chart-features | JavaScript Charts}
 * @remarks
 *
 * To apply the LegendModifier3D to a {@link SciChart3DSurface} and add tooltip behavior,
 * use the following code:
 *
 * ```ts
 * const sciChartSurface: SciChart3DSurface;
 * sciChartSurface.chartModifiers.add(new LegendModifier3D());
 * ```
 *
 * ---
 * 📚 Docs: todo
 */
export declare class LegendModifier3D extends ChartModifierBase3D {
    private readonly _legendOptions;
    readonly type: EChart3DModifierType;
    /**
     * Gets the {@link SciChart3DLegend} control used to render the legend
     */
    sciChart3DLegend: SciChart3DLegend | undefined;
    /**
     * An event handler raised when a {@link SciChart3DLegend} row checkbox is checked or unchecked
     */
    readonly isCheckedChanged: EventHandler<TCheckedChangedArgs>;
    /**
     * Creates an instance of the LegendModifier3D
     * @param options Optional parameters {@link ILegendModifier3DOptions} used to configure the modifier
     *
     * ---
     * 📚 Docs: todo
     */
    constructor(options?: ILegendModifier3DOptions);
    private applyLegendOptions;
    /** @inheritDoc */
    applyTheme(themeProvider: IThemeProvider): void;
    /** @inheritDoc */
    onParentSurfaceRendered(): void;
    /** @inheritDoc */
    onAttach(): void;
    /** @inheritDoc */
    onDetach(): void;
    /** @inheritDoc */
    includeSeries(series: IRenderableSeries3D, isIncluded: boolean): boolean;
    /**
     * Tests if the series is included or excluded
     */
    testIsIncludedSeries(series: IRenderableSeries3D): boolean;
    /** @inheritDoc */
    toJSON(): {
        type: string;
        options: Required<Omit<IChartModifierBase3DOptions, never>>;
    };
    /** @inheritDoc */
    delete(): void;
    /**
     * Callback called from inner {@link SciChart3DLegend} when a checkbox is checked or unchecked
     * @param series
     * @param isChecked
     * @protected
     */
    protected legendItemCheckedChanged(series: IRenderableSeries3D, isChecked: boolean): void;
}