Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Chart Control
  New Posts New Posts RSS Feed - In Need of Legend Help
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

In Need of Legend Help

 Post Reply Post Reply
Author
Message
ChristineK View Drop Down
Newbie
Newbie


Joined: 30 January 2012
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote ChristineK Quote  Post ReplyReply Direct Link To This Post Topic: In Need of Legend Help
    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);
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 28 March 2012 at 9:18am
You can try ChartLegend.ColumnCount
Back to Top
ChristineK View Drop Down
Newbie
Newbie


Joined: 30 January 2012
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote ChristineK Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Manny View Drop Down
Newbie
Newbie


Joined: 28 March 2012
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote Manny Quote  Post ReplyReply Direct Link To This Post 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

 

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
 
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.203 seconds.