Page 1 of 1
Strange problem with zero value points
Posted: Fri Dec 05, 2003 11:32 am
by 8441616
Hello!
I have a problem with a chart that has 1 series with some points that are 0. It appears as though the zeros are being treated as -1 because there is a gap between the bottom axis and the bottom of my non zero bars, which does not look very good
I will be posting a screen shot on the attachments news group
Has anyone come across anything like this? It has got me stumped
Cheers
Paul
Posted: Sun Dec 07, 2003 8:30 pm
by Marjan
Hi, Paul.
Yes, I've seen the image in the attachment newsgroup. However, when I tried to replicate it here on my machine (histogram series in 2D with it's vertical axis minimum set to 0.0), everything worked fine.
Code: Select all
Series1.Add(5);
Series1.Add(2);
Series1.Add(0);
Series1.Add(11);
Series1.Add(3);
Series1.GetVertAxis.Minimum := 0.0;
What's the total number of histogram points you've added to series ? Which operating system are you using ? If possible, please send me small sample application which demonstrates this problem so that I can run/debug it here as-is ? You can send it to
marjan@steema.com email address.
Still got problems
Posted: Tue Dec 09, 2003 5:34 pm
by 8441616
Hi Marjan
Thanks for your response to my issue. For some reason my charts all had an automatic min of 1 on the left axis. I turned automatic off and set the
minimum on each chart to 0. However, I still have a problem. Please see the images in the news group.
Unfortunatly, I cant provide you with a demonstration project at present,
partly due to time constraints and partly due to the complexity.
However, below I will give some detail as to how I create the charts shown
in the screen shot.
Each chart has been setup at design time in report builder with 1 series,
and 0 as the min y point. The report is being loaded from a template (rtm)
file. If you want, I can send you this file
VAR objChart:TppTeeChart;
cnt:Integer;
dValue:Single;
objList:TStringList;
BEGIN
TRY
{Finds the required chart in the report builder report}
objChart:=FindChartInReport(strLocation,strMeters,'D'+IntToStr(nDay),RBRepor
t);
{Initialise the chart}
objChart.Chart.AutoRepaint:=False;
{Clear first series ready for data}
objChart.Clear;
objChart.Chart.Series[0].Clear;
objChart.Reset;
{PERIODSINADAY IS 48}
FOR cnt:=1 TO PeriodsInADay DO
BEGIN
dValue:=ProfileControl.Get_dKWH(3);
objChart.Chart.Series[0].AddY(dValue,'',clRed);
{Go to next point}
ProfileControl.Next;
END;
objChart.Chart.LeftAxis.Maximum:=dMax+(Round(dMax/100)*5);
objChart.Visible:=True;
objChart.Chart.Border.Visible:=True;
objChart.Chart.Border.Width:=1;
{Refresh the chart}
objChart.Chart.AutoRepaint:=True;
objChart.Chart.Repaint;
The values come from an ActiveX control that I have created
The charts are embedded inside a report builder report.
I am using Windows 2000, with Report Builder 7.01 and TChart v6
Any ideas or pointers?
We also use ChartFX for our internet charts. The second image attached to
this email is the equivilant set of charts, this is what I am aiming to see
from TChart, apart from the tick marks on the bottom axis which I do not
require.
Cheers
Paul
Posted: Thu Dec 11, 2003 6:27 am
by Marjan
Hi, Paul.
Your code looks fine to me. It's more less equal to one I used. But looking at pictures you posted it looks like you're using TBarSeries with it's YOrigin property set to 1.0. Can you confirm you're using THistogramSeries and not TBarSeries ? If case you're using TBarSeries, try setting the YOrigin property to 0.0 or even setting UseYOrigin property to False.
No matter what I did I'm always getting correct results (THistogram series or TBarSeries with UseYOrigin set to False). If possible, please send me at least data for one of these charts so that I can run some tests here. Thanks.
Sorted
Posted: Thu Dec 11, 2003 9:25 am
by 8441616
Thanks!
It was that use origin property, I now set it to 0, I had never even seen it, not sure why it is automatically set to 1 though?
Cheers
Paul
Posted: Thu Dec 11, 2003 9:41 am
by Marjan
Hi, Paul.
Hmm... I don't know why. The default value for it is 0.0. Anyways, I'm glad it's working now.