Page 1 of 1

Match 2 chart heights

Posted: Thu Jun 03, 2004 8:25 pm
by 8125097
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

Posted: Fri Jun 04, 2004 1:01 am
by Pep
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 = "";
}

customsize?

Posted: Fri Jun 04, 2004 2:03 am
by 8125097
What unit is customsize rendered in?
It isn't pixels.

Posted: Mon Jun 07, 2004 3:09 pm
by Marjan
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.