SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components


Question: I\’m still working with v1 of SciCharts until I find the time to convert everything that needs to be changed for v2, but I\’m playing around with legends right now and running in to an odd issue. I\’m essentially copying your example in to my own code, but the legend doesn\’t want to appear on top of the graph pane. It appears just fine if it is set on an empty section of window, but disappears when placed on the pane. Is there a way to bring the legend to the front on the pane? It may also be worth noting that I’m attempting to apply a legend to seven different panes, would it be possible to apply a single legend, or are individuals required?

  • You must to post comments

Hi there,

The legend is a totally separate control, not part of SciChart. If you look at the example it is declared in a parent Grid, below the chart in the grid (which puts it higher in the Z-order). E.g. the structure is:

          <s:LegendModifier x:Name="legendSource"/>
   <s:SciChartLegend LegendData="{Binding LegendData,

The legend can actually be placed anywhere in your application, so long as it can bind to the LegendModifier which acts as a data-source. Think of the LegendModifier as a ViewModel in this case and Legend as a view.

So — to place it above the chart, just make sure its in a grid over the chart. We give it a margin to inset it slightly.

Yes, you will need one legend per chart as each one consumes data from the LegendModifier which must be present on the chart. Of course you could have one legend and re-bind it to each chart one at a time. So long as you’re prepared to do the logic to update the binding then this is also a possibility.

Best regards,

  • You must to post comments

I figured out what the issue was. My implementation was almost correct the first time except the Z order assumption, so because my legend was declared first, the graph itself was building over the legend. Forcing a Z Index worked like a charm. Thanks for your help.

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.