super(valueProperty, labelProperty);
}
@Override
public void populateData(ChartConfig config) {
LineChart chart = (LineChart) config;
chart.getValues().clear();
XAxis xAxis = null;
if (labelProperty != null) {
xAxis = chart.getModel().getXAxis();
if (xAxis == null) {
xAxis = new XAxis();
chart.getModel().setXAxis(xAxis);
}
xAxis.getLabels().getLabels().clear();
}
for (ModelData m : store.getModels()) {
Object v = m.get(valueProperty);
Number n = v instanceof String ? Double.parseDouble((String) v) : (Number) v;
if (n == null) {
n = 0;
}
chart.addValues(n);
minYValue = Math.min(minYValue, n.doubleValue());
maxYValue = Math.max(maxYValue, n.doubleValue());
if (xAxis != null) xAxis.addLabels(getLabel(m, valueProperty));
}
}