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

Answered
0
0

I am using a SciChartScrollbar to scroll the Y axis of a plot. I was previously using SciChart 3.4 and the control worked well. My XAML is as follows:

    <Grid Grid.Column="1">

        <Grid.RowDefinitions>
            <RowDefinition Height="{Binding ActualYAxesHeightValue, ElementName=PropertyProxy, Mode=OneWay, Converter={StaticResource DoubleToGridLengthConverter}}"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <helpers:TotalSizeOfAxes x:Name="PropertyProxy" Element="{Binding ElementName=FormationChart}" />

        <s:SciChartSurface x:Name="OverviewSurface" s:ThemeManager.Theme="BrightSpark" Grid.Row="1" Loaded="OnOverviewSurfaceLoaded">
            <s:SciChartSurface.RenderableSeries>
                <sciChartExtensions:StepLineRenderableSeries DataSeries="{Binding HResistivityChartData, Mode=TwoWay}">
                    <s:FastLineRenderableSeries.Style>
                        <Style TargetType="s:FastLineRenderableSeries">
                            <Setter Property="Stroke" Value="Blue" />
                            <Setter Property="StrokeThickness" Value="1" />
                        </Style>
                    </s:FastLineRenderableSeries.Style>
                </sciChartExtensions:StepLineRenderableSeries>
            </s:SciChartSurface.RenderableSeries>

            <s:SciChartSurface.XAxis>
                <s:NumericAxis AxisAlignment="Left" DrawMajorGridLines="False" DrawMinorGridLines="False"
                               Visibility="Collapsed" />
            </s:SciChartSurface.XAxis>

            <s:SciChartSurface.YAxis>
                <s:LogarithmicNumericAxis AxisAlignment="Top" VisibleRange="0.2,2000" FlipCoordinates="True"
                                          DrawMajorGridLines="False" DrawMinorGridLines="False"
                                          Visibility="Collapsed"/>
            </s:SciChartSurface.YAxis>
        </s:SciChartSurface>

        <s:SciChartScrollbar x:Name="DepthScrollbar" Grid.Row="1" Axis="{Binding ElementName=DepthAxis}" VerticalAlignment="Top"
                             Margin="{Binding ElementName=FormationChart, Path=Padding, Mode=OneWay}"
                             Loaded="OnScrollbarLoaded">
        </s:SciChartScrollbar>

    </Grid>        

I have attached a picture of the plot. The scrollbar is black instead of transparent, and the width does not fill the grid column. I checked the knowledge base article on using this control, but I don’t think the article was updated for 4.x.

  • You must to post comments
Great Answer
0
0

I have found a workaround. First was the theme. In my original XAML I did not specify a theme for the scrollbar. Setting the theme to BrightSpark to match the theme of the underlying SciChartSurface give me the same colors that I had before.

As for the width, I could not fix that in XAML, so I added code in the event handler OnScrollBarLoaded

DepthScrollbar.Width = OverviewSurface.Width;

  • Andrew
    Super glad you found a solution!
  • You must to post comments
0
0

Hi there,

While the KB article wasn’t updated, the examples were. Please find these examples on using scrollbars in v4.

Of note, the default theme in SciChart v4 is ‘SciChartv4Dark’. The default theme in SciChart v3 is ‘ExpressionDark’. This can also account for some colour changes.

Finally, there is a large section in the Documentation (www.scichart.com/downloads -> Click on Documentation) on the SciChartScrollbar.

Note: The documentation is in the process of being transcribed from Word to Web.

Please let me know if this helps

Best regards,
Andrew

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.