I am using following code -
Chart chart1 = uiComponents.create(Chart.class);
BarSeries bar = new BarSeries();
chart1.addSeries(bar);
chart1.addXAxis(new XAxis().withAxisLabel(new AxisLabel().withFormatter("{dd}-{MM}-{yy}")));
chart1.addYAxis(new YAxis().withAxisLabel(new AxisLabel().withFormatter("{value}")));
chart1.setTitle(new Title().withText("Observation By Time"));
chart1.withTooltip(new Tooltip());
chart1.setWidth("100%");
chart1.setHeight("100%");
chart1.setDataSet(
new DataSet().withSource(
new DataSet.Source<EntityDataItem>()
.withDataProvider(new ContainerChartItems<>(bBSObservationsDc))
.withCategoryField("date")
.withValueFields("totalUnsafe")
)
);
The result i am getting -
Here category file is date type.
Am I missing something? Please give code of time formatter which is working.
Thanks