I can’t get Visualizations API add-on AnnotatedTimeline to work.
Anyone has a basic example of this visualization working?
This doesn’t work:
Window mainWindow = new Window("Mytimelinedemo Application");
setMainWindow(mainWindow);
AnnotatedTimeLine timeLine = new AnnotatedTimeLine();
timeLine.setWidth(300, Sizeable.UNITS_PIXELS);
timeLine.setHeight(300, Sizeable.UNITS_PIXELS);
timeLine.addColumn("date", "Date");
timeLine.addColumn("number", "Sold Pencils");
timeLine.addColumn("string", "title1");
timeLine.addColumn("string", "text1");
timeLine.addColumn("number", "Sold Pens");
timeLine.addColumn("string", "title2");
timeLine.addColumn("string", "text2");
String[][]
ss = new String[][]
{
{ new Date(2008, 1, 1).toString(), 30000 + " ", " ", " ",
40645 + " ", " ", " " },
{ new Date(2008, 1, 2).toString(), 14045 + " ", " ", " ",
20374 + " ", " ", " " },
{ new Date(2008, 1, 3).toString(), 55022 + " ", " ", " ",
50766 + " ", " ", " " },
{ new Date(2008, 1, 4).toString(), 75284 + " ", " ", " ",
14334 + " ", "Out of Stock",
"Ran out of stock on pens at 4pm" },
{ new Date(2008, 1, 5).toString(), 41476 + " ", "Bought Pens",
"Bought 200k pens", 66467 + " ", " ", " " },
{ new Date(2008, 1, 6).toString(), 33322 + " ", " ", " ",
39463 + " ", " ", " " } };
for (String[] s : ss) {
timeLine.addRow(s);
}
mainWindow.addComponent(timeLine);