Solved

Delphi 7 TDBChart

Posted on 2006-07-06
11
1,544 Views
Last Modified: 2008-01-09
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.
0
Comment
Question by:Marius0188
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 2
11 Comments
 
LVL 11

Expert Comment

by:calinutz
ID: 17053492
Maybe if you do a function for regularizing the results or add conditions to your Query... because the DBChart does not know that it bothers you to have too big values in it. Also you can play with the scaling of the DBChart to increase the maximum on the vertical, that would probabely lead to a smoothing of the chart.

Regards.
0
 
LVL 17

Expert Comment

by:TheRealLoki
ID: 17055085
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(DataSet: TDataSet);
begin
  Dataset.FieldByName('Nice_Big_Value').AsFloat := max(1000, Dataset.FieldByName('NORMAL_Big_Value').AsFloat); // max of 1000
// same as  Query1NiceBigValue.AsFloat := max(1000, Query1Normal_Big_Value.AsFloat);
end;

then in your dbchart, use Nice_Big_Value instead of Big_Value
0
 
LVL 17

Expert Comment

by:TheRealLoki
ID: 17055322
sorry, it should be MIN, not max as in
:= MIN((1000, Dataset.FieldByName('NORMAL_Big_Value').AsFloat);
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 17

Expert Comment

by:TheRealLoki
ID: 17055338
btw, you need to add "math" to your uses clause
0
 

Author Comment

by:Marius0188
ID: 17075145
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?
0
 

Author Comment

by:Marius0188
ID: 17075234
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.
0
 
LVL 17

Accepted Solution

by:
TheRealLoki earned 250 total points
ID: 17078267
If you really do just mean "Average"
then add a 2nd series. make this a Function
(click "add series" you choose "function" instead of "series")
make sure you tell it to use "Average" and the "series1" for the data

If you mean a spline curve (curve fitting) ?
Teechart PRO has this by using gaussian polynomials
Delphi ships with standard TeeChart
When you click "add series" you choose "function" instead of "series"
If you do not have teechart pro, I think you can add one yourself (if you know the math)
by using 2 series
1 series you just show the points, and this is your real data
you create the 2nd series by using sin and the 1st series points
Don't ask me how to do the maths though :-)

0
 

Author Comment

by:Marius0188
ID: 17078283
Yes I think what I need is your second explanation.
The curve fitting.
0
 
LVL 17

Expert Comment

by:TheRealLoki
ID: 17078804
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
0
 

Author Comment

by:Marius0188
ID: 17079577
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...
0
 
LVL 11

Expert Comment

by:calinutz
ID: 17092830
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
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi TcxGrid group footer summary 3 389
FMX and jaudiotracker playing memory stream 29 107
TEMBEDDEDWB how can i change its user agent ? 8 103
Firemonkey allowing RTL on android 6 75
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question