deserialize method
Deserializes the FML template elements, attributes and children
Implementation
@override
void deserialize(XmlElement xml) {
//* Deserialize */
super.deserialize(xml);
/////////////////
//* Properties */
/////////////////
selected = Xml.get(node: xml, tag: 'selected');
animated = Xml.get(node: xml, tag: 'animated');
horizontal = Xml.get(node: xml, tag: 'horizontal');
showlegend = Xml.get(node: xml, tag: 'showlegend');
legendsize = Xml.get(node: xml, tag: 'legendsize');
type = Xml.get(node: xml, tag: 'type');
// Set Series
this.series.clear();
List<LineChartSeriesModel> series =
findChildrenOfExactType(LineChartSeriesModel)
.cast<LineChartSeriesModel>();
for (var model in series) {
// add the series to the list
this.series.add(model);
// register listener to the datasource
IDataSource? source =
(scope != null) ? scope!.getDataSource(model.datasource) : null;
if (source != null) source.register(this);
}
// Set Axis
List<ChartAxisModel> axis =
findChildrenOfExactType(ChartAxisModel).cast<ChartAxisModel>();
for (var axis in axis) {
if (axis.axis == ChartAxis.X) xaxis = axis;
if (axis.axis == ChartAxis.Y) yaxis = axis;
yMax = toInt(yaxis.max);
yMin = toInt(yaxis.min);
}
}