You must be logged in to post your query.
Home › Forums › Chart Support › image overlay with React
I have found the solution! Using a candlestick chart can get x and y coordinates and apply to the image style in the componentDidMount method.
var imageXCoord = chart.axisX.convertValueToPixel(chart.data.dataPoints.x) – 15; // compensate for image width
var imageYCoord = chart.axisY.convertValueToPixel(chart.data.dataPoints.y);
var imageCircle = document.getElementById(“imagecircle”);
imageCircle.style.position = “absolute”;
imageCircle.style.width = “30px”;
imageCircle.style.left = imageXCoord + “px”;
imageCircle.style.top = imageYCoord + “px”;
imageCircle.style.zIndex = 1;
imageCircle.style.opacity = .5;
Glad that you figured it out :)
HI can you tell me what you did i have the same problems
Please take a look at this StackBlitz for an example on positioning image over chart in React.
You must be logged in to reply to this topic. Login/Register