Jump to content
Software FX Community

How to add custom legend items for multiple charts


madhu
 Share

Recommended Posts

<?xml:namespace prefix = o />

Hello Sir,

 

How to add custom legend items to legend box for multiple charts?<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

 

Single chart, the code is working correctly but if we apply mulitple charts it
Link to comment
Share on other sites

I have tested your code and I saw that you are calling _chart.LegendBox.CustomItems.Clear() twice. One before the first "for" loop and the second one just after the "for". The reason that your custom legend items are not being shown is because you are deleting them in each call of the loop. If you delete the second call of the CustomItems.Clear method, your chart will display all the custom legend items.

_chart.LegendBox.CustomItems.Clear();

for (int QuesInd = 0; QuesInd < questionInfoArray.Length; QuesInd++)

{

_chart.LegendBox.CustomItems.Clear()

;//This one is not necessary
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...