Pre loader

SciChartOverview with UniformXyDataSeries

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

Hi I am using UniformXyDataSeries<double> .
And I can’t work with SciChartOverview.
Before that I was working with XyDataSeries<double, double> and everything worked very well.
And now the entire SciChartOverview is simply black.. (still functions as a scrollbar)
And I get this –

SciChartSurface didn’t render, because an exception was thrown:
Message: Object reference not set to an instance of an object.

Stack Trace: at
SciChart.Charting.Visuals.RenderableSeries.DrawingProviders.MountainSeriesDrawingProvider.trj(yhn
ayc, IPointSeries ayd) at
SciChart.Charting.Visuals.RenderableSeries.DrawingProviders.MountainSeriesDrawingProvider.OnDraw(IRenderContext2D
renderContext, IRenderPassData renderPassData) at
SciChart.Core.Extensions.EnumerableExtensions.ForEachDo[T](IEnumerable1
enumerable, Action
1 operation) at
SciChart.Charting.Visuals.RenderableSeries.BaseRenderableSeries.InternalDraw(IRenderContext2D
renderContext, IRenderPassData renderPassData) at
SciChart.Charting.Visuals.RenderableSeries.BaseRenderableSeries.SciChart.Charting.Visuals.IDrawable.OnDraw(IRenderContext2D
renderContext, IRenderPassData renderPassData) at
qxc.cyh(RenderPassInfo cff, IRenderContext2D cfg, Int32 cfh) at
qxc.cyg(ISciChartSurface cfc, RenderPassInfo cfd, IRenderContext2D
cfe) at qxc.RenderLoop(IRenderContext2D renderContext) at
SciChart.Charting.Visuals.SciChartSurface.DoDrawingLoop()

This is the code:

<s:SciChartSurface 
           x:Name="sciChart0" ... >  <s:SciChartSurface.RenderableSeries >
                        <s:FastLineRenderableSeries x:Name="RenderableSeries0"  DataSeries="{Binding samples[0]._Series, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                            Stroke="{Binding samples[0].Color, Mode=TwoWay}" 
                                            StrokeThickness="2" s:LegendModifier.IncludeSeries ="{Binding samples[0].Show, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                      </s:SciChartSurface.RenderableSeries > <!-- .....  -- >
    </s:SciChartSurface>




    <!-- Declare the SciChartOverview and bind to the main chart -->
                <s:SciChartOverview  x:Name="sciChart0Overview" MouseWheel="sciChart0Overview_MouseWheel" Margin="10,0,10,0"
                                    DataSeries="{Binding ElementName=sciChart0, Path=RenderableSeries[0].DataSeries}"
                                    ParentSurface="{Binding ElementName=sciChart0}" Height="50" VerticalAlignment="Bottom"
                                    SelectedRange="{Binding ElementName=sciChart0, Path=XAxis.VisibleRange, Mode=TwoWay}"
                                     ToolTip="Use the mouse wheel to change the sample shown here."
                                     />

Again – everything worked fine for me until I changed the data structure…
[samples[0]._Series is type of UniformXyDataSeries<double>()]
Thanks!

Version
6.6
  • You must to post comments
0
0

Hi there,

Thank you for contacting us.

We have investigated this issue and found out that this is a current limitation of UniformXyDataSeries. It does not support FastMountainRenderableSeries, which is used to render Area chart inside SciChartOverview. This limitation is mentioned in the relevant documentation article about this DataSeries type (see the last paragraph).

Solution 1
As a workaround, I would suggest changing background Chart type for SciChartOverview to Line Chart. You can specify desired Chart type via the “RenderableSeriesType” property. Also, you need to apply a proper Style via the “RenderableSeriesStyle” to configure that RenderableSeries:

        <s:SciChartOverview x:Name="SciChartOverview"
                        RenderableSeriesType="{x:Type s:FastLineRenderableSeries}"
                        DataSeries="{Binding ....}"
                        ParentSurface="{Binding ....}"
                        SelectedRange="{Binding ....">
        <s:SciChartOverview.RenderableSeriesStyle>
            <!-- Style that will apply to a RenderableSeries defined by SciChartOverview.RenderableSeriesType -->
            <Style TargetType="s:FastLineRenderableSeries">
                <Setter Property="StrokeThickness" Value="2"/>
                <Setter Property="Stroke" Value="Orange"/>
                <!-- Binding to SciChartOverview.DataSeries -->
                <Setter Property="DataSeries" Value="{Binding DataSeries}"/>
            </Style>
        </s:SciChartOverview.RenderableSeriesStyle>
    </s:SciChartOverview>

Please find additional info in our documentation, see “Changing the RenderableSeriesType / RenderableSeriesStyle Behind the SciChartOverview” section.

Solution 2
Alternatively, you could switch back to using XyDataSeries<double, double> for both FastLineRenderableSeries and SciChartOverview.

Feature Request
We already have it logged in our internal system as a feature request. Could you please let us know how critical this feature is for your product and whether you would be interested in seeing it added in future versions of SciChart.

Best regards,
Joeri

  • You must to post comments
0
0

My advice, I would try this technique to create a custom overview with a series also with UniformXyDataSeries

See SciChartOverview documentation.

How to: Create a Custom SciChartOverview with any Background

The SciChartOverview only supports a single series behind it, and does not allow a custom background. You can however use the SciChartScrollbar API to create a custom overview.

There’s a code sample in the docs but it’s incomplete. It starts off like this:

<Grid Background="{Binding ElementName=MainChartSurface, Path=Background}">
   <Grid.RowDefinitions>
         <RowDefinition Height="*" />
         <RowDefinition Height="100" />
   </Grid.RowDefinitions>

   <!-- Define a SciChartSurface -->
   <s:SciChartSurface x:Name="MainChartSurface">
      <!-- XAxis, YAxis, RenderableSeries omitted for brevity -->
   </s:SciChartSurface>

   <!-- Define a SciChartScrollbar with a custom background -->
   <Grid Grid.Row="1" >

         <!-- PLACE YOUR CUSTOM BACKGROUND HERE -->

         <!--  Define the scrollbar and bind to MainChartSurface XAxis  -->
         <s:SciChartScrollbar Grid.Column="0"
             Axis="{Binding ElementName=MainChartSurface, Path=XAxis}" />
   </Grid>

The missing part can be found in our Custom Overview example which links to this code on github.

The Overview is basically a SciChartScrollbar + SciChartSurface, so using the technique above you can create your own scrollbar and chart and put anything in it (even series with UniformXyDataSeries).

Let me know if this helps. In the meantime we will record a task to investigate the bug in more detail.

Best regards
Andrew

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.