Hi Syncfusion Team
I created a react project with linear gauge and run as a docker image. Everytime i use setAnnotationValue method, there will be an error:
TypeError: Cannot set properties of undefined (setting 'content')
at t.setAnnotationValue (linear-gauge.js: 850)
This only happens only when is on docker.
Please assist
Regards
Amanda
Hi Indumathi
I try to create a sample. When click on the + sign, the same error occurred. Please refer to link below:
Sample: https://codesandbox.io/s/suspicious-http-9d77p?file=/src/App.tsx
Thanks
Regards
Amanda
Hi Indumathi
I didnt realize that the link i sent you is empty. I just paste the code below instead:
When click on +, the error message will show up
Regards
Amanda
|
const toggleSet = () => {
data.forEach((item: any, index: number) => {
if (linearRef.current !== null) {
linearRef.current.setAnnotationValue(index, item.content, index);
}
});
};
<LinearGaugeComponent> <Inject services={[Annotations]} />
<AnnotationsDirective>
{data.map((item) => (
<AnnotationDirective
content=""
zIndex="1"
></AnnotationDirective>
))}
</AnnotationsDirective>
</LinearGaugeComponent> |