Hi,
When I'm having a chart whose Labels are need to be displayed vertically and labels are very large. Charts in the grid (Y Axis) is not displayed properly. Is it possible to have a scroll bar so that user can see the chart properly.
Chart Display with Vertical Bottom Axis Labels of Large Size
Chart Display with Vertical Bottom Axis Labels of Large Size
- Attachments
-
- Labels Issue.zip
- Bottm Axis Labels
- (6.13 KiB) Downloaded 582 times
Re: Chart Display with Vertical Bottom Axis Labels of Large Size
Hello Neelam,
I suggest two solutions that I think you can use in your application.
First, you can change the size of Margins Left, Right, Bottom or Top, using next line of code:
It is an easy solution but it is not very elegant.
Second, I think that it is a best solution for you, because treat size of string label. See next example that demonstrate as string label.
I hope will helps.
Thanks,
I suggest two solutions that I think you can use in your application.
First, you can change the size of Margins Left, Right, Bottom or Top, using next line of code:
Code: Select all
tChart1.Panel.MarginLeft = 7;
Second, I think that it is a best solution for you, because treat size of string label. See next example that demonstrate as string label.
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
Steema.TeeChart.Styles.Bar bar1 = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
Random rnd = new Random();
tChart1.Aspect.View3D = false;
tChart1.Legend.Visible = false;
bar1.ColorEach = true;
bar1.Add(4, rnd.Next(100),"TESTESTETETETETEETETETETTESTESTETETETETEETETETET");
bar1.Add(6, rnd.Next(100),"s");
bar1.Add(7,rnd.Next(100),"s");
bar1.Add(9,rnd.Next(100),"s");
bar1.Marks.Visible = false;
tChart1.Panel.MarginLeft = 7;
tChart1.Axes.Left.Labels.Style = Steema.TeeChart.AxisLabelStyle.Mark;
tChart1.Axes.Bottom.Labels.Style = Steema.TeeChart.AxisLabelStyle.Value;
bar1.GetSeriesMark +=new Steema.TeeChart.Styles.Series.GetSeriesMarkEventHandler(bar1_GetSeriesMark);
}
void bar1_GetSeriesMark(Steema.TeeChart.Styles.Series series, Steema.TeeChart.Styles.GetSeriesMarkEventArgs e)
{
if (e.MarkText.Length > 20)
{
e.MarkText = e.MarkText.Substring(0, 10) + "...";
}
}
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |