【发布时间】:2019-04-15 06:19:15
【问题描述】:
我在我的 android 应用程序中使用 hichart 折线图。 我正在设置数据并单击事件,它第一次工作是例外,但是当数据更改并且我更新图表时,图表会正确显示,但单击事件不起作用。
设置数据后,我正在调用 reload 方法,但问题仍然存在。
我是如何设置数据的:
// Click event
HIPlotOptions plotoptions = new HIPlotOptions();
plotoptions.setSeries(new HISeries());
HISeries series = plotoptions.getSeries();
plotoptions.getSeries().setLabel(new HILabel());
plotoptions.getSeries().getLabel().setConnectorAllowed(false);
plotoptions.getSeries().setPoint(new HIPoint());
plotoptions.getSeries().getPoint().setEvents(new HIEvents());
plotoptions.getSeries().getPoint().getEvents().setClick(new HIFunction(
f -> {
setValue(f.getProperty("x"), f.getProperty("y"));
}, new String[]{"x", "y"}
));
options.setPlotOptions(plotoptions);
// Setting data
HISeries line2 = new HISeries();
line2.setName(reportDto.getDates().get(0).getMaxBaselineDisplayName());
line2.setData(new ArrayList<>(list2));
line2.setColor(HIColor.initWithHexValue(chartOneColor));
options.setSeries(new ArrayList<>(Arrays.asList(line2)));
chartView.setOptions(options);
chartView.reload();
如果我遗漏了什么,请告诉我。
【问题讨论】:
标签: android highcharts dotnethighcharts