Hello!
I have a strange problem where the line of my line/bar chart does not start and finish on the axis lines.
What property do I use to do this?
With my bar series I just did
TBarSeries(objChart.Chart.Series[0]).SideMargins:=False;
I have posted an image onto the attachments newsgroup
Cheers
Paul
Line Chart Start and End Problem
-
- Newbie
- Posts: 6
- Joined: Tue Nov 04, 2003 5:00 am
- Location: UK
Hi, Paul.
Is the line series Pointer.Visible property set to true meaning are you using line series with visible pointers ? If this is the case the you can use the following code to prevent automatic axis offset for pointers:
Is the line series Pointer.Visible property set to true meaning are you using line series with visible pointers ? If this is the case the you can use the following code to prevent automatic axis offset for pointers:
Code: Select all
(Chart1.Series[0] as TLineSeries).Pointer.InflateMargins := False;
Marjan Slatinek,
http://www.steema.com
http://www.steema.com
-
- Newbie
- Posts: 6
- Joined: Tue Nov 04, 2003 5:00 am
- Location: UK
No Difference
Hi Marjan
That property was false, I pasted your code in anyway and it made no difference grrrrrrr!
I have put a new screen shot on the attachments group.
I have just noticed that the first label on the X axis starts part way along the line, not at the origin. The line starts level with the the label
Cheers
Paul
That property was false, I pasted your code in anyway and it made no difference grrrrrrr!
I have put a new screen shot on the attachments group.
I have just noticed that the first label on the X axis starts part way along the line, not at the origin. The line starts level with the the label
Cheers
Paul
Hi, Paul.
Looking at picture in attachments newsgroup, only one thing comes to my mind: if line and bar series x values are the same, then the "problem" is bar series by definition shows bars, which have specific width. So, if you're plotting bar series with x value 1 and 2, then two bars with center points at 1,2 and with speicific (%, defined by bar series property) bar width will be drawn. For line series this is not the case i.e. only lines with no additional "bar width" are drawn.
To treat bar series in the same manner as line series i.e. don't let TeeChart adjust horizontal axis by bar width, simply override default minimum/maximum calculating algorithm and manually set axis range to exactly series XValues minimum and maximum value. Something like this
Looking at picture in attachments newsgroup, only one thing comes to my mind: if line and bar series x values are the same, then the "problem" is bar series by definition shows bars, which have specific width. So, if you're plotting bar series with x value 1 and 2, then two bars with center points at 1,2 and with speicific (%, defined by bar series property) bar width will be drawn. For line series this is not the case i.e. only lines with no additional "bar width" are drawn.
To treat bar series in the same manner as line series i.e. don't let TeeChart adjust horizontal axis by bar width, simply override default minimum/maximum calculating algorithm and manually set axis range to exactly series XValues minimum and maximum value. Something like this
Code: Select all
With Series1.GetHorizAxis do
SetMinMax(Series1.XValues.MinValue, Series1.XValues.MaxValue);
Marjan Slatinek,
http://www.steema.com
http://www.steema.com