Object y = p.getY();
// the first point determine type of data model
if (model == null) {
if (x instanceof Number && y instanceof Number) {
model = new NumberChartDataModel(type);
} else if (x instanceof String && y instanceof Number) {
model = new StringChartDataModel(type);
} else {
throw new IllegalArgumentException("Not supported type");
}