getPosition method
Converts a data value to a pixel position using the scale.
Implementation
double getPosition(dynamic value) {
try {
final result = scale(value);
if (result is double) return result;
if (result is num) return result.toDouble();
return 0;
} catch (_) {
return 0;
}
}