Marius0188
asked on
Delphi 7 TDBChart
Dear Experts.
I have a database application in Delphi 7.
Am using TDBChart to plot averages from the DB.
I am using a TLineSeries to plot these averages.
Is there a way to eliminate abnormal high spikes on the Chart?
Cause I am analyzing massas of data and maybe on record are way out high which in return
pushes the average up.
I have a database application in Delphi 7.
Am using TDBChart to plot averages from the DB.
I am using a TLineSeries to plot these averages.
Is there a way to eliminate abnormal high spikes on the Chart?
Cause I am analyzing massas of data and maybe on record are way out high which in return
pushes the average up.
Personally, I would add a "calculated" field to the query (double click on the TQuery, new field, "calculated")
"Nice_Big_Value"
then add click on the Query component, and add an OnCalcFields event
procedure TForm1.Query1CalcFields(Da taSet: TDataSet);
begin
Dataset.FieldByName('Nice_ Big_Value' ).AsFloat := max(1000, Dataset.FieldByName('NORMA L_Big_Valu e').AsFloa t); // max of 1000
// same as Query1NiceBigValue.AsFloat := max(1000, Query1Normal_Big_Value.AsF loat);
end;
then in your dbchart, use Nice_Big_Value instead of Big_Value
"Nice_Big_Value"
then add click on the Query component, and add an OnCalcFields event
procedure TForm1.Query1CalcFields(Da
begin
Dataset.FieldByName('Nice_
// same as Query1NiceBigValue.AsFloat
end;
then in your dbchart, use Nice_Big_Value instead of Big_Value
sorry, it should be MIN, not max as in
:= MIN((1000, Dataset.FieldByName('NORMA L_Big_Valu e').AsFloa t);
:= MIN((1000, Dataset.FieldByName('NORMA
btw, you need to add "math" to your uses clause
ASKER
Thanks for help so far.
When I draw a TLineSeries chart based on averages of thousands of record's data it is very spiky.
I do not want to manipulate the actual data but would rather draw a very smooth line chart.
For example: In stock exchange you get Moving Averages. I need to draw the same smooth line.
Is there a series that can do this or how will I go about doing this?
When I draw a TLineSeries chart based on averages of thousands of record's data it is very spiky.
I do not want to manipulate the actual data but would rather draw a very smooth line chart.
For example: In stock exchange you get Moving Averages. I need to draw the same smooth line.
Is there a series that can do this or how will I go about doing this?
ASKER
Maybe I am not clear enough.
Instead of the spikes going up and down accross the X axis I would like to draw a smooth line.
Instead of the spikes going up and down accross the X axis I would like to draw a smooth line.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yes I think what I need is your second explanation.
The curve fitting.
The curve fitting.
there's a teechart pro trial version you can download, but I don't think you'll get this feature for free in teechart any time soon
ASKER
1. Where can I download Teechart Pro Trial?
Do you have an url for me please.
2. Isn't there any other free charting components for Delphi that might assist me?
Please provide urls for download etc...
Do you have an url for me please.
2. Isn't there any other free charting components for Delphi that might assist me?
Please provide urls for download etc...
For teechart Pro evaluation check out this link:
http://www.steema.com/downloads/dwn_tch_vcl.html
As for other delphi charting components that are free and also provide lot of functionalities there isn't any. At least none that I know of, and I know I checked a couple of times in all the right places.
Best place I've found is this:
http://www.torry.net/pages.php?id=195
Regards
http://www.steema.com/downloads/dwn_tch_vcl.html
As for other delphi charting components that are free and also provide lot of functionalities there isn't any. At least none that I know of, and I know I checked a couple of times in all the right places.
Best place I've found is this:
http://www.torry.net/pages.php?id=195
Regards
Regards.