urgrund commented on issue #4005: URL: https://github.com/apache/echarts/issues/4005#issuecomment-1624512594
I think since it's marked as 'Closed' no one from eCharts team will look at this? _(even though the CSS suggestion doesn't address the requested functionality)_ There is some really long winded approach that I got half working but abandoned - create a relatively positioned div that fills the same area are your chart div - make the padding match the grid of your chart _(if all you wanted was a static background, you can stop here)_ - hook into the 'onzoom' callback of a zoom in your echart - use the values of the zoom _(annoyingly the zoom data changes if it were a mousewheel or a drag even though ultimately they are just percentages)_ to feed back into the image div and manipluate image background of the div. Something like ``` chartContainer.style.backgroundSize = (100 / zoomX) + '% ' + (100 / zoomY) + '%'; chartContainer.style.backgroundPosition = (-offsetX / zoomX) + 'px ' + (-offsetY / zoomY) + 'px'; ``` It was too convoluted to get it finished though - if eCharts simply allowed an image as well as svg for backgrounds in scatter/map type charts this would solve it :) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
