我正在使用pieGraph,并根据单击饼图进行一些页面交互。这些工作得很好。
<dvt:pieGraph id="graph1" tabularData="#{dc.bean.tabularData}" dataSelection="single"
selectionListener="#{dc.bean.transfersGraphSelectionListener}"/>
但是我无法支持以下用例
- 在图表外部单击(或再次单击选定的数据集)应该会导致饼图失去其选择。
- 页面上有一个清晰的按钮,强制图表丢失其当前选择。
- 以编程方式选择图形中的一个数据集
我检查了UIGraph API,但找不到太多信息。
任何提示都会非常有帮助。
请将正确的代码添加到您的原始帖子中。 这就是您的代码的样子
transfersGraphSelectionListener(SelectionEvent selectionEvent){
Set<GraphSelection> selectionSet = selectionEvent.getGraphSelection();
for (GraphSelection selection : selectionSet) {
if (selection instanceof DataSelection) {
DataSelection ds = (DataSelection) selection;
Set seriesKeySet = ds.getSeriesKey().keySet();
for (Object key : seriesKeySet) {
Object selectedKey = ds.getSeriesKey().get((String) key))
}
好像少了点什么!