XChart icon indicating copy to clipboard operation
XChart copied to clipboard

Adding trendlines to bar and XY charts

Open meacod opened this issue 4 years ago • 4 comments

Hello,

Thanks for the great library, it's very useful!

One thing I've been scratching around for, but haven't seemed to find, is the ability to add a trendline through the graph that you render. Is this something you'd plan to add in? I'd find it very useful for showing trends on both line and bar charts.

meacod avatar Jun 23 '20 14:06 meacod

Is it like this: Screenshot_2020-06-24_09-56-26

You can refer to BarChart09.

Mr14huashao avatar Jun 24 '20 02:06 Mr14huashao

Not quite what I was getting at; consider something like the trendline feature in MS Excel / other alternatives are available.

I would imagine it might be a method call on say a Series or a ChartStyler to add a trendline / line of best fit on top of the provided data.

meacod avatar Jun 24 '20 02:06 meacod

Add a series, draw line and bar?

Mr14huashao avatar Jun 24 '20 04:06 Mr14huashao

No, XChart doesn't have that yet. You'd need to generate the trendline yourself and add a series. I'll leave this open as a feature request.

timmolter avatar Jun 26 '20 09:06 timmolter