|
-
Apr 8th, 2002, 07:49 PM
#1
Thread Starter
Hyperactive Member
Graph troubles again
Hiya, just when I thought I had ms chart sussed too, sigh... :-)
I need to be able to plot a line of best fit on my graph, is that possible? could anyone tell me how it's done?
thanks for you time 
Ang
-
Apr 8th, 2002, 09:16 PM
#2
PowerPoster
I don't know how. It sounds like statistical something or other. I'll ask brother who may know. In the mean time, go to this link and see if you can find something under Statistics that helps you.
http://www.hoxie.org/math/title.htm
-
Apr 8th, 2002, 09:50 PM
#3
PowerPoster
argh .. mschart ...
i never had much success with that piece of crap ...
you can always do what you asked for with an excel reference if that is an option for you ...
-
Apr 9th, 2002, 05:14 PM
#4
Thread Starter
Hyperactive Member
how does that excel way work? that sounds handy
i found a way to get a line of best fit, using least squares blah. Had to look back to my old school stats :-). But anyway, now i am able to get the formula into a string, now the next fun part will be getting that on the graph.
stupid graphs :P
Ang
-
Apr 9th, 2002, 05:17 PM
#5
PowerPoster
I use the chart control and don't have problems with it. I just use it to display data though. In other words, the user can change the look and copy it to other applications, but I don't let them change values in the chart itself. It's read-only
-
Apr 9th, 2002, 05:19 PM
#6
PowerPoster
You'll have to remove some of my function calls, but I'm leaving them in this code because the names are self-explanatory and it will help you see what I did better.
VB Code:
Public Function GraphQuery() As Long
Dim i As Long
Dim j As Long
Dim RST As Recordset
Dim iRecordcount As Long
Dim iFieldCount As Long
On Error GoTo errHandler
Dim sData() As String
Set RST = DB.OpenRecordset(BASE_QUERY, dbOpenSnapshot)
iRecordcount = CountRecords(RST)
iFieldCount = RST.Fields.Count
If iFieldCount <= 0 Then Exit Function
If iRecordcount - 1 < 0 Then
MsgBox "No records to graph.", vbInformation, APP_TITLE
Exit Function
End If
ReDim sData(iFieldCount - 1, iRecordcount - 1)
For i = 0 To iFieldCount - 1
For j = 0 To iRecordcount - 1
sData(i, j) = RST.Fields(i).Value
RST.MoveNext
Next j
RST.MoveFirst
Next i
RecordsetClose RST
chtGraph.ChartData = sData
Exit Function
errHandler:
GraphQuery = Err
End Function
-
Nov 8th, 2004, 10:33 AM
#7
Frenzied Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|