use of io.jmix.ui.data.impl.MapDataItem in project jmix-docs by Haulmont.
the class MapDataItemScreen method onInit.
@Subscribe
protected void onInit(InitEvent event) {
ListDataProvider dataProvider = new ListDataProvider();
dataProvider.addItem(new MapDataItem(ImmutableMap.of("value", 75, "description", "Sky")));
dataProvider.addItem(new MapDataItem(ImmutableMap.of("value", 7, "description", "Shady side of pyramid")));
dataProvider.addItem(new MapDataItem(ImmutableMap.of("value", 18, "description", "Sunny side of pyramid")));
chart.setDataProvider(dataProvider);
// end::map-data-item[]
}
use of io.jmix.ui.data.impl.MapDataItem in project jmix-docs by Haulmont.
the class PolarChart method onInit.
@Subscribe
protected void onInit(InitEvent event) {
ListDataProvider dataProvider = new ListDataProvider();
dataProvider.addItem(new MapDataItem().add("direction", "N").add("value", 8.0));
dataProvider.addItem(new MapDataItem().add("direction", "NE").add("value", 9.0));
dataProvider.addItem(new MapDataItem().add("direction", "E").add("value", 4.5));
dataProvider.addItem(new MapDataItem().add("direction", "SE").add("value", 3.5));
dataProvider.addItem(new MapDataItem().add("direction", "S").add("value", 9.2));
dataProvider.addItem(new MapDataItem().add("direction", "SW").add("value", 8.4));
dataProvider.addItem(new MapDataItem().add("direction", "W").add("value", 11.1));
dataProvider.addItem(new MapDataItem().add("direction", "NW").add("value", 10.0));
polarChart.setDataProvider(dataProvider);
}
use of io.jmix.ui.data.impl.MapDataItem in project jmix-docs by Haulmont.
the class SerialChartJsonTitleTwo method graphData.
private DataItem graphData(int value) {
MapDataItem item = new MapDataItem();
item.add("value", value);
return item;
}
use of io.jmix.ui.data.impl.MapDataItem in project jmix-docs by Haulmont.
the class StackedareaChart method transportCount.
private DataItem transportCount(int year, int cars, int motorcycles, int bicycles) {
MapDataItem item = new MapDataItem();
item.add("year", year);
item.add("cars", cars);
item.add("motorcycles", motorcycles);
item.add("bicycles", bicycles);
return item;
}
use of io.jmix.ui.data.impl.MapDataItem in project jmix by jmix-framework.
the class GanttChartLoader method loadChartData.
@Override
protected void loadChartData(ChartModel chart, Element element) {
Element dataSet = element.element("data");
if (dataSet != null) {
ListDataProvider listDataProvider = new ListDataProvider();
for (Object item : dataSet.elements("item")) {
Element itemElement = (Element) item;
MapDataItem dataItem = new MapDataItem();
for (Element property : itemElement.elements("property")) {
if (property.elements().size() > 0) {
List<MapDataItem> innerItems = new ArrayList<>();
for (Object innerItem : property.elements("item")) {
Element innerItemElement = (Element) innerItem;
MapDataItem innerDataItem = new MapDataItem();
for (Element innerProperty : innerItemElement.elements("property")) {
innerDataItem = loadDataItem(innerProperty, innerDataItem);
}
innerItems.add(innerDataItem);
}
dataItem.add(property.attributeValue("name"), innerItems);
} else {
dataItem = loadDataItem(property, dataItem);
}
}
listDataProvider.addItem(dataItem);
chart.setDataProvider(listDataProvider);
}
}
}
Aggregations