Hi thank you for resounding to other questions,
I have having a strange issue. When I add the ScatterRenderableSeries3D to a surface3D, the tooltip3D works. when I add more ScatterRenderableSeries3D it still works. but if I only update the xyzdataseries then the tooltip stops working.
Please see the code below,
props.data.map(annotationData => {
//console.log(annotationData)
if (!sciChart3DSurfaceRef.current.renderableSeries.getById(annotationData?.id)) {
if (annotationData.x.length > 0) {
//console.log("creating data", annotationData)
sciChart3DSurfaceRef.current.renderableSeries.add(new ScatterRenderableSeries3D(wasmContextRef.current, {
id: annotationData.id,
dataSeries: new XyzDataSeries3D(wasmContextRef.current, {
xValues: annotationData.x,
yValues: annotationData.y,
zValues: annotationData.z,
metadata: annotationData.metadata // Optional metadata here. Property vertexColor is read to color the point,
}),
// When metadata colours are provided, the pointMarker.fill is ignored
pointMarker: new SpherePointMarker3D(wasmContextRef.current, {
size: 2.0,
}),
opacity: 0.7
}));
}
}
else {
console.log("setting data", annotationData)
const dataSeries = new XyzDataSeries3D(wasmContextRef.current, {
xValues: annotationData.x,
yValues: annotationData.y,
zValues: annotationData.z,
metadata: annotationData.metaata // Optional metadata here. Property vertexColor is read to color the point,
})
//console.log(sciChart3DSurfaceRef.current.renderableSeries.getById(annotationData.id))
sciChart3DSurfaceRef.current.renderableSeries.getById(annotationData.id).dataSeries = dataSeries
}
})
When a new renderableSeries is added, the tooltip3d on that data works great! but if I add new dataseries like in else statement the tooltip3d disappears.
Any help is appreciated.
Pramod
- pramod butte asked 8 months ago
- You must login to post comments
I think you just have a typo in annotationData.metaata when creating the new DataSeries.
More importantly, you are leaking memory by replacing the dataSeries like this. You either need to call
sciChart3DSurfaceRef.current.renderableSeries.getById(annotationData.id).dataSeries.delete()
before setting the new series, or better, reuse the existing series by clearing it and then using appendRange.
const dataSeries = sciChart3DSurfaceRef.current.renderableSeries.getById(annotationData.id).dataSeries;
dataSeries.clear();
dataSeries.appendRange(annotationData.x, annotationData.y, annotationData.z, annotationData.metadata);
Regards
David
- David Burleigh answered 8 months ago
- You must login to post comments
Hello,
I was having the same problem, though my code was a little different. The tooltip works fine with static data and disappears when i update my data with an interval. Code below is how i update the chart.
useEffect(() => {
if (xyzSeriesRef.current) {
const itemCount = xyzSeriesRef.current.count();
if (dots.x.length <= itemCount) return;
xyzSeriesRef.current.appendRange(
dots.x.slice(itemCount),
dots.y.slice(itemCount),
dots.z.slice(itemCount)
);
}
}, [dots]);
I have a state in my parent component and just pass it down to my chart. It updates the chart as expected but the tooltip stops working. Couldn’t figure out whats wrong.
- Yiğit Arısoy answered 7 months ago
- last edited 7 months ago
-
Hard to tell without a context. Please create a new topic and provide an example we can run to reproduce the issue. Preferably via CodeSandbox or CodePen. This way we would be able to quickly confirm and identify whether there is a bug in the lib functionality.
- You must login to post comments
Please login first to submit.