Hi,
Is it possible to add user calculated chart ?
ie: I have 2 charts. I want a new chart (chart3) who is the difference between Chart1 and Chart2.
If I add new point in Chart 1 and Chart2, I want Chart3 reflecting this change automatically.
Does it exist a functionnality of Teechart to add chart based on a user formula (in my case it is a difference but I would like to specify my own formula ex Chart1 + 0.75485*Chart2 ...
Thanks for your help
Guilz
User Calculated Chart
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: User Calculated Chart
Hi Guilz,
Yes, there are subtract and y=f(x) functions. Please have a look at the All Features\Welcome!\Functions examples in the features demo and read tutorial 7. Demo and tutorials are available at TeeChart's program group.
Yes, there are subtract and y=f(x) functions. Please have a look at the All Features\Welcome!\Functions examples in the features demo and read tutorial 7. Demo and tutorials are available at TeeChart's program group.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: User Calculated Chart
Hi Narcis,
y=f(x) is not what I'am looking for
CalculateMany Function is used to calculate function result if multiple series can be datasource, it is what i am looking for
Tell me if I'm wrong but the CalculateMany function is not available for Teechart ActiveX but only for VCL...
Guilz
y=f(x) is not what I'am looking for
CalculateMany Function is used to calculate function result if multiple series can be datasource, it is what i am looking for
Tell me if I'm wrong but the CalculateMany function is not available for Teechart ActiveX but only for VCL...
Guilz
Re: User Calculated Chart
Hi Guilz,
Note that CalculateMany function is a function present into some TeeChart functions.
Please, try to explain what are you exactly trying to do here and we'll try to suggest you the best way we can find to achieve it.
Note that CalculateMany function is a function present into some TeeChart functions.
Please, try to explain what are you exactly trying to do here and we'll try to suggest you the best way we can find to achieve it.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: User Calculated Chart
Yeray,
I have 1 chart with 2 series (S1 and S2).
I want to add a new serie S3 reflecting changes of S1 and S2 by a function like S3= S1-S2 (*)
If a new point is added to S1 and S2, S3 must automaticaly reflect this change and add the new calculated point defined by the formula (*)
Hope it is help you to understand what I am looking for
Guilz
I have 1 chart with 2 series (S1 and S2).
I want to add a new serie S3 reflecting changes of S1 and S2 by a function like S3= S1-S2 (*)
If a new point is added to S1 and S2, S3 must automaticaly reflect this change and add the new calculated point defined by the formula (*)
Hope it is help you to understand what I am looking for
Guilz
Re: User Calculated Chart
Hi Guilz,
I think I agree with Narcís. If I understood well you are trying to do something as follows:
I think I agree with Narcís. If I understood well you are trying to do something as follows:
Code: Select all
Private Sub Command1_Click()
Dim diff As Double
diff = TChart1.Series(0).YValues.Maximum - TChart1.Series(0).YValues.Minimum
TChart1.Series(0).Add (Rnd * diff / 5) - diff / 10 + TChart1.Series(0).YValues.Minimum, "", clTeeColor
diff = TChart1.Series(1).YValues.Maximum - TChart1.Series(1).YValues.Minimum
TChart1.Series(1).Add (Rnd * diff / 5) - diff / 10 + TChart1.Series(1).YValues.Minimum, "", clTeeColor
TChart1.Series(2).CheckDataSource
TChart1.Axis.Bottom.SetMinMax 0, TChart1.Series(0).Count - 1
End Sub
Private Sub Form_Load()
TeeCommander1.Chart = TChart1
TChart1.Aspect.View3D = False
TChart1.AddSeries scPoint
TChart1.AddSeries scPoint
TChart1.AddSeries scLine
TChart1.Series(0).FillSampleValues 25
TChart1.Series(1).FillSampleValues 25
TChart1.Series(2).SetFunction tfCustom
TChart1.Series(2).DataSource = "Series0,Series1"
TChart1.Axis.Bottom.SetMinMax 0, TChart1.Series(0).Count - 1
End Sub
Private Sub TChart1_OnFunctionCalculate(ByVal SeriesIndex As Long, ByVal X As Double, Y As Double)
Y = TChart1.Series(0).YValues.Value(X) - TChart1.Series(1).YValues.Value(X)
End Sub
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: User Calculated Chart
Fantastic Yeray, it is exactly what I was looking for
thanks a lot
Guilz
thanks a lot
Guilz