Pre loader

how to make two lines LegendModifier3D

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

0
0

When using the Orientation.Horizontal attribute in using LegendModifier 3D, Legend items are displayed in a single line.
I want to print in two lines but I’m not looking for a way to implement that feature.
If there’s a way to print it out, I’d appreciate it if you could let me know.

The development language is C#.

Version
SciChart WPF v8.5.0.28148 (20 May 2024)
  • Lex
    • Lex
    • 2 months ago
    Hi Min Jae Kim, Thanks for your question. I’m going to discuss this with our team and will get back to you as soon as I have an update. Kind regards, Lex, SciChart Technical Support Engineer
  • You must to post comments
0
0

Hi Min Jae Kim,

Hope you are doing well.
We discussed your inquiry.

The default Panel for SciChartLegend is a standard WPF StackPanel, which supports two layout modes – Vertical and Horizontal.
If you want Legend items to be arranged differently, you will need to re-template SciChartLegend and replace the default panel with a Panel that will support your desired layout.

Please take a look at the “Templating the SciChartLegend Control” section of the following documentation article:
SciChart WPF Documentation – LegendModifier _ WPF Chart Documentation

You can provide a Panel by setting the ItemsPanel property on the SciChartLegend.

For example, your LegendModifier with a custom Legend Template may look like this:

<s:LegendModifier x:Name="legendModifier" 
        ShowLegend="True" Orientation="Horizontal" Margin="10" >
<s:LegendModifier.LegendTemplate>
    <ControlTemplate>
        <!-- Change the AutoGenerated SciChartLegend -->
        <s:SciChartLegend ItemTemplate="{Binding LegendItemTemplate}"
                    LegendData="{Binding LegendData}"
                    Orientation="{Binding Orientation}"
                    ScrollViewer.HorizontalScrollBarVisibility="{Binding Path=(ScrollViewer.HorizontalScrollBarVisibility)}"
                    ScrollViewer.VerticalScrollBarVisibility="{Binding Path=(ScrollViewer.VerticalScrollBarVisibility)}"
                    ShowSeriesMarkers="{Binding ShowSeriesMarkers}"
                    ShowVisibilityCheckboxes="{Binding ShowVisibilityCheckboxes}">
            <s:SciChartLegend.ItemsPanel>
                <ItemsPanelTemplate>
                    <!-- StackPanel is the default Panel. -->
                    <!-- Please replace with another Panel to customize Legend Items layout -->
                    <StackPanel Orientation="{Binding Orientation, RelativeSource={RelativeSource AncestorType=visuals:SciChartLegend}}"/>
                </ItemsPanelTemplate>
            </s:SciChartLegend.ItemsPanel>
        </s:SciChartLegend>
    </ControlTemplate>
</s:LegendModifier.LegendTemplate>

Kind regards,
Lex

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.