Page 1 of 1
Monthly rainfall data on Bargraph, incorr displays bar..
Posted: Sat Dec 09, 2006 4:55 pm
by 9347102
Please look at the two attached files, posted in newsgroup: steema.public.teechart7.delphi, due to inability to post attachments here.
TeeChartProblem2:
I use series 1 that contains the days it rained, and then The rainfall
series, that is a function that sums one months data at a time to give the
monthly bars in the chart.
I force twelve months, (using min - max X axis, and iterate in months)and as you can see the one example displays
correctly. The range is 2005/01/01 - 2005/12/31.
The TeeChartProblem1 picture, I populate the the chart with the rainfall
data for 2004, but there is only recorded data for Oct, Nov Dec, see the
legend on the side. Please note that the bars now overlap, are not spaced
correctly, are wider than a month, the label is not in the centre of the
bar. If I make Series1 visible from which I derive Rainfall, then the daily rainfall displays on the same graph, now the bars are correct. The width% of the bars are set to 70, and I cannot find anything to overcome this!
Only the data is different, the setup remains the same.
This is frustrating, and I need advice please.
Thanks
Adrian
Posted: Mon Dec 11, 2006 2:33 pm
by narcis
Hi Adrian,
Please find below the answers to your questions:
TeeChartProblem2: Which is the exact problem? If the chart ranges from 1st January 2005 until 31st December 2005 I understand that the December bar has to be drawn with its corresponding data. Could you please be more specific on which is the problem here?
TeeChartProblem1: Could you please send us a simple example project we can run "as-is" to reproduce the problem here? We need to see how your chart and series are set up so that we can see which is the exact problem.
Thanks in advance.
Dear Narcis .. I have a test app with the incorrect bar disp
Posted: Sat Jun 09, 2007 12:34 pm
by 9347102
Dear Narcis.
It has been a busy six months, but at last time to set up a test app in D2007, for illustrating the incorrect spacing of bars, on the graph as I mentioned in the email in 2007/Dec.
How do I supply you with this demo app??
Regards
Adrian
Posted: Mon Jun 11, 2007 7:10 am
by narcis
Hi Adrian,
You can either post your files at news://
www.steema.net/steema.public.attachments newsgroups or at our
upload page.
Posted: Mon Jun 11, 2007 11:02 am
by 9347102
Hi Narcis
I have uploaded two Demo Apps to the upload server.
The one illustrates the problem I am facing with overlapping bars, ie not properly spaced on the chart.
The other, another problem I picked up with horizontal bar graph, and the incorrect display of Text, Bar, Y data imported from a memo.
Both compiled using Teechart 7.11 and D2007
Regards
I hope these two apps will help with the problem solving
I thanks you in advance for all the trouble!!!
Adrian
Posted: Mon Jun 11, 2007 1:22 pm
by narcis
Hi Adrian,
Thanks for the information.
I found that you had also posted the projects at the newsgroups during the weekend, hadn't you?
Regarding the overlapping bars problem, this can be avoided using:
Another problem - Why are the months not added up correctly, at runtime, sometimes at designtime!
I'm not sure what do you exactly mean here. Could you please give us more information about this issue?
Thanks in advance.
BTW:We will answer the horizontal bar issue as soon as possible.
Posted: Mon Jun 11, 2007 6:30 pm
by 9347102
Quote:
Another problem - Why are the months not added up correctly, at runtime, sometimes at designtime!
I'm not sure what do you exactly mean here. Could you please give us more information about this issue?
Information you required follows:
when choosing month, you default to 30 days.
this results in the first day or two of say Nov being added to the total of Oct.
ie if you were to total the rainfall for the months manually, you get different values to what you get with the program splitting up the months.
Check the example and you will see.
Thanks for the answer on the bar width.
Regards
Adrian
Posted: Mon Jun 11, 2007 8:00 pm
by 9347102
Setting Series2.BarWidthPercent:=20; is not the ideal answer.
The years with full rainfall data for the first and last months of the year, display properly, see the original images at the beginning of this thread uploaded to the newsgroup.
If I now add this line of code, they now show bars that are very thin!, and not at all as visually appealing as previously.
Please run the test app I sent you, with the line of code added, and note the two bars appear better, but still overlapping! It is also only displaying bars for Oct and Nov, but should also Display for December
Edit the chart at designtime, check the data:
Note rows 0 to 5 as follows:
Series 1 Series 2
0 - 2004/10/12 - 32 - 2004/10/26 11:38:24PM - 70
1 - 2004/10/13 - 23 - 2004/11/25 11:38:24PM - 42
2 - 2004/11/05 - 15
3 - 2004/11/29 - 5
4 - 2004/12/05 - 15
5 - 2004/12/10 - 22
If you total these manually you will get:
October = 55 not 70!
November = 20 not 42!
Dec = 37 .. not even displayed!
Hope you can get to this one, as I think it lies at low level handling of time units months, as set up in:
Bottom Axis -> Scales -> Desired Increment = One Month .. it is this one month that doesn't stick to the exact month!
If there is data for the very first, and last monht of the year, then all the bars display correctly, non overlapping.
It is when there are only data for the last few months, that we have a problem.
I probably can calculate each months data, then store in a query, then hand the data as follows to the DBchart:
Jan = 0
Feb = 0
March = 0
April = 0
May = 0
June = 0
July = 0
Aug = 0
Sept = 0
Oct = = 55
Nov = 20
Dec = 37
and the output will be perfect .. no Setting Series2.BarWidthPercent:=20; needed ... but then this is one of the features of your DBChart, so why must I do this, when your chart is supposed to handle this low level stuff itself.
Just look hard .. there must be some or other bug in the logic, that only you can overcome for me and many other users.
Once again .. I love your product!!
Adrian
Posted: Thu Jun 21, 2007 10:11 pm
by 9347102
Hi Narcis .. Any progress yet??
Adrian
Posted: Wed Jul 11, 2007 12:27 pm
by yeray
Hi Adrian,
sorry for delay! We've been doing some tests before answer to your questions.
About the first problem, related with "incorrect data using SeriesTextSource and HorizBar series", it seems there's a bug when Series is a HorizBar. I've added on our defect list, in meantime a workaround would be to add data to the Series manually, iterating through the memo.lines, and using the AddXY method to populate the Series.
About the second problem related with overlapping, setting the BarWidthPercent to 100 should work as you want , but having set a min and max for the bottom axes manually makes to appear the last bar with incorrect width.
I've added this as a bug on our defect list, a fix for it will be considered to inclusion for the next maintenance releases.
As a workaround, could be :
1) Manually set a BarWidthPercent for the Series depending on the number of visible Bars.
2) Use the BarSizeSeries, as in the example of the TeeNew project (included into the Teechart Pro installation) which shows how to set the size for specific bars of the Serie. (please look for Bar size in the Demo).
The space for axis labels is calculated automatically, this sometimes makes to hide some labels (as in your case), a solution could be to set "Alternate" labels (this will take advantage of the space between the labels), or place custom axis labels manually (there's an example of this into the Demo Features project, you can look for "custom axis labels").
We'll try fo fix the commented bugs as soon as possible.