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

0 votes

I’m trying to add annotations on a chart but they are rendering above my legend.

Initially (similar to most of the demo code I’ve seen), I setup my modifiers, then created my series and animated them in — then added my annotations (adding to annotationGroup). This created a timeline of blank chart surface with legend (good so far), annotations popping in before the chart series animated in (weird / not good) and on TOP of the legend (really bad), then the animation of the series after that.

I’ve tried about everything I can think of and the best I’ve been able to do is use a completion block of the animation rendering the series — and moved my chart modifiers (and legend) into that completion block. If I put the annotations in the completion block, they will render after the chart modifier and I have the same problem (even if placed after the chart modifiers). I have to set the annotations before the animation, and then the chart modifier in the completion block will work and the legend will be above the . Of course, this is a bit odd too — as first my annotations pop up by themselves on the blank surface, followed by my series animating in, then at the end of the 2 second animation, the legend just pops in.

I really would like my legend to be rendered first on the blank surface and the annotations and chart series to animate in together under my legend. I’m gathering that’s unlikely (at least the animation part) — but is there anyway I can place my legend first and still have the annotations go under it? It feels like the layers should be: modifiers > annotations > rendered series. I also I’ve read this order before in some WPF docs I believe, but doesn’t seem to be respected on iOS?

UPDATE: My current work around isn’t sufficient because I really need access to the renderable series to create the annotations which means I really can’t defer my chart modifiers (i.e. legend) until after the annotations. Additionally, if I need to update (remove / re-add) an annotation due to a series being deactivated in the legend, now my annotations are on top of the legend again.

0 votes

I am placing annotations at the top of every bar in a stacked bar graph (and a standard bar graph on another screen) showing the total of all the stacked bars by iterating through my data, generating the sum, and placing it at the correct x,y (an incredibly manual process that seems like there should be much easier to do but I found no other way to do it – if there is a better way, I would love to hear it, but that’s a secondary issue and not my current problem).

I also have a legend where the user can select / deselect series.

When the user selects/deselects a series from the legend, I need to hide all my annotations and then recreate them because the sums of the stacked bars has changed (or if no bars are showing, remove my annotation completely). My assumption is I could reiterate through my data and check series to see if they are visible (isVisible) and recalculate the sums and recreate the annotations (another very manual process but I can probably work it out).

My primary problem is I see no way for me to intercept that this legend event occurred. The series get hidden internally and I never have a chance to do anything with the annotations. It seems like this may be doable on other platforms but I’m at a loss on iOS. There is no delegate / block event handler / etc.

Any thoughts?

0 votes

I managed to implement a chart legend with a custom datasource (using just a SCIChartLegend object as a subview, not SCILegendModifier). However, I am unable to place the legend at specified position, it always snaps to upper-left corner of the screen. When creating a SCIChartLegend instance using the initializer that takes a Rect as a parameter, but not supplying a custom datasource, it draws correctly according to offsets specified by the supplied rect’s X and Y. It does respond to changes in the legendPosition property, but it still doesn’t allow to draw the view with any margins (which is what I’m actually trying to achieve).

1 vote

We’d like to customize the look of our legends. We have 4 legends displaying different data, but right now the only thing we can change is the Theme. Is there any way to customize the legend items, like add some icons, change the point marker shape and size, change the check box icon etc…

P.S.: I’m not a trial user. We have an iOS, Android and WPF licenses purchased.

Project info:

1 vote

We’re trying to make multiple legends on the screen, for example, 1 for the left axis and its data series, 1 for the right axis and its data series. I can see it’s possible in the WPF documentation, but in the iOS documentation it says “Coming soon!”. Do we need to wait for a future release of the Xamarin.iOS library or is it possible somehow now?

By the way, I’m not a trial user. We’ve just purchased a license today.

Lazar Nikolov

1 vote
0 answers

I am developing a WPF application with multiple series on a single surface.
I would like to have a legend displaying for each series a value based on user’s choice (e.g. first point, last point, average, min, max and so on).

How can i achieve this?

Thank you

0 votes

Hi All
By default legends are being draw on scichart surface. I want to draw them outside the scichart surface because as the number of render-able series increase legends hides them. Please give me suggestion how do i do it ?

0 votes

I am using the LegendModifier to bind my RenderableSeries to my legend.

In my legends Datatemplate, I have a checkbox and a colour picker.

I notice the LegendData object is of ChartDataObjectBase type. I would like to group my data in my legend (eg, with a label), rather than just display the list.

Is this possible, similar to the images attached ?

0 votes

I have issue with legend on high resolutions screens. Checkboxes and text is very small and hard to read. I couldn’t find any solution to change text size or provide my own template with text size for legend in Android SciChart.

I want to change legend text size depends on screen like it is in Android by declaring size in dimens.xml.

I do that for Axis labels but I don’t know how do the same for text in legend.

Does anyone know how to achieve this?

  • Marcin K asked 1 year ago
  • last active 1 year ago
0 votes
0 answers

iOS 11.2 with xCode 9.2

I have a chart with two data series and a legend. The chart lives in a view controller that is embedded in a navigation controller. I configured the navigation bar to hide itself when the phone it tilted into landscape mode: navigationController.hidesBarsWhenVerticallyCompact = true

When I tilt the phone the navigation bar is hidden as expected. However when I tap on the chart legend to turn off one of the data series I see the navigation bar re-appears. Screen shots attached.

0 votes

i currently place my custom (templated) legend inside the Scichartsurface (via xaml).

How can I offer the feature to drag the legend with the mouse to any location on the surface? Please note that I also use mouse movements and clicks for several chart modifiers so most likely I would have to check whether the mouse is hovering over the legend when a left mouse click event is raised?

Could you please get me started with some ideas or thoughts as I am not sure how to approach this issue.


  • bbmat asked 2 years ago
  • last active 2 years ago
1 vote

Visual Studio 2015

This isn’t a critical issue since it is handled but since it didn’t do this for the old version I thought I’d bring it to your attention. Awesome product BTW.

I just upgraded my .NET 4.0 SciChart 2D application from SciChart version to
Now I get the following (handled) exception message in the output window if I use a legend with my chart:

System.Windows.Data Warning: 40 : BindingExpression path error: ‘ScrollViewer’ property not found on ‘object’ ”LegendPlaceholder’ (Name=”)’. BindingExpression:Path=ScrollViewer.HorizontalScrollBarVisibility; DataItem=’LegendPlaceholder’ (Name=”); target element is ‘SciChartLegend’ (Name=”); target property is ‘HorizontalScrollBarVisibility’ (type ‘ScrollBarVisibility’)

This XAML the triggers the exception (comment it out and exception goes away):

                                <s:LegendModifier ShowLegend="True" />

How to reproduce:
– Take the EEG sample with the latest SciChart version (
– Change the target framework to .NET 4.0
– Change the SciChart references to use the SciChart 4.2, net40 DLLs.

I made a test solution for the following combinations:
.NET 4.5 with SciChart 4.2 works
.NET 4.0 with SciChart 4.2 throws exception
.NET 4.0 with SciChart 4.1 works

0 votes

I followed this post—custom-legend-with-color-picker-and-custom-point-markers for creating a custom Chart Legend and it worked great. One feature of it that I really liked was the checkbox behavior: CheckedChangeZoomExtentsBehaviour.EnableZoomExtentsOnChecked=”True” which zooms the chart to extents everytime you show or hide a series.

This checkbox behavior breaks when I move the Legend outside of the chart, which I accomplished by following this post:

How can I keep this checkbox behavior when moving the Legend outside of the Chart area?

Note: if I set ShowLegend=”True” in my s:LegendModifie> tag, the behavior properly works with the legend outside the Chart area, but now I have duplicate legends both inside and outside my chart area with this setting set.

<DataTemplate x:Key="LegendItemTemplate" DataType="s:SeriesInfo">
            <!-- DataContext is of type SeriesInfo -->
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />

                <!-- Visibility checkbox, bound to SeriesInfo.RenderableSeries.IsVisible -->
                <CheckBox Margin="5,0,0,0"
                    Foreground="{StaticResource LegendTextBrush}"
                    IsChecked="{Binding RenderableSeries.IsVisible, Mode=TwoWay}"
                    Visibility="{Binding LegendData.ShowVisibilityCheckboxes, RelativeSource={RelativeSource AncestorType=s:SciChartLegend}, Converter={StaticResource BooleanToVisibilityConverter}}" />

                <s:PointMarker Grid.Column="1" Margin="5,0,0,0" Width="40" Height="10" VerticalAlignment="Center" HorizontalAlignment="Center"
                    DataContext="{Binding RenderableSeries}"
                    DeferredContent="{Binding LegendMarkerTemplate}"
                    Visibility="{Binding ShowSeriesMarkers, RelativeSource={RelativeSource AncestorType=s:SciChartLegend}, Converter={StaticResource BooleanToVisibilityConverter}}" />

                <!-- Series Name, bound to SeriesInfo.SeriesName -->
                <TextBlock Margin="5,0,5,0"
            Foreground="{StaticResource LegendTextBrush}"
            Text="{Binding SeriesName}" />

    <s:LegendModifier x:Name="ChartLegend" ShowLegend="True" GetLegendDataFor="AllSeries" LegendItemTemplate="{StaticResource LegendItemTemplate}" ShowVisibilityCheckboxes="True"   />

<s:SciChartLegend x:Name="legendControl" DockPanel.Dock="Top"
                                       Orientation="Horizontal" Margin="10"

                                       LegendData="{Binding LegendData, ElementName=ChartLegend, Mode=OneWay}"
                                       ShowVisibilityCheckboxes="True" />           
0 votes

I would like to allow user click on Legend and highlight the corresponding Series on the chart but I don’t know if this feature is supported or not.

I tried to add mouse events to the Legend Modified but it seems like mouse events are not triggered

This is the simple code that I am using

<s:LegendModifier x:Name="chlLegend" ShowLegend="True" LegendPlacement="Top" Orientation="Horizontal" MouseDown="chlLegend_MouseDown" ScrollViewer.HorizontalScrollBarVisibility="Auto" />

Before investigating more I would like to ask you if you have any hints which is the correct way to implement this behavior.
Is the LegendModifier suitable for this or should I override instead the Legend Control Template?

Thank you in advance for the support

1 vote

I am trying to change the background color to match the background of the SciChartSurface but it just doesn’t want to change colors. I have a property bound to enable and disable the legend and that works fine. I tried doing the same for the “Background” property for SciChartLegend but nothing works. Even hard coding a brush doesn’t work. What am I missing?

I am using SciChart v3.42.0.6778

SciChartSurface instantiation in XAML. I am using the BrightSpark default theme.

<s:SciChartSurface Name="SciChartSurface"
Background="{Binding BackgroundColor, Converter={StaticResource ColorToSolidColorBrushConverter}}"
ChartTitle="{Binding GraphTitle}"
SeriesSource="{Binding GraphRenderModels}"


    <s:RubberBandXyZoomModifier IsAnimated="True"
                                ZoomExtentsY="False" />
    <s:ZoomPanModifier ExecuteOn="MouseMiddleButton" IsEnabled="True" />
    <s:ZoomExtentsModifier ExecuteOn="MouseDoubleClick"
                           XyDirection="XDirection" />
    <s:MouseWheelZoomModifier IsEnabled="True" XyDirection="YDirection" />
    <s:YAxisDragModifier AxisId="LeftAxis" />
    <s:YAxisDragModifier AxisId="RightAxis" />
    <s:XAxisDragModifier ClipModeX="None" />
    <s:CursorModifier Name="CursorModifier" IsEnabled="{Binding ShowCursors, Mode=TwoWay}">
            <Style TargetType="Line">
                <Setter Property="Stroke" Value="LightGray" />
    <s:LegendModifier Margin="6"
                      ShowLegend="{Binding ShowLegend}"
                      ShowVisibilityCheckboxes="False" />


When I attempt to change the background, I use the following:

<s:LegendModifier Margin="6"
    Background="{Binding BackgroundColor, Converter={StaticResource ColorToSolidColorBrushConverter}}"
ShowLegend="{Binding ShowLegend}"
ShowVisibilityCheckboxes="False" />

Which doesn’t work, though other color bindings in XAML work fine. If I change the color directly, say Background=”Red” or Background=”#FF0000″ It does not change either.

  • Alex Helms asked 4 years ago
  • last active 4 years ago
0 votes

FAQ: How to create a custom legend with TextFormatting for the FastHeatmapRenderableSeries? The provided legend in SciChart v3.4 does not allow text formatting.

  • Andrew asked 4 years ago
  • last active 3 years ago
1 vote

I’ve created a view with approximately 50 series, each containing ~200 datapoints.

I have noticed that rendering this with the legend showing, has a significant performance impact. I would expect the legend to have a cost, but I’m seing a big change in render time (the chart refreshes when the user checks a checkbox, so the performance has to be good).

I’ve added the legend using the following standard (I believe) xaml:

s:LegendModifier x:Name=”legendModifier”

When I set IsEnabled=”False” the performance improves significantly.

Does anybody have any hints to how performance can be improved?

Best regards

1 vote


I created a custom point marker by deriving from CrossPointMarker and overwriting the DrawInternal function (when I derive from BasePointMaker the behaviour is the same):

   protected override void DrawInternal(IRenderContext2D context, double x, double y, IPen2D pen, IBrush2D brush)
        double xOffset = Width * 0.5;
        double yOffset = Width * 0.5;
        context.DrawLine(pen, new Point(x - xOffset, y - yOffset), new Point(x + xOffset, y + yOffset));
        context.DrawLine(pen, new Point(x + xOffset, y - yOffset), new Point(x - xOffset, y + yOffset));

When I set the PointMarker property of a FastLineRenderableSeries to an instance of this new Type I see the markers on the rendered line, but it does not show up in the legend (just a line with a small gap is drawn).
When I change the code to use a CrossPointMarker the marker is cross displayed on the line and in the legend.
What do I need to do to display the point marker in the legend as well?

Thanks in advance

0 votes

Hi All,
I am having an issue with legend as legend box is displays on chart and its also display series name on it but colors are not coming in legend only series name is displayed.
I also attached a IMAGE showing the above issue.

1 vote


I have a chart showing data sets composed of multiple renderable series. Each data set is displayed using one FastLineRenderableSeries and three XyScatterRenderableSeries. All four series show in the legend for each data set, but I would only like to show the FastLineRenderableSeries in the legend for each data set. How can I do this?

I’ve seen the legendModifier.GetLegendDataFor property, but that can only be set to show options from this enum

public enum SourceMode
    AllSeries = 0,
    AllVisibleSeries = 1,
    SelectedSeries = 2,
    UnselectedSeries = 3,

which aren’t what I need. Some kind of flag on the renderable series saying whether they should be shown in the legend, or some way to specify the items source for the legend would be good.


1 vote

How can I only show Legends when the corresponding RenederableSeries is visible.
If the corresponding RenderableSeries is not visible then that Legend shouldn’t be shown.
Keep in mind my users will be able to hide and show RenderableSeries during runtime.

My xaml code is:

                                            <s:LegendModifier x:Name="legendModifier" ShowVisibilityCheckboxes="False" Orientation="Vertical" ShowLegend="{Binding ParentViewModel.ShowLegends, Mode=TwoWay}" Margin="10" />
                                                <Style TargetType="s:BaseRenderableSeries">
                                                    <Setter Property="StrokeThickness" Value="3"/>
1 vote

I have a chart with multiple dataseries, with each dataseries having annotations on top (like in the Trade Markers example). I have a legend which already shows or hides dataseries using a checkbox, but how can I make this checkbox also show or hide the annotations for that dataseries? Can I hook an event when this checkbox is triggered, or when the dataseries visibility changes?

1 vote

I need axes as described below. I can either modify your existing axis control or add my own in a canvas next to the SciChartSurface. So far I have been unable to modify your existing axis to fit my needs. A Y axis should look like this typical logarithmic axis (range 2 to 2000):

|-----------------  Resistivity ------------------|
2                                                2000

The specifications are
1.) Tick marks only at the end
2.) Title straddles the axis
3.) One axis per curve on the chart
4.) Axis uses same color as curve
5.) Axis uses same dash pattern as curve
6.) The edge of the chart is not an axis

This is basically a combination of a legend with multiple axes. I have not been able to get this effect with existing controls, so I have started to make my own in a canvas. To do this I need to line up my two tick marks with the edges of the chart. How can I obtain the location of the edges?

1 vote

How can i wrap legend? if legend width is out of window.

  • Raghupathy asked 5 years ago
  • last active 5 years ago
1 vote

I am stuck and do not seem to be able to make the legend become visible. I use a SciChartGroup and Datatemplate (MainChartView) as follows:

<UserControl x:Class="SciChartSample.Views.MainChartView"
         d:DesignHeight="400" d:DesignWidth="600"
         DataContext="{Binding MainChartViewModel, Source={StaticResource Locator}}">

    <i:EventTrigger EventName="SizeChanged">
            Command="{Binding UserControlResizedCommand, Mode=OneWay}"
            EventArgsConverterParameter="{Binding ElementName=LayoutRoot}"
            PassEventArgsToCommand="True" />


    <!-- This allows setting the Height of a pane from a viewmodel -->
    <Style x:Key="ChartPaneStyle" TargetType="s:SciChartGroupPane">
        <Setter Property="Height" Value="{Binding PaneViewModel.Height, Mode=TwoWay}"/>

    <!-- A number of converters which change parameters of charts based on the IsFirstChartPane property -->
    <resources:BoolToValueConverter x:Key="MinorsPerMajorConverter" TrueValue="4" FalseValue="2"/>
    <resources:BoolToValueConverter x:Key="MaxAutoTicksConverter" TrueValue="8" FalseValue="4"/>
    <resources:BoolToValueConverter x:Key="GrowByConverter" >
        <s:DoubleRange Min="0.05" Max="0.05"/>
        <s:DoubleRange Min="0.02" Max="0.02"/>
    <resources:IsModifierTypeConverter x:Key="IsModifierTypeConverter" />



        <RowDefinition Height="Auto" />
        <RowDefinition Height="*" />
        <RowDefinition Height="Auto" />

    <!-- Databinds a SciChartGroup to a list of ChartPaneViewModels -->
    <!-- Child chart panes are generated using the ItemTemplate below -->
    <s:SciChartGroup Grid.Row="1" 
                     ItemsSource="{Binding ChartPaneViewModels}"
                     s:ThemeManager.Theme="{Binding ElementName=ThemeCombo, Path=SelectedItem}"
                     ItemContainerStyle="{StaticResource ChartPaneStyle}">



                <s:SciStockChart Padding="0" 
                                 ChartTitle="{Binding Title}"  
                                 IsXAxisVisible="{Binding IsFirstChartPane}"     
                                 IsPanEnabled="{Binding ParentViewModel.IsPanEnabled}"
                                 IsRubberBandZoomEnabled="{Binding ParentViewModel.IsZoomEnabled}"  
                                 VerticalChartGroupId="{Binding ParentViewModel.VerticalChartGroupId}"                                     
                                 SeriesSource="{Binding ChartSeriesViewModels}">

                        <Style TargetType="s:CategoryDateTimeAxis">
                            <Setter Property="LabelProvider" Value="{Binding XAxisFormatting}"/>
                            <Setter Property="DrawMajorBands" Value="False"/>
                            <Setter Property="DrawMinorGridLines" Value="False"/>
                            <Setter Property="VisibleRange" Value="{Binding ParentViewModel.XVisibleRange, Mode=TwoWay}"/>
                            <Setter Property="GrowBy" Value="0, 0.02"/>


                        <Style TargetType="s:NumericAxis">
                            <Setter Property="TextFormatting" Value="{Binding YAxisTextFormatting}"/>
                            <Setter Property="AutoRange" Value="Always"/>
                            <Setter Property="MinorsPerMajor" Value="{Binding IsFirstChartPane, Converter={StaticResource MinorsPerMajorConverter}}"/>
                            <Setter Property="MaxAutoTicks" Value="{Binding IsFirstChartPane, Converter={StaticResource MaxAutoTicksConverter}}"/>
                            <Setter Property="GrowBy" Value="{Binding IsFirstChartPane, Converter={StaticResource GrowByConverter}}"/>



    <StackPanel Grid.Row="0"

        <ToggleButton Margin="2"
                      Command="{Binding PanModeCommand}"
            <StackPanel Orientation="Horizontal" Width="47">

                <TextBlock Margin="3" Text="Pan" />

        <ToggleButton Margin="2"
                      Command="{Binding ZoomModeCommand}"
            <StackPanel Orientation="Horizontal">

                <TextBlock Margin="3" Text="Zoom" />

        <Button Margin="2" Command="{Binding ElementName=priceChart, Path=ZoomExtentsCommand}">
            <StackPanel Orientation="Horizontal">

                <TextBlock Margin="3" Text="Zoom Extents" />


    <Button Margin="259,4,261,6">
        <Button Content="LoadData" Height="30" Width="80" Command="{Binding LoadDataCommand}" CommandParameter="UserC"/>


My ChartView looks as follows:

<UserControl x:Class="SciChartSample.Views.ChartView"

         DataContext="{Binding ChartViewModel, Source={StaticResource Locator}}">

        <ColumnDefinition Width="368*"/>
        <ColumnDefinition Width="367*"/>

        <RowDefinition Height="32"></RowDefinition>
        <RowDefinition Height="*"></RowDefinition>
        <RowDefinition Height="*"></RowDefinition>

    <!-- Define Toolbar -->
    <StackPanel Grid.Row="0" Orientation="Horizontal" Grid.ColumnSpan="2">
        <ToggleButton Content="Zoom" Margin="3"
                      IsChecked="{Binding ZoomEnabled, Mode=TwoWay}"/>
        <ToggleButton Content="Pan" Margin="3"
                      IsChecked="{Binding PanEnabled, Mode=TwoWay}"/>
        <ToggleButton Content="MouseWheel" Margin="3"
                      IsChecked="{Binding MouseWheelEnabled, Mode=TwoWay}"/>
        <ToggleButton Content="Rollover" Margin="3"
                      IsChecked="{Binding RolloverEnabled, Mode=TwoWay}"/>
        <ToggleButton Content="Cursor" Margin="3"
                      IsChecked="{Binding CursorEnabled, Mode=TwoWay}" />

    <visuals:SciChartSurface x:Name="MainChart" Grid.Row="1" sciChart3:ThemeManager.Theme="Chrome" Padding="30" Grid.RowSpan="2" Grid.ColumnSpan="2">


            <renderableSeries3:FastLineRenderableSeries SeriesColor="DarkBlue" DataSeries="{Binding ChartData}">
                    <pointMarkers:EllipsePointMarker Width="7" Height="7" Stroke="DarkBlue" Fill="DarkBlue" StrokeThickness="1"/>


                SubDayTextFormatting="dd/MM/yyyy HH:mm:ss.fff"
                VisibleRange="{Binding ChartData.XValues, Mode=OneWay}"

                VisibleRange="{Binding ChartData.YValues, Mode=OneWay}"

                <chartModifiers3:RubberBandXyZoomModifier IsEnabled="{Binding ZoomEnabled, Mode=TwoWay}" IsXAxisOnly="True"></chartModifiers3:RubberBandXyZoomModifier>
                <chartModifiers3:ZoomPanModifier IsEnabled="{Binding PanEnabled, Mode=TwoWay}"></chartModifiers3:ZoomPanModifier>
                <chartModifiers3:MouseWheelZoomModifier IsEnabled="{Binding MouseWheelEnabled, Mode=TwoWay}"></chartModifiers3:MouseWheelZoomModifier>
                <chartModifiers3:RolloverModifier IsEnabled="{Binding RolloverEnabled, Mode=TwoWay}"></chartModifiers3:RolloverModifier>
                <chartModifiers3:CursorModifier IsEnabled="{Binding CursorEnabled, Mode=TwoWay}"  ShowTooltip="True" ShowTooltipOn="Always"  ></chartModifiers3:CursorModifier>
                <chartModifiers3:LegendModifier x:Name="legendSource" ShowLegend="True" Visibility="Visible" GetLegendDataFor="AllSeries"/>


    <visuals:SciChartLegend LegendData="{Binding LegendData, ElementName=legendSource, Mode=OneWay}"/>


Please note that I included a legendModifier in the ChartView and also defined a ChartLegend in same. But the legend is not visible at all. What am I doing wrong? Thanks

  • bbmat asked 5 years ago
  • last active 5 years ago
1 vote

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"/>
  • Raghupathy asked 5 years ago
  • last active 5 years ago
1 vote

I have a case where there can be hundreds or even thousands of potential series on the surface.
When I use the LegendModifier, I only see the first 20 or so series.
What would it take to display a scrollbar so that the user can see all available series?

  • dwoerner asked 5 years ago
  • last active 5 years ago
1 vote


I have a surface with multiple dataseries in it. I have a legend for each serie, setup like this:

chart.ChartModifier = new Abt.Controls.SciChart.ChartModifiers.LegendModifier() { Name = "legendModifier" };

var legend = new Abt.Controls.SciChart.Visuals.SciChartLegend { Margin = new Thickness(5) };

// Bind the legend to the data source
var legendDataBinding = new Binding("LegendData") { Source = chart.ChartModifier };
legend.SetBinding(Abt.Controls.SciChart.Visuals.SciChartLegend.LegendDataProperty, legendDataBinding);

And it works fine.
However, I would also like to bind the visibility of the legends to the visibility of the dataseries. I have tried this:

// Bind the legend visibility to the data source
var legendVisibilityBinding = new Binding("Visibility") 
    Converter = new BoolToVisibilityConverter(),
    Source = line.IsVisible
legend.SetBinding(Abt.Controls.SciChart.Visuals.SciChartLegend.LegendDataProperty, legendVisibilityBinding);

But it doesn’t seem to work, any suggestions, anyone?


  • JacobB asked 5 years ago
  • last active 5 years ago
Showing 28 results
This template supports the sidebar's widgets. Add one or use Full Width layout.