Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
360
LegendItem Container
posted

Questions:

0) Am I correct in assuming that the container elelemnt that holds the LegendItems is a StackPanel? 

1) If the answer to #0 above is yes, would I modify the control template to change the orientation to horizontal?

2) If I need to modify the template, I'm pretty sure I can't just "add stuff" and expect it to work. What should I do?

Parents
  • 30692
    Suggested Answer
    Offline posted

    0) No, unfortunate to your purposes, the XamWebChart's current Legend uses a Canvas to lay out the legend items. It will search for an element named RootCanvas in the template you provide and expect it to be a Canvas in which to lay out its elements. These layout routines include the auto ellipsis of series labels if there is not enough space for the legend. You can use some trickery to try and use different containers than a canvas with the existing legend control. But you may find it simpler, depending on your requrements, to manually add and remove legend items to a StackPanel or to make a feature request that the Legend control container type be more customizable (http://devcenter.infragistics.com/protected/requestfeature.aspx)

    1) see answer for 0.

    2) you can add whatever you want (within reason) to a lookless control's template as long as you maintain the essential contract between the logic of the control and its template. In this case, the Legend control makes one contractual demand of its template; that it provide a control of type Canvas named RootElement, that it will position LegendItems into using X,Y positioning, based on its internal layout calculations.

    -Graham

Reply Children
No Data