单击图表上的任意位置时,Primefaces 图表弹出窗口变大?

Primefaces chart popup bigger when click anywhere on the chart?

我知道有一个交互式图表,用于单击条形图或饼图元素以弹出更多信息。但是我希望当我点击图表内的任何地方时,它会弹出一个新的 window 来显示更大的图表视图。有什么建议吗? 我尝试使用弹出 window 但我使用 for 循环来显示我的图表,该对话框无法显示正确的图表(它显示列表中的最新图表并且不包含值)。这是我所做的:

<c:forEach  items="${dashboardBean.barModel}" var="barChart">
                                <p:column>
                            <p:chart type="bar" model="#{barChart}" style="height:400px">
                                <p:commandButton type="button" value="Export"
                                                 onclick="PF('dlg1').show();"/>
                                    </p:chart>
                                <p:dialog widgetVar="dlg1"
                                          height="450px" width="800px" >
                                    <p:chart type="bar" model="#{barChart}"/>
                                </p:dialog>
                                </p:column>
                            </c:forEach>

弹出式图表如下所示:

谢谢,

100% 未经测试,所以把它当作一个想法。在 bean 上使 selectedBarChart 成为 属性。

<c:forEach  items="${dashboardBean.barModel}" var="barChart">
    <p:column>
        <p:chart type="bar" model="#{barChart}" style="height:400px">
            <p:commandButton value="Export" update=":dlg1" oncomplete="PF('dlg1').show();">
                <f:setPropertyActionListener target="#{dashboardBean.selectedBarChart}" value="#{barChart}" />
            </p:commandButton>
        </p:chart>                         
    </p:column>
</c:forEach>

<p:dialog id="dlg1" widgetVar="dlg1" appendTo="@(body)" height="450px" width="800px" >
    <p:chart type="bar" model="#{dashboardBean.selectedBarChart}"/>
</p:dialog>

我觉得c:forEach一定要换成ui:repeat,但不确定