Open WildOrangutan opened 4 years ago
My current workaround below, if it happens to help anyone. I created custom ChartBehevior
specifically for CartesianChart
.
// onAttach()
_chart = chart as CartesianChart;
chart.addGestureListener(listener);
chart.registerTappable(this);
// on callback from gesture listener
var xAxis = _chart.getMeasureAxis(axisId: Axis.primaryMeasureAxisId);
// var yAxis = _chart.domainAxis;
var xScale = xAxis.scale;
var xPx = pointPx.x;
var x = xScale.reverse(xPx);
Is it possible to have a callback, that's triggered by clicking anywhere on the chart, and also returns click position?
What I want to achieve, is to have a chart, where you could add points, by clicking on the chart.