Hi,
I'm trying to retrieve the coefficients of a fit on some data via otemp:FunctionType:asCurveFit:answervector. But it looks like the answervector array isn't accessible.
Could you check this please?
I'm using the 2011.0.0.5 version.
TIA,
Jack
AnswerVector
Re: AnswerVector
Hi Jack,
the following code seems to work fine for me here in VB6, doesn't it for you?
the following code seems to work fine for me here in VB6, doesn't it for you?
Code: Select all
Private Sub Form_Load()
TChart1.Aspect.View3D = False
TChart1.AddSeries scFastLine
TChart1.Series(0).FillSampleValues 200
TChart1.AddSeries scFastLine
TChart1.Series(1).SetFunction tfCurveFit
TChart1.Series(1).DataSource = TChart1.Series(0)
Dim t As Integer
Dim tmp As String
tmp = "y="
With TChart1.Series(1).FunctionType.asCurveFit
For t = 1 To .PolyDegree
tmp = tmp + " "
If .AnswerVector(t) >= 0 Then
tmp = tmp + "+"
End If
tmp = tmp + Format$(.AnswerVector(t), "0.0##") + "*x"
If t > 1 Then
tmp = tmp + "^" + Str$(t)
End If
Next t
TChart1.Header.Text.Text = tmp
End With
End Sub
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: AnswerVector
Hi Yeray,
Unfortunately i don't have VB6.
Do you have a working example in MS Word/Excel?
You can send it via PM.
TIA,
Jack
Unfortunately i don't have VB6.
Do you have a working example in MS Word/Excel?
You can send it via PM.
TIA,
Jack
Re: AnswerVector
Hi Jack,
I've opened the "TeeChart Pro Inserted into Excel.xls" example shipped with the v2012.0.0.1 installation, in "\Examples\MSOffice\VBA Excel". I've opened the VB editor (Alt+F11), opened the Sheet1 in it and changed the code in CommandButton1_Click for the code I've shown you in my last post.
Find attached the result
I've opened the "TeeChart Pro Inserted into Excel.xls" example shipped with the v2012.0.0.1 installation, in "\Examples\MSOffice\VBA Excel". I've opened the VB editor (Alt+F11), opened the Sheet1 in it and changed the code in CommandButton1_Click for the code I've shown you in my last post.
Find attached the result
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: AnswerVector
Hi Yeray,
Thanks for the file.
Here are my test results:
PC1: WinXP 32 bit, Excel 2003, Teechart 2011.0.0.5: OK
PC2: WIN7 32 bit, Excel 2010, Teechart 2011.0.0.5: OK
PC3: WIN7 64 bit, Excel 2010 64 bit, Teechart 2011.0.0.5: Error, runtime error '424' Object required.
PC3: WIN7 64 bit, Excel 2010 64 bit, Teechart 2012.0.0.1 (32 bit): Error, runtime error '424' Object required.
PC4: WIN7 64 bit, Excel 2010 64 bit, with fresh install of Teechart 2012 (32 bit and working demos): Error, runtime error '424' Object required.
I will try to find other PC configurations tomorrow to do some more testing.
There is definitly something weird going on (see my post a few weeks ago) and it looks like 64 bit (Excel or WIN7) is a factor in this.
Greetings,
Jack
Thanks for the file.
Here are my test results:
PC1: WinXP 32 bit, Excel 2003, Teechart 2011.0.0.5: OK
PC2: WIN7 32 bit, Excel 2010, Teechart 2011.0.0.5: OK
PC3: WIN7 64 bit, Excel 2010 64 bit, Teechart 2011.0.0.5: Error, runtime error '424' Object required.
PC3: WIN7 64 bit, Excel 2010 64 bit, Teechart 2012.0.0.1 (32 bit): Error, runtime error '424' Object required.
PC4: WIN7 64 bit, Excel 2010 64 bit, with fresh install of Teechart 2012 (32 bit and working demos): Error, runtime error '424' Object required.
I will try to find other PC configurations tomorrow to do some more testing.
There is definitly something weird going on (see my post a few weeks ago) and it looks like 64 bit (Excel or WIN7) is a factor in this.
Greetings,
Jack
Re: AnswerVector
Additional
PC5: WIN7 64 bit, Excel 2007 (32 bit), Teechart 2010.0.0.2: OK
PC5: WIN7 64 bit, Excel 2007 (32 bit), Teechart 2010.0.0.2: OK
Re: AnswerVector
Hi Jack,
It seems to work fine here in Win7 x64 + Office x64.
I've modified the VB code a little bit to both show the formula and the TeeChart version. Instead of:
I use:
And this is what I get:
It seems to work fine here in Win7 x64 + Office x64.
I've modified the VB code a little bit to both show the formula and the TeeChart version. Instead of:
Code: Select all
TChart1.Header.Text.Text = tmp
Code: Select all
TChart1.Header.Text.Text = TChart1.Version
TChart1.Header.Text.Add tmp
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: AnswerVector
Hi Jack,
Note the first version including a 64bit ocx is the latest one: v2012.0.0.1. And the 64bit ocx is needed if you want to use TeeChart in an Office x64. So please, make sure you have the latest version installed and both 32 and 64 bit ocx are registered in the machine.
Note the first version including a 64bit ocx is the latest one: v2012.0.0.1. And the 64bit ocx is needed if you want to use TeeChart in an Office x64. So please, make sure you have the latest version installed and both 32 and 64 bit ocx are registered in the machine.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: AnswerVector
Hi Yeray,
It works.
My mistake. I wasn't aware that I had to use the 64 bit ocx in a full 64 bit OS+app.
Thanks,
Jack
It works.
My mistake. I wasn't aware that I had to use the 64 bit ocx in a full 64 bit OS+app.
Thanks,
Jack