Print Page | Close Window

In Need of Legend Help

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Chart Control
Forum Description: Topics Related to Codejock Chart Control
URL: http://forum.codejock.com/forum_posts.asp?TID=19615
Printed Date: 21 November 2024 at 9:25pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: In Need of Legend Help
Posted By: ChristineK
Subject: In Need of Legend Help
Date Posted: 27 March 2012 at 6:31pm
So I have a legend at the center bottom of my chart. Is there any way to make it multi-lined when it has these properties?
pContent->GetLegend()->SetVerticalAlignment(xtpChartLegendFarOutside);
pContent->GetLegend()->SetHorizontalAlignment(xtpChartLegendCenter);



Replies:
Posted By: SuperMario
Date Posted: 28 March 2012 at 9:18am
You can try ChartLegend.ColumnCount


Posted By: ChristineK
Date Posted: 28 March 2012 at 9:23am
I tried setting that ColumnCount with no luck. It seems to be ignored in my instance. When I did a call to GetColumnCount() it was returning a zero, even though my displayed legend had what I thought was 9 columns all one one row.


Posted By: Oleg
Date Posted: 28 March 2012 at 10:20am
Yes, default 0.  Appears a bug, however it will not effect performance.  0 and 1 both mean 1 column, 2 = 2 columns, etc.
 
I just tried ChartControl.Content.Legend.ColumnCount = 2 and it displayed 2 columns (only 4 items total).
 
This returned 2:
 
Debug.Print "column: " & ChartControl.Content.Legend.ColumnCount


Posted By: Manny
Date Posted: 28 March 2012 at 12:15pm

In my testing with this, I used SetColumnCount(2), and getting the following results:

    TopToBottom:      LeftToRight:

        1st   3rd        2nd   1st

        2nd   4th        4th   3rd

              5th              5th

 

I would think that if it worked correctly, I should really be seeing the following orders:

    TopToBottom:      LeftToRight:

        1st   4th        1st   2nd

        2nd   5th        3rd   4th

        3rd              5th

 



Posted By: Oleg
Date Posted: 28 March 2012 at 2:12pm
I took look and not sure what problem is.  I test both and get your expected results.  Please post entire chart you use so I can reproduce.
 
Also ColumnCount can be 0, only in case xtpChartLegendLeftToRight.  If xtpChartLegendTopToBottom then it will use 1 when ColumnCount is 0.  So default is 0 in all cases, just know it see 0 and test for direction, if xtpChartLegendTopToBottom it use value of 1.
 
In the picture used xtpChartLegendLeftToRight and 2 columns.  Added data in this order: NY, CA, FL, TX, OH
 



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net