Page 1 of 1
Labeling on Left Axis with HorizBar
Posted: Wed May 20, 2009 2:29 pm
by 10549439
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
Posted: Wed May 20, 2009 2:39 pm
by yeray
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.
Posted: Wed May 20, 2009 2:50 pm
by 10549439
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
Posted: Thu May 21, 2009 8:14 am
by 10050769
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:
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);
}
Thanks,
Posted: Mon May 25, 2009 6:49 am
by 10549439
Hi Sandra,
Thanks for your Help, but I dont have the Dock Property in my Chart.
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.
Centrii
Posted: Mon May 25, 2009 10:49 am
by narcis
Hi Centrii,
Thanks for your Help, but I dont have the Dock Property in my Chart.
Using latest TeeChart for .NET v3 release available as you say you should have Dock property. Could you please check it again?
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.
Yes, you can post your files at news://
www.steema.net/steema.public.attachments newsgroup or at our
upload page.
Thanks in advance.
Posted: Mon May 25, 2009 11:31 am
by 10549439
Hi Narcís,
I´m using TeeChart Version=3.5.3371.26406, and I definitely don´t have the Property Dock, neigther at the Chart nor at the Webchart and I´m using the TeeChart as TempChart="Httphandler".
I did an upload on the Upload-Page, there you can see my Problem.
Thanks,
Centrii
Posted: Mon May 25, 2009 12:00 pm
by 10050769
Hello Centrii,
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]);
}
}
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,
Posted: Mon May 25, 2009 12:15 pm
by 10549439
Hi Sandra,
Thank you very much, your example Code works fine in my Application.
Now I have all labels in my Chart, great
Thanks a lot
Centrii