How to create a polynomial trendline in javascript?

TeeChart for Javascript for the HTML5 Canvas

How to create a polynomial trendline in javascript?

Postby 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();
}
myTeeChart219
Newbie
Newbie
 
Posts: 6
Joined: Tue Apr 11, 2017 12:00 am

Re: How to create a polynomial trendline in javascript?

Postby Yeray » Mon May 15, 2017 10:45 am

Hello,

A similar question was replied some time ago here:
viewtopic.php?f=18&t=15918&p=70671#p70671
Best Regards,

ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image ImagePlease read our Bug Fixing Policy
Yeray
Site Admin
Site Admin
 
Posts: 8369
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia


Return to Javascript / HTML5

Who is online

Users browsing this forum: No registered users and 1 guest