2

如何从图表中删除点p:lineChart并将图表绘制为实线?

谢谢

4

2 回答 2

5

对于其他有类似问题的人,我做了:

<p:chart type="line" model="#{myController.model}"/>

和:

LineChartSeries serie = new LineChartSeries();
serie.setShowMarker(false);

并且工作正常。我正在使用 PrimeFaces 5.1。

于 2016-01-13T15:19:47.047 回答
1

有一个showMarkers属性对我不起作用(我使用的是 PrimeFaces 3.4.2),但我找到了隐藏它们的方法。

这有点hacky,我让它在展示中工作,你只需要用widget_category图表的小部件替换。如果您的网络浏览器允许,您甚至可以使用 javascript 控制台从展示中在线测试它(在 chromium 下测试):

// loop through the series
for (var i = 0; i < widget_category.cfg.series.length; ++i) {
    // Hide markers
    widget_category.cfg.series[i].showMarker = false;
    // I'm not sure you want this when talking about 'continuous line'
    // but you can make your chart smooth this way :
    widget_category.cfg.series[i].rendererOptions = { smooth: true };
}

// Ask a refresh using the modified configuration object
widget_category.refresh(widget_category.cfg);
于 2013-04-06T12:15:06.737 回答