Skip to main content
17-Peridot
March 4, 2024
Solved

Linnear regression in scatter plot

  • March 4, 2024
  • 1 reply
  • 2613 views

Hello Community,

 

I was wondering if there is any way of "showing" linnear regression in a chart line?

I can only find the "HideLines" property on the line chart (scatter plot type) widget.

 

Here is an example using the g2plot library for further explanation:  https://g2plot.antv.antgroup.com/en/examples/scatter/scatter/#line

 

Regards,

Jens C

Best answer by Rocko

Jens, I have to roll back. Combo Chart isn't what I thought it was 😞 I was misled by the picture in the help, but you can't a line chart and a scatter plot into the same chart with it, sorry.

1 reply

Rocko
19-Tanzanite
March 4, 2024

Hi Jens, is the goal to show the points and the regression line in one chart?

Then you would have to use the Combo Chart, if your version already has it. The Line chart widget can only show splines.

In the combo chart, you would have to provide the data for the regression line as well as the chart won't compute this on its own.

jensc17-PeridotAuthor
17-Peridot
March 4, 2024

Hello @Rocko,

 

Yes, essentially I think that is what we would like.
Like this:

jensc_0-1709557847716.png

I did have a look in the Combo Chart documentation you linked, and the screenshot there doesn't exactly look like what we'd like. But perhaps we can work with it.
However, my 9.3.8 platform does not seem to include this widget... Is it something additional we need to install?

 

Regards,

Jens C.

 

Rocko
19-Tanzanite
March 4, 2024

I'm afraid it's a feature of TWX 9.4+ only...