[英]JavaFX Line Chart: Only display points for one of the XYChart.Series
我有一個最多包含3個XYChart.Series的折線圖(數學函數的圖形),在其中設置了createSymbols == false。
現在,我還需要顯示一系列點,但不顯示它們之間的連接線。
我該怎么做?
最好的祝福
編輯:代碼的一部分(創建繪圖並添加一個XYChart.Series)
LineChart<Number, Number> plot = new LineChart<Number,Number>(xAxis,yAxis);
plot.setCreateSymbols(false);
XYChart.Series xychartlint = new XYChart.Series();
xychartlint.setName("Lagrange Interpolation");
plot.getData().add(xychartlint);
for(double i = minx; i < maxx; i = i + 0.01){
xychartlint.getData().add(new XYChart.Data(i, lagrange.getY(i)));
}
編輯2我發現的解決方案:
使用css將系列的顏色更改為透明:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.