I am experimenting with setting up some options in this demonstration, and here is what I have managed to achieve so far.
testOptions: EChartsOption = Object.assign(
{},
{
backgroundColor: 'red',
tooltip: {
trigger: 'axis',
},
}
);
However, this is resulting in an error:
Error in src/echart.component.ts (20:3)
Type '{ backgroundColor: string; tooltip: { trigger: string; }; }' is not assignable to type 'EChartsOption'.
Types of property 'tooltip' are incompatible.
Type '{ trigger: string; }' is not assignable to type 'TooltipOption | TooltipOption[] | undefined'.
Type '{ trigger: string; }' is not assignable to type 'TooltipOption'.
Types of property 'trigger' are incompatible.
Type 'string' is not assignable to type '"axis" | "item" | "none" | undefined'.
According to the provided documentation, we should be able to assign the trigger
to axis
. Therefore, I am questioning whether this error is related to the EChartOption
type itself.