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
Match 2 chart heights
-
- Newbie
- Posts: 16
- Joined: Fri Apr 16, 2004 4:00 am
- Location: Chicago
- Contact:
Hi Brian,
one way could be setting a CustomSize for the Bottom Axis labels, something like :
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 = "";
}
Pep Jorge
http://support.steema.com
http://support.steema.com
-
- Newbie
- Posts: 16
- Joined: Fri Apr 16, 2004 4:00 am
- Location: Chicago
- Contact:
customsize?
What unit is customsize rendered in?
It isn't pixels.
It isn't pixels.
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:
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.
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;
Marjan Slatinek,
http://www.steema.com
http://www.steema.com