space isssue

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Post by Sandra » Fri May 22, 2009 9:39 am

Hello shikha,

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.Bar bar = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
            bar.FillSampleValues(30);
            bar.Marks.Visible = false;
            for (int i = 0; i < bar.Count; i++)
            {
                bar.Labels.Add("point index " + i.ToString());   
            }

            tChart1.Axes.Bottom.Labels.Angle = 90;
            tChart1.Axes.Bottom.Labels.Items.Clear();

            for (int i = 0; i < bar.Count; i++)
            {
                tChart1.Axes.Bottom.Labels.Items.Add(bar.XValues[i], bar.Labels[i]);
            }
        }
If you want a more advanced code for solve the possibles problems of overlap you could see this theardspecifically the last pages, that there are specific examples and the all possibilities if you can use to fix your issue.

I hope that will helps,

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

Neelam
Advanced
Posts: 193
Joined: Fri Jun 08, 2007 12:00 am

Post by Neelam » Fri May 22, 2009 10:22 am

hey but u are only setting it to 90 degrees which i have already done. but still i m getting error. please let me know if i have missed something i ur code. i can not use your code directly as i have other processing in my code. so if u can tell me what eactly will make a adifference , it will be great. thanks in advance.

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

Post by Yeray » Fri May 22, 2009 11:45 am

Hi shikha,

Do all the points you've added have labels? Note that if you've added some of your points with labels and others without, the axis will be set to show the labels but most of them are empty. For example:

Code: Select all

Steema.TeeChart.Styles.Bar bar = new Steema.TeeChart.Styles.Bar(tChart1.Chart);
bar.Marks.Visible = false;

bar.Add(10);
bar.Add(20, "point index 1");
bar.Add(50);
bar.Add(30);
bar.Add(10, "point index 4");

tChart1.Axes.Bottom.Labels.Angle = 90;
If that's not your situation, please, try to reproduce your problem in a simple example project we can run as-is to reproduce it here.
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
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

Neelam
Advanced
Posts: 193
Joined: Fri Jun 08, 2007 12:00 am

Post by Neelam » Fri May 22, 2009 12:13 pm

Hi
no its not the case . i am adding all points. i can say that because
when i set tcStraAssessRC.Page.MaxPointsPerPage = 4 , I can see all labels and the bars are also clearly shown.

But when i set tcStraAssessRC.Page.MaxPointsPerPage = 10 then i can not see some labels and bars are also diminished in size( in width).

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

Post by Yeray » Fri May 22, 2009 3:19 pm

Hi shikha,

I suspect that your chart may be too short to show as many labels in its bottom axis but it would be easier to see what's happening if you could send us a simple example project we can run as-is to reproduce the problem here.
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

Neelam
Advanced
Posts: 193
Joined: Fri Jun 08, 2007 12:00 am

legend with scrollbar

Post by Neelam » Fri May 22, 2009 4:34 pm

Hi
Plesae let me know is there any way to have a scrollbar in legend. The isssue is my legend contains 40 values and only 10 are showing up.Thanks

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

Post by Yeray » Mon May 25, 2009 7:19 am

Hi shikha,

In that case, you may be interested on Legend Scroll Bar Tool. Please, take a look at the example
All Features\Welcome !\Miscellaneous\Legend\Legend ScrollBar Tool from TeeChart Feature Demo. You'll find tutorials and demos at TeeChart's program group.
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

Neelam
Advanced
Posts: 193
Joined: Fri Jun 08, 2007 12:00 am

Post by Neelam » Mon May 25, 2009 2:51 pm

Hey
Thanks so much, this really looks good..

Neelam
Advanced
Posts: 193
Joined: Fri Jun 08, 2007 12:00 am

Post by Neelam » Mon May 25, 2009 2:58 pm

Also
I have foound my other issue , I can explain it better now. Actually my labels are VERY long( that is they have around 20-40 characters). So when i set them to
tcStraAssessRC.Axes.Bottom.Labels.Angle = 90

this solves my preoblem of seeing all labels BUT as they are very long they make chart very small ( so the axis is changed and bars become very small respectively as now the labels take most of teh space).

This can be seen in your FEATURE DEMO-ALL features-Basic features-
tChart1.Series.Clear();

tChart1.Series.Add(new Steema.TeeChart.Styles.Bar());
tChart1.Series[0].Clear();
tChart1.Series[0].Add(123, "ABC", Color.Red);
tChart1.Series[0].Add( 456, "DEF", Color.Blue );
tChart1.Series[0].Add( 321, "GHI", Color.Green );

Change the bar Marks :

tChart1.Series[0].Marks.Style = smsValue ;
If i set Axes.Bottom.Labels.Angle = 90, then you can see the chart goes little up and the bars become little small and the axes also changes from 500 to 600.

So as my labels are very big and I want to display them, the chart becomes too small. IS there a solution for this? Thanks in advance.

Neelam
Advanced
Posts: 193
Joined: Fri Jun 08, 2007 12:00 am

Post by Neelam » Mon May 25, 2009 3:00 pm

Also do we have anything like CHART scrollbar, so that in limited space, we can have this to show everything- chart, lengthy labels without comprimising with the visisbility of chart/bars. thanks.

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

Post by Sandra » Tue May 26, 2009 8:16 am

Hello shikha,

I recomend that see this theardspecifically from page 3 until the last. Where you have explained advanced code for solve the size of words. Also there are all cases of possible if you works with labels axes.


I hope that helps you.


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

Neelam
Advanced
Posts: 193
Joined: Fri Jun 08, 2007 12:00 am

Post by Neelam » Tue May 26, 2009 12:02 pm

hI
tHANKS FOR The REPLY. But going through it , i found that the only solution is to use Vertical orientation of labels. But what if I dont want Vertical orienation and still want to show all labels?

Neelam
Advanced
Posts: 193
Joined: Fri Jun 08, 2007 12:00 am

Post by Neelam » Tue May 26, 2009 1:19 pm

Hi
Its a bit urgent, awaiting ur reply

Neelam
Advanced
Posts: 193
Joined: Fri Jun 08, 2007 12:00 am

Post by Neelam » Tue May 26, 2009 1:21 pm

sorry for not being clear, what i meant was that showing labels vertically will reduce chart size. how to counter that side effect? Thanks

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

Post by Yeray » Tue May 26, 2009 3:19 pm

Hi shikha,

Maybe a good tip for you could be reducing text size:

Code: Select all

tChart1.Axes.Bottom.Labels.Font.Size = 6;
Also, another possibility could be adding a line break into your label strings:

Code: Select all

        private void InitializeChart()
        {
            chartController1.Chart = tChart1;
            
            tChart1.Series.Add(new Steema.TeeChart.Styles.Bar());
            tChart1.Series[0].Add(123, "really long long label 1", Color.Red);
            tChart1.Series[0].Add(456, "really long long label 2", Color.Blue);
            tChart1.Series[0].Add(321, "really long long label 3", Color.Green);

            tChart1.Axes.Bottom.Labels.Angle = 90;

            tChart1.GetAxisLabel += new Steema.TeeChart.GetAxisLabelEventHandler(tChart1_GetAxisLabel);
        }

        void tChart1_GetAxisLabel(object sender, Steema.TeeChart.GetAxisLabelEventArgs e)
        {
            if (e.LabelText.Length > 16)
            {
                string tmp1 = e.LabelText.Substring(0, 16);
                string tmp2 = e.LabelText.Substring(16, e.LabelText.Length-16);
                
                e.LabelText = string.Format("{0}{1}{2}", tmp1, "\n", tmp2); 
            }
        }
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

Post Reply