Pre loader

Legend Styling

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums


how can i apply styling for legend in legend modifier? i want to apply the following style

<Style x:Key="LegendStyle" TargetType="s:LegendModifier">
        <Setter Property="ContentTemplate">
            <s:SciChartLegend  x:Name="legendControl"  Margin="2,2" Orientation="Horizontal"  Background="Transparent" BorderThickness="0" ScrollViewer.VerticalScrollBarVisibility="Auto"
                                Visibility="{Binding IsLegendVisible,Converter={StaticResource  BoolToVisibilityConverter}}" 
                                LegendData="{Binding LegendData,  ElementName=legendModifier,Mode=OneWay}">

                    <SciChart:ColorToBrushConverter x:Key="ColorToBrushConverter"/>
                    <DataTemplate DataType="SciChart:XyzSeriesInfo">
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                            <Rectangle Grid.Column="0"

                                                Stroke="{Binding SeriesColor,
                                                Converter={StaticResource ColorToBrushConverter}}" />
                            <TextBlock Grid.Column="1" Foreground="Black" 
                                                Text="{Binding SeriesName}" FontWeight="Normal"/>
  • You must to post comments

Hi Raghupathy,

Have you seen our Legend API Overview article? It shows you the legend API, including templating the legend items.

We also have an advanced tutorial on legend item templating to introduce custom fields into the legend. Perhaps this helps?

enter image description here

If not, please explain clearly what you need and we will do our best to help.

Best regards,

  • Raghupathy
    I want to display the legends outside of the chart surface i can't able to use ""
  • Raghupathy
    I want to show the legends outside of the chart surface i can do that for GetLegendDataFor="AllSeries" but i can't do that for GetLegendDataFor="AllVisibleSeries" i got a error message saying that 'Set property 'Abt.Controls.SciChart.ChartModifiers.LegendModifier.GetLegendDataFor' threw an exception.' Line number '67' and line position '39'. I create the chart when my application launch after when the user select the y axis value then only polt the graph.I think this is the problem.also how can i change the legend color it always white??
  • Andrew Burnett-Thompson
    Hi Raghupathy, I believe there was a bug reported with GetLegendDataFor ... see It was fixed in build 5199. Can you double-check the latest nightly build and let us know if it resolves the problem? If not, please let me know. One of the team will investigate. For your other question - legend color white, why not create a new question, we will answer it asap. Best regards, Andrew
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.