Is there a way to determine the relative width (in %) of a custom Y-Axis. I am creating custom y-axis, and want them to display next to each other, without overlapping (or drawing off the edge of the control).
Is this possible?
Thanks!
Determine the relative width (in %) of the Y-Axis?
I have two examples that show the problem I'm encountering. The smaller jpeg (Chart1.jpg) has a relative position of 6% between each axis. You'll notice that the text seems to overwrite each other. Chart2.jpg is the same chart, but the chart size it bigger.
http://www.head-west.ca/Chart1.jpg
http://www.head-west.ca/Chart2.jpg
http://www.head-west.ca/Chart1.jpg
http://www.head-west.ca/Chart2.jpg
Hi,
this can be solved increasing the size (width and height) of the Axis.Labels.
this can be solved increasing the size (width and height) of the Axis.Labels.
Pep Jorge
http://support.steema.com
http://support.steema.com
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hi --
You can use code similar to the following to calculate axis width:
Best regards,
Christopher Ireland
http://support.steema.com
You can use code similar to the following to calculate axis width:
Code: Select all
Steema.TeeChart.Axis custom1 = new Steema.TeeChart.Axis(false, false, tChart1.Chart);
tChart1.Aspect.View3D = false;
tChart1.Axes.Custom.Add(custom1);
custom1.RelativePosition = 50;
line1.CustomVertAxis = custom1;
line1.FillSampleValues(150);
Bitmap bmp = tChart1.Bitmap;
int axisWidth = custom1.AxisPen.Width + custom1.Ticks.Length + custom1.MaxLabelsWidth();
tChart1.Header.Text = axisWidth.ToString();
Christopher Ireland
http://support.steema.com
Thanks for the sample, although I still do not know how to move the axis so that it is inside the graph region. The property "custom1.Position" is read-only so I cannot set it directly.
Since I can't use the "Position" property, how can I programmatically shift the axis the required pixels? I guess I could calculate the RelativePosition I need based on:
(width of axis) / (width of graph) * 100
Although, don't think the chart.width property is returning the proper values.
Also, I've just discovered the "Printer.Resolution" which makes my printout different than the display.
Since I can't use the "Position" property, how can I programmatically shift the axis the required pixels? I guess I could calculate the RelativePosition I need based on:
(width of axis) / (width of graph) * 100
Although, don't think the chart.width property is returning the proper values.
Also, I've just discovered the "Printer.Resolution" which makes my printout different than the display.
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hi --
Well, you could try using the Steema.TeeChart.Axis.PositionUnits Property, e.g.Since I can't use the "Position" property, how can I programmatically shift the axis the required pixels?
Code: Select all
private void Form1_Load(object sender, System.EventArgs e) {
Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
Steema.TeeChart.Styles.Line line2 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
Steema.TeeChart.Axis axis1 = new Steema.TeeChart.Axis(false, false, tChart1.Chart);
tChart1.Axes.Custom.Add(axis1);
line1.FillSampleValues(20);
line2.FillSampleValues(20);
tChart1.Axes.Left.PositionUnits = Steema.TeeChart.PositionUnits.Pixels;
tChart1.Axes.Left.RelativePosition = 60;
line2.CustomVertAxis = axis1;
axis1.PositionUnits = Steema.TeeChart.PositionUnits.Pixels;
axis1.RelativePosition = 60;
}
OK, I'll look into this and get back to you.Also, I've just discovered the "Printer.Resolution" which makes my printout different than the display.
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/