Match 2 chart heights

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Brian Begy
Newbie
Newbie
Posts: 16
Joined: Fri Apr 16, 2004 4:00 am
Location: Chicago
Contact:

Match 2 chart heights

Post by Brian Begy » Thu Jun 03, 2004 8:25 pm

I have two charts side by side. One displays bar data and the other line data.

The bar graph contains only one datapoint and has no bottom axis label.

The line chart has a date label on the bottom axis and contains 100 data points.

I need both charts to be the same height and line up with one another despite the fact that one has a diagonal labels on its x axis and the other does not.

Any suggestions?

-Brian

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Fri Jun 04, 2004 1:01 am

Hi Brian,

one way could be setting a CustomSize for the Bottom Axis labels, something like :

Code: Select all

private void Form1_Load(object sender, System.EventArgs e)
{
bar1.FillSampleValues(1);
line1.FillSampleValues(100);
tChart2.Axes.Bottom.Labels.Angle = 45;
}
private void button1_Click(object sender, System.EventArgs e)
{
tChart1.Axes.Bottom.Labels.CustomSize = 20;
tChart2.Axes.Bottom.Labels.CustomSize = 20;
}

private void tChart1_GetAxisLabel(object sender, Steema.TeeChart.GetAxisLabelEventArgs e)
{
if ((Steema.TeeChart.Axis)sender == tChart1.Axes.Bottom)
	e.LabelText = "";
}

Brian Begy
Newbie
Newbie
Posts: 16
Joined: Fri Apr 16, 2004 4:00 am
Location: Chicago
Contact:

customsize?

Post by Brian Begy » Fri Jun 04, 2004 2:03 am

What unit is customsize rendered in?
It isn't pixels.

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Mon Jun 07, 2004 3:09 pm

Hi, Brian.

All custom sizes are by default expressed in screen pixels. In your case, the following code should set bottom axis title and labels size to fixed number of pixels:

Code: Select all

tChart1.Axes.Bottom.Title.CustomSize = 10;
tChart1.Axes.Bottom.Labels.CustomSize = 20;
The problem is the CustomSize will work correctly only if label angle is 0,90, 180 or 270 degrees. For other cases you'll have to calculate the ideal custom size by using the sine or cosine definition.
Marjan Slatinek,
http://www.steema.com

Post Reply