Hi,
Line series graphs are not visible when the values are along the corresponding axes extremes (maximum or minimum). Code demonstrating this behavior is uploaded on steema.public.attachments. I want to keep the axis minimum and maximum offsets at 0. Is it possible to draw the line series graph and their pointers as the topmost element when they coincide with the chart's edges ?
Thank you.
How to draw Line series on top of chart edges
-
- Newbie
- Posts: 52
- Joined: Tue Mar 04, 2003 5:00 am
Hi, Lancer.
If the series Pointers are visible, then you could try setting it's InflateMargins property to true. Another trick might be to use left axis MinimumOffset and MaximumOffset properties to value greater than 0.
If none of this is acceptable, then you could also disable series points clipping by setting the tChart.Aspect.ClipPoints to false:
If the series Pointers are visible, then you could try setting it's InflateMargins property to true. Another trick might be to use left axis MinimumOffset and MaximumOffset properties to value greater than 0.
If none of this is acceptable, then you could also disable series points clipping by setting the tChart.Aspect.ClipPoints to false:
Code: Select all
tChart1.Aspect.ClipPoints = false;
Marjan Slatinek,
http://www.steema.com
http://www.steema.com
-
- Newbie
- Posts: 52
- Joined: Tue Mar 04, 2003 5:00 am
RE: How to draw Line series on top of chart edges
Thanks for your quick response.
Series pointers may not be visible - so the first suggestion cannot be applied. Also, the solution should apply to FastLine series also.
And, as I mentioned in my original note, minimum and maximum offsets should remain 0 as otherwise it would affect other things in my program.
Turning off the series points clipping works well, but on a zoom-in the graph lines are drawn outside the chart rectangle also.
The answer may be to turn the built in clipping algorithm off (with the tChart1.Aspect.ClipPoints = false;) and write an external one that will clip the chart rectangle (the area enclosed by the axes) by just a few more pixels in the vertical direction. If you agree, could you let me know how to do that ?
Thank you.
Series pointers may not be visible - so the first suggestion cannot be applied. Also, the solution should apply to FastLine series also.
And, as I mentioned in my original note, minimum and maximum offsets should remain 0 as otherwise it would affect other things in my program.
Turning off the series points clipping works well, but on a zoom-in the graph lines are drawn outside the chart rectangle also.
The answer may be to turn the built in clipping algorithm off (with the tChart1.Aspect.ClipPoints = false;) and write an external one that will clip the chart rectangle (the area enclosed by the axes) by just a few more pixels in the vertical direction. If you agree, could you let me know how to do that ?
Thank you.
-
- Newbie
- Posts: 52
- Joined: Tue Mar 04, 2003 5:00 am
Hi, Lancer.
Yes, it can be done. You can use chart BeforeDrawSeries and AfterDraw events to clip series to specific (rectangle) region. Example:
Of course, you can use more elaborate and complex code to define the clipping rectangle (the above is just a simple example of what you can do).
Yes, it can be done. You can use chart BeforeDrawSeries and AfterDraw events to clip series to specific (rectangle) region. Example:
Code: Select all
private void tChart1_BeforeDrawSeries(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
int offset = 10;
int l = tChart1.Axes.Left.Position-offset;
int t = tChart1.Axes.Left.IStartPos-offset;
int h = tChart1.Axes.Left.IEndPos +offset - t;
int w = tChart1.Axes.Bottom.IEndPos - tChart1.Axes.Bottom.IStartPos + 2*offset;
tChart1.Graphics3D.ClipRectangle(new Rectangle(l,t,w,h));
}
private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
tChart1.Graphics3D.UnClip();
}
Marjan Slatinek,
http://www.steema.com
http://www.steema.com