Hi. I expect someone could help me.
I have created a multilevel drilldown chart following this topic:
https://github.com/vaadin/charts/blob/master/examples/src/main/java/com/vaadin/addon/charts/examples/columnandbar/ColumnWithNativeLazyDrilldownByIndex.java
I’ve modified this code to add a superlevel of “Browser brands” serie. The new structure of drilldown chart is next:
- Year 2015
[list=1]
- MSIE
[list=1]
- MSIE 4.0
- MSIE 5.0
[/list] - Firefox
[list=1]
- Firefox 1.0
- Firefox 1.5
[/list]
[/list] - Year 2016
[list=1]
- MSIE
[list=1]
- MSIE 6.0
- MSIE 7.0
- MSIE 8.0
- MSIE 9.0
[/list] - Firefox
[list=1]
- Firefox 2.0
- Firefox 3.0
[/list]
[/list]
It works fine, but what I want is to change the title or subtitle of the chart in order to follow the path of charts (like breadcrumbs in web pages). For example, if I’m watching a chart where all 2016-MSIE are shown (MSIE 6.0, 7.0, 8.0), I would like to see in subtitle chart this text:
“You are in: Year 2016 > MSIE” but if I return to Year 2016 chart, the text should change to: “You are in: Year 2016”.
With this code:
List<String> breadcrumb = new ArrayList<String>();
chart.setDrilldownCallback(new DrilldownCallback() {
@Override
public Series handleDrilldown(DrilldownEvent event) {
Series ss = getPointDrilldown(event.getItemIndex());
conf.setSubTitle(ss.getName());
breadcrumb.add(ss.getName());
chart.drawChart();
return ss ;
}
});
chart.addChartDrillupListener(new ChartDrillupListener() {
@Override
public void onDrillup(ChartDrillupEvent event) {
String subtitle = breadcrumb.get(breadcrumb.size() - 2);
breadcrumb.remove(breadcrumb.size() - 1);
conf.setSubTitle(subtitle);
chart.drawChart();
}
});
I get subtitle changes when drilldown, but in leaf level, when I click DrillupButton, the navigation changes to the first chart directly, where years 2015-2016 appears. If I remove all chart.drawChart() methods, the navigations works fine but subtitle doesn’t change.
What I would like to know is if there is a method like refresh() or similar way to get change subtitle with a correct navigation of charts. I have proved with chart.MarkasDirty(), but it doesn’t work.
Thanks for all. Best regards.
AlfaGavi