How to combine scatter chart with line chart to show line of regression? JavaFX

后端 未结 4 739
小蘑菇
小蘑菇 2020-12-06 01:44

I\'ve created a scatter chart with two sets of data; the first set is the actual data (x = year and y = pence) and the second set produces the same points but for the line o

4条回答
  •  心在旅途
    2020-12-06 02:17

    An easier way might be just to use LineChart for all series and then add the below line for any series in which you don't want lines to be plotted. Line below changes series 0 to have no line but for other series you can simply change number (default-colourXX) to define which series.

    sc.lookup(".default-color0.chart-series-line").setStyle("-fxstroke: transparent");
    

    Very similar to @José Pereda but perhaps little easier than messing around with CSS files.

提交回复
热议问题