Hi,
I am trying to adjust the length of the graph axes on the paper,
when the graph is printed out from some printer device.
For example, I would like to set the X axis length on the paper
exactly to 10cm and the Y axis length exactly to 15cm.
The problem is that the printed out axes' lengths depend on the
label strings when the margins are used for the length adjustment.
So, here are my questions:
Q1. Is it possible to directly control the axis length by means of the
actual length on the printed-out paper?
Q2. Is there some way to know the axis length (in pixel units?)
of the on-memory image before the graph is printed out?
I would appreciate any help or suggestion.
Thank you.
Exact Axis Length on Paper
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hi --
You can then determine the length of the axis before exporting to an image (or before printing) using code similar to the following:
Well, what you can do is specify the chart panel margins in pixels rather than a percentage of the chart panel area:So, here are my questions:
Q1. Is it possible to directly control the axis length by means of the
actual length on the printed-out paper?
Q2. Is there some way to know the axis length (in pixel units?)
of the on-memory image before the graph is printed out?
Code: Select all
tChart1.MarginUnits = Steema.TeeChart.PanelMarginUnits.Pixels;
tChart1.MarginLeft = 10; // <--- 10 pixels
Code: Select all
private void Form1_Load(object sender, System.EventArgs e) {
tChart1.Aspect.View3D = false;
bar1.FillSampleValues();
bar1.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Both;
tChart1.Axes.Right.AxisPen.Width = 1;
tChart1.Axes.Right.Labels.Visible = false;
}
private void button1_Click(object sender, System.EventArgs e) {
int bAxisLength = tChart1.Axes.Right.Position - tChart1.Axes.Left.Position;
label1.Text = bAxisLength.ToString();
tChart1.Export.Image.PNG.Save(@"C:\TEMP\axis.png");
}
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/