Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Mattias
 
Posts: n/a
Default How do I get the trendline equation from Excel to script?

Hi!
I want to display a bargraph including a trendline on the Internet
(using an asp-page). It doesn't matter what I use to display it. I
have found some graph-components (for example FusionCharts 2.2) that
seems ok.

First: What is the easiest way to go?
1. Calculate the trendline values (with vbscript or javascript) and
using a graphcomponent
2. or using a excelcomponent and somehow manipulate it to show the
graphs (bargraph and trendline) that I want.

IF 1: Then the problem I have is that I can not figure out how to
calculate the trendline values.

I have found a page (http://www.j-walk.com/ss/excel/tips/tip101.htm)
that has some code used in Excel (see below). But the INDEX, LINEST
functions doesn't work in vbscript.
__________________________________________________ ____
Logarithmic Trendline
Equation: y = (c * LN(x)) - b

c: =INDEX(LINEST(y,LN(x)),1)

b: =INDEX(LINEST(y,LN(x)),1,2)

Power Trendline
Equation: y=c*x^b

c: =EXP(INDEX(LINEST(LN(y),LN(x),,),1,2))

b: =INDEX(LINEST(LN(y),LN(x),,),1)
__________________________________________________ ____

IF 2: I am not very used to excel-programming so how can I do this
trendline using a component? Oh, the person that will see this graph
does not have the excel program.

Best regards,
Mattias in Sweden
  #2   Report Post  
John Mansfield
 
Posts: n/a
Default

Mattias,

My suggestion would be to keep the graph inside of an Excel workbook. You
can compute the components of the trend using the formulas that you've
documented using Excel's regular workbook functions.

Once your graph with trend is created inside of the workbook, you can then
save the graph as a picture and upload it to your site. Saving the graph at
a picture and then uploading the picture to the web can be automated using
VBA. Jon Peltier at:

http://www.peltiertech.com

has some good information on transferring Excel charts to PowerPoint
presentations. The same concepts can be used for transferring files to the
web.

Another option might be to save the sheet containing the graph as a web page
and then linking that page to your site. I've not done a whole lot of work
in this area - just another possible suggestion.


"Mattias" wrote:

Hi!
I want to display a bargraph including a trendline on the Internet
(using an asp-page). It doesn't matter what I use to display it. I
have found some graph-components (for example FusionCharts 2.2) that
seems ok.

First: What is the easiest way to go?
1. Calculate the trendline values (with vbscript or javascript) and
using a graphcomponent
2. or using a excelcomponent and somehow manipulate it to show the
graphs (bargraph and trendline) that I want.

IF 1: Then the problem I have is that I can not figure out how to
calculate the trendline values.

I have found a page (http://www.j-walk.com/ss/excel/tips/tip101.htm)
that has some code used in Excel (see below). But the INDEX, LINEST
functions doesn't work in vbscript.
__________________________________________________ ____
Logarithmic Trendline
Equation: y = (c * LN(x)) - b

c: =INDEX(LINEST(y,LN(x)),1)

b: =INDEX(LINEST(y,LN(x)),1,2)

Power Trendline
Equation: y=c*x^b

c: =EXP(INDEX(LINEST(LN(y),LN(x),,),1,2))

b: =INDEX(LINEST(LN(y),LN(x),,),1)
__________________________________________________ ____

IF 2: I am not very used to excel-programming so how can I do this
trendline using a component? Oh, the person that will see this graph
does not have the excel program.

Best regards,
Mattias in Sweden

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto date changing in Excel is maddening brhicks Charts and Charting in Excel 3 December 16th 04 03:54 PM
Excel 97 chart opened in Excel 2003 - Source Data problem DHunt Charts and Charting in Excel 0 December 6th 04 09:05 PM
Fonts get size 1 and can't be changed after a procedure - even by excel GUI!! Marie J-son Charts and Charting in Excel 2 December 6th 04 05:11 AM
Excel 2003 BLG Charts and Charting in Excel 1 December 3rd 04 03:15 PM
Trendline error??? Eugepticus Charts and Charting in Excel 3 November 30th 04 05:40 AM


All times are GMT +1. The time now is 07:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"