Labeling on Left Axis with HorizBar

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Centrii
Newbie
Newbie
Posts: 23
Joined: Mon Jun 23, 2008 12:00 am

Labeling on Left Axis with HorizBar

Post by Centrii » Wed May 20, 2009 2:29 pm

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

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Wed May 20, 2009 2:39 pm

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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Centrii
Newbie
Newbie
Posts: 23
Joined: Mon Jun 23, 2008 12:00 am

Post by Centrii » Wed May 20, 2009 2:50 pm

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

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Post by Sandra » Thu May 21, 2009 8:14 am

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,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Centrii
Newbie
Newbie
Posts: 23
Joined: Mon Jun 23, 2008 12:00 am

Post by Centrii » Mon May 25, 2009 6:49 am

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

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon May 25, 2009 10:49 am

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Centrii
Newbie
Newbie
Posts: 23
Joined: Mon Jun 23, 2008 12:00 am

Post by Centrii » Mon May 25, 2009 11:31 am

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

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Post by Sandra » Mon May 25, 2009 12:00 pm

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,

Centrii
Newbie
Newbie
Posts: 23
Joined: Mon Jun 23, 2008 12:00 am

Post by Centrii » Mon May 25, 2009 12:15 pm

Hi Sandra,

Thank you very much, your example Code works fine in my Application.
Now I have all labels in my Chart, great :D


Thanks a lot

Centrii

Post Reply