Skip to content

Unexpected Application Error! Value is null when remove pane #1938

@jabori-mao

Description

@jabori-mao

Lightweight Charts™ Version: 5.0.8

Steps/code to reproduce:
I create chart using chart config loaded from backend.
the config like this:

export type ChartConfig = {
	id: number;
	chartName: string;
	klineChartConfig: KlineChartConfig;
	indicatorChartConfigs: IndicatorChartConfig[];

export type IndicatorChartBaseConfig = {
	isInMainChart: boolean; // isInMainChart
	seriesConfigs: SeriesConfig[];
}


export type IndicatorChartConfig = IndicatorChartBaseConfig & {
	chartId: ChartId; // chartId
	indicatorKeyStr: IndicatorKeyStr; // indicatorKeyStr
	isDelete: boolean; // isDelete
};
	
};
Image

you can see I have a DELETE button in Pane Legend.

when click delete button, the logic is:

  1. delete indicatorChartConfig item from Array.
  2. use chartApi.removePane() to remove pane.

At this point an error occurred.

Image Image

Then, I tried adding the "isDelete" field, not actually deleting it. When click delete button ,set isDelete to true. (When rendering, configurations whose isDelete field is equal to true are filtered.)
Still got the same error.

When only calling chartApi.removePane() and not change config, the pane is remove correctly. But I can't save the error result to backend.

How can I properly delete the Pane and also delete the configuration.

If need more detail, please tell me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions