Skip to main content

Microsoft Silverlight

Unanswered Question Customizing Lineseries LegendRSS Feed

(0)

weeser
weeser

Member

Member

133 points

96 Posts

Customizing Lineseries Legend

Greetings,

I was wondering how you could edit the legend of a lineseries to display custom data.  For example, i have 4 line series that act as limits on the chart so they are just solid straight lines.  In the legend, i would like to have the label and value for each of those lines....i.e. ( UpperLimit1 Value = 5 )...something like that anyways, a label, then value.  Any help/guidance would be great!

Thanks

 

Josh, AKA Weeser
Kansas State University-Salina

David Anson
David Anson

Participant

Participant

1718 points

212 Posts

Microsoft

Re: Customizing Lineseries Legend

Two possible suggestions:

1. Manually add the content you want to the Legend (possibly via a custom Template for Chart). Chart should leave your stuff alone when it adds/removes series entries.

2. Override DataPointSeries.CreateLegendItem to provide your own custom LegendItems. (Unfortunately, because the classes are all sealed for the time being, this would require building your own DLL and unsealing them.)

Hope this helps!


http://blogs.msdn.com/delay

This posting is provided "AS IS" with no warranties, and confers no rights.

weeser
weeser

Member

Member

133 points

96 Posts

Re: Customizing Lineseries Legend

David,

Do you have some sample code, or guidance regaurding number one?  I dont know how to edit the legend in the chart template.

Thanks

Josh, AKA Weeser
Kansas State University-Salina
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities