Labeling on Left Axis with HorizBar
Labeling on Left Axis with HorizBar
Hi
I use the TChart for .Net v3 latest Version.
Now I have in my ASP.Net Application a problem with the labels on the Left Axis with a HorizBar.
If I have less than 20 DataPoint, every Point has its on label, but if I have more than 20, only every 5th Datapoint has a Label.
Can you tell me how I can solve this issue?
Thank you in advance
Ruben
I use the TChart for .Net v3 latest Version.
Now I have in my ASP.Net Application a problem with the labels on the Left Axis with a HorizBar.
If I have less than 20 DataPoint, every Point has its on label, but if I have more than 20, only every 5th Datapoint has a Label.
Can you tell me how I can solve this issue?
Thank you in advance
Ruben
Hi Ruben,
Probably your left axis is too short to show 20 labels without overlapping. That's why the chart only draws some of them. If you want you can use custom labels to force the labels you wish to be drawn.
Probably your left axis is too short to show 20 labels without overlapping. That's why the chart only draws some of them. If you want you can use custom labels to force the labels you wish to be drawn.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Hi Yeray,
Thank you for your quick answer.
The Left Axis isn´t to short, there is enough Space left between the labels, so there would be not a overlapping.
I think thats a problem with Major Ticks, or something like that. But I didn´t find a way to solve the problem so far.
Mayby you have an other Idea.
thanks
Ruben
Thank you for your quick answer.
The Left Axis isn´t to short, there is enough Space left between the labels, so there would be not a overlapping.
I think thats a problem with Major Ticks, or something like that. But I didn´t find a way to solve the problem so far.
Mayby you have an other Idea.
thanks
Ruben
Hellon Ruben,
Please check that next code, when you make chart biggest, all labels appears and when you make chart smaller some labels disappears, because doesn't fit in the Left Axes and labels doesn't overlap.
Example:
Thanks,
Please check that next code, when you make chart biggest, all labels appears and when you make chart smaller some labels disappears, because doesn't fit in the Left Axes and labels doesn't overlap.
Example:
Code: Select all
private void InitializeChart()
{
tChart1.Dock = DockStyle.Fill;
Steema.TeeChart.Styles.HorizBar hbar = new Steema.TeeChart.Styles.HorizBar(tChart1.Chart);
hbar.FillSampleValues(30);
}
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 |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Centrii,
Thanks in advance.
Using latest TeeChart for .NET v3 release available as you say you should have Dock property. Could you please check it again?Thanks for your Help, but I dont have the Dock Property in my Chart.
Yes, you can post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.I tried serveral different ways, but still have the same Problem.
Can you tell me where I can upload a JPEG, so that you can see what I mean.
Thanks in advance.
Best Regards,
Narcís Calvet / 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 |
Hello Centrii,
I make a simple example using custom labels, please check that next code works fine in your application.
InitializeChart():
If you want a more advanced code for solve the possibles problems of overlap you could see this theard specifically the last pages, that there are specific examples and the all possibilities if you can use to fix your issue.
Only, that you change Tchart1 for webChart1, because you can use the code with webChart.
I hope that will helps,
Thanks,
I make a simple example using custom labels, please check that next code works fine in your application.
InitializeChart():
Code: Select all
private void InitializeChart()
{
Steema.TeeChart.Styles.HorizBar bar = new Steema.TeeChart.Styles.HorizBar(tChart1.Chart);
bar.FillSampleValues(75);
bar.ColorEach = true;
bar.Marks.Visible = false;
for (int i = 0; i < bar.Count; i++)
{
bar.Labels.Add("point index " + i.ToString());
}
tChart1.Axes.Bottom.Labels.Items.Clear();
for (int i = 0; i < bar.Count; i++)
{
tChart1.Axes.Left.Labels.Items.Add(bar.YValues[i], bar.Labels[i]);
}
}
Only, that you change Tchart1 for webChart1, because you can use the code with webChart.
I hope that will helps,
Thanks,