JavaFX LineChart Performance

前端 未结 4 1940
隐瞒了意图╮
隐瞒了意图╮ 2021-02-02 17:47

I\'ve been trying to improve the performance of LineChart in JavaFX but without great success. I also have found that this seems to be a common problem that some programmers hav

4条回答
  •  时光说笑
    2021-02-02 18:18

    What is improving the performance of charts with many data points, is to remove the 'shape' of the data points.

    Over css for example:

    .chart-line-symbol {
        -fx-shape: "";
    }
    

    or to make sure it's not visible at all:

    .chart-line-symbol {
       -fx-background-insets: 0,0;
       -fx-background-radius: 0px; 
       -fx-padding: 0px;
       -fx-shape: "";
       -fx-background-color: transparent;
    }
    

    Another approach is to remove some data points from your chart. So for example only use every 3. datapoint or calculate the average of multiple data points.

提交回复
热议问题