0

I have an app where the user is given plenty of options, and depending on user selection anything from 1 up to 20 scatter plots will be displayed dynamically in the same scatter chart.

I want to add a checkbox to show best fits for each of these samples, same color as the original scatter points, but then using lines.

Even though I like the answer provided here, it solves the problem "statically", i.e. for small and fix number of series.

Is there a way to automate this solution for a large and dynamically changing number of series?

I'd rather not use superimposed charts and setting transparency, unless I really have to.

Raf
  • 1,628
  • 3
  • 21
  • 40
  • 1
    You can use the techniques in my answer to [this question[(https://stackoverflow.com/questions/38871202/how-to-add-shapes-on-javafx-linechart) to add lines to a scatter chart. – James_D Sep 18 '17 at 13:44

1 Answers1

1

As you pointed out about this here , if you want to create a Scatter chart with line regression ( linear or polynomial ) have a look to my own implementation of a Multi-Axis-Scatter-Chart maybe you will take some ideas about your problem. I am not sure about what you need cause do be honest I didn't understand your question at 100%. I hope my own implementation might help you somehow.

JKostikiadis
  • 2,847
  • 2
  • 22
  • 34
  • Thanks. Interesting library! Even though I'm not really interested in multi-y-axis charts, your example `chart.showLinearTrendLineOnAxis()` do what I'm after - scatter + line charts. Apparently the trend lines are a fine scatter plot drawing directly to canvas in `MultiAxisScatterChart.drawPoint`. Is that correct? – Raf Sep 18 '17 at 10:19
  • To hide the second Y-Axis, would be very easy thing to do ;). The library logic is as you said. Indeed the trend lines are consecutive "points" drawn to the canvas. Giving the illusion of a line or a curve. If you need any help just ask me. It's an old project of mine but i am sure i can help you with ;) – JKostikiadis Sep 18 '17 at 10:33