Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.

0

1

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?

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:

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.

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.