How to create a polynomial trendline in javascript?

TeeChart for JavaScript for the HTML5 Canvas
Post Reply
myTeeChart219
Newbie
Newbie
Posts: 6
Joined: Tue Apr 11, 2017 12:00 am

How to create a polynomial trendline in javascript?

Post by myTeeChart219 » Mon May 15, 2017 8:51 am

Hi
Is it possible to call the teechart functions in Javascript - I've read Tutorial 7 which shows it for Java but I'can't work out how to do this in javascript. I'm looking to do something like this but I can't get it to work:

Please help. Thank you.

Code: Select all

function draw() {
        Chart1=new Tee.Chart("canvas");

[b]        var p = new Tee.Line();
        p.data.values = [5, 7, 9];
        p.data.x = [0.23, 14, 16];
       Chart1.addSeries(p);

        polyFitting1 = new Steema.TeeChart.Functions.PolyFitting;
        fastLine1 As New Steema.TeeChart.Styles.FastLine;
        fastLine1.DataSource = series;
        fastLine1.VertAxis = series.VertAxis;
        polyFitting1.PolyDegree = 3;
        fastLine1.Function = polyFitting1;
        fastLine1.ShowInLegend = True;
        Chart1.Series.Add(fastLine1);
[/b]
  Chart1.axes.left.title.text="Y";

  Chart1.series.items[0].marks.drawEvery=120;

  Chart1.title.text="TeeChart for JavaScript";
  Chart1.title.format.font.style="18px Verdana";

  Chart1.title.format.font.gradient.visible=true;

  Chart1.draw();
}

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: How to create a polynomial trendline in javascript?

Post by Yeray » Mon May 15, 2017 10:45 am

Hello,

A similar question was replied some time ago here:
http://www.teechart.net/support/viewtop ... 671#p70671
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply