728x90
graph.getZr().on('click', function(params) {
var pointInPixel = [params.offsetX, params.offsetY];
var pointInGrid = graph.convertFromPixel('grid', pointInPixel);
axis = pointInGrid[0] +1
if (graph.containPixel('grid', pointInPixel)) {
selected_axis = difference_graph.getOption().dataset[0].source[axis][0]
console.log(selected_axis)
}
});
Reference
반응형