Page 1 of 1

How to create a polynomial trendline in javascript?

Posted: Mon May 15, 2017 8:51 am
by 17780715
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();
}

Re: How to create a polynomial trendline in javascript?

Posted: Mon May 15, 2017 10:45 am
by yeray
Hello,

A similar question was replied some time ago here:
http://www.teechart.net/support/viewtop ... 671#p70671