Greetings,
I have a bottom axis that only stretches 97% across the screen to allow a small buffer at the rigth hand side.
I can find the pixel coord of the left hand side thus - int start = StockChart.Axes.Bottom.IStartPos
however - int end = StockChart.Axes.Bottom.IEndPos returns the position at 97% across ...
I need to draw a line from the axis start to the axis end (including the 3% empty space)
How can I find the the pixel 'x' position where the rigth hand axes are drawn.
Cheers Phil.
Bottom Axis pixel positions
Bottom Axis pixel positions
--------------------
Cheers Phil.
Cheers Phil.
Re: Bottom Axis pixel positions
Hello Phil,
I think you need add IStartPos and IEndPos of the Depth Axis of Chart. I recommend you do something as below code:
Could you please, tell us if previous code works as you want?
I hope will helps.
Thanks,
I think you need add IStartPos and IEndPos of the Depth Axis of Chart. I recommend you do something as below code:
Code: Select all
void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
int starBottom, endBottom;
starBottom = tChart1.Axes.Bottom.IStartPos+tChart1.Axes.Depth.IStartPos;
endBottom = tChart1.Axes.Bottom.IEndPos+tChart1.Axes.Depth.IEndPos;
g.Pen.Color = Color.Red;
g.Pen.Width = 2;
g.Line(starBottom, tChart1.Axes.Bottom.Position - 50, endBottom, tChart1.Axes.Bottom.Position - 50);
}
I hope will helps.
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Bottom Axis pixel positions
Hi Sandra,
Sadly no it didnt work for me ...
int val = StockChart.Chart.ChartRect.Right seems to work ..
But the VisualStudio is scaring me by warning "May cause runtime error as class is marshall-by-reference class .. "
but it works and doesnt seem to crash ...
Sadly no it didnt work for me ...
int val = StockChart.Chart.ChartRect.Right seems to work ..
But the VisualStudio is scaring me by warning "May cause runtime error as class is marshall-by-reference class .. "
but it works and doesnt seem to crash ...
--------------------
Cheers Phil.
Cheers Phil.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Bottom Axis pixel positions
Hi Phil,
To fix this warning you should do this:
To fix this warning you should do this:
Code: Select all
Rectangle rect = StockChart.Chart.ChartRect;
int val = rect.Right;
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |