local2Chart static method
MPPointF
local2Chart(
- Controller<
ChartPainter< controller,ChartData< >IDataSet< ?>Entry> > - double x,
- double y, {
- bool inverted = false,
Implementation
static MPPointF local2Chart(Controller controller, double x, double y,
{bool inverted = false}) {
ViewPortHandler vph = controller.painter!.viewPortHandler!;
double xTrans = x - vph.offsetLeft();
double yTrans = 0.0;
/// check if axis is inverted
if (inverted) {
yTrans = -(y - vph.offsetTop());
} else {
yTrans =
-(controller.painter!.getMeasuredHeight() - y - vph.offsetBottom());
}
return MPPointF.getInstance1(xTrans, yTrans);
}