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

1 vote


After the chart is added with data I want to switch between using the ZoomExtents method and manually setting the AutoRange = Never and setting the VisibleRange. It works using either of them, but after using the ZoomExtents method the axis range is never adjusted to the VisibleRange. Am I doing something wrong or is not possible ?

Using SciChart 3.1.0

Best regards

1 vote

I attached a scrollbar to a Y axis, and it is functioning as expected except for how it handles VisibleRange.

If my code sets the Y Axis VisibleRange to be smaller than the min/max extent of the data series, the scrollbar behaves as expected – the size of the scrollbar decreases, and I can use it to pan through the full VisibleRange.

However, if I set the VisibleRange to be larger than the min/max extent of the data series, the scrollbar resets the VisibleRange to the actual data series extent as soon as I grab it.

Can I disable this behavior?

I would expect the scrollbar to navigate within the current VisibleRange, and not modify it.

This is using v3.21.0.5511

  • wrlear asked 6 years ago
  • last active 6 years ago
0 votes


I have graphs with VisibleRange set in both axes (Y and X). The way I would like my graphs to behave is as follows:

  1. When the graph is loaded, the VisibleRanges are applied in both axes.
  2. When I zoom, ZoomExtents applies to both axes
  3. When I double click on the graph to restore, the initial VisibleRanges as in (1) applies.

– I set the VisibleRange by Binding
– One of the graphs has a Logarithmic XAxis (Just incase it has a special treatment)
– Currently my graphs set VisibleRanges correctly at first, but not after zoom and restore.

Help me out with how to proceed, please.

Thanks in advance.

Kilosa M.

0 votes

I’m trying to properly display a circle series as a circle. I’ve made sure the graph is not resizable, and set the GridLinesPanelStyle to ensure that it’s square. However, when do ZoomExtents on the ViewPortManager, it always adds a little buffer space on the Y axis but not the X so you end up with an ellipse. Is there any way to set and/or remove this buffer? You can see this in the image, the graph itself is square and the range on the X axis is 300, but on Y it’s a little bit bigger so what you see isn’t really a circle. Thank you.

  • AE Admin asked 4 years ago
  • last active 4 years ago
0 votes

I would like to ZoomOut immedeatly after new data is rendered.
I would like to have flexibility in Zooming Out, therefore I cannot use AutoRange.Always.
I have implemented ZoomOut in SciChartSurface.Rendered, but that seems to be too early, as it doesnt react on the new data, instead zooms out based on the old data.
I have to wait 100 ms, then it works and it zooms out based on the new data.
Is there an event even after SciChartSurface.Rendered that is better suited to call the ZoomOut function?

I have used the technique described in the answer below. However, I am awaiting the dataChange and then call ZoomOut. It still doesnt work.

In my Code behind:

            await viewModel.DisplayData();

DisplayData adds LineRenderableSeriesViewModel with DataSeries to the RenderableSeries Observable Collection.

And in my ViewModel:

    internal void ZoomOut()
        if (RenderableSeries.Count() > 0)
            var parentSurface = ((LineRenderableSeriesViewModel)RenderableSeries.ElementAt(0)).DataSeries.ParentSurface;
            var viewportManager = parentSurface.ViewportManager;
            viewportManager.BeginInvoke(() =>


This way it works:

            await viewModel.DisplayData();
            await Task.Run(()=>System.Threading.Thread.Sleep(TimeSpan.FromMilliseconds(500)));

But that can’t be the solution – I need an event that fires when all the data is known to sciChartSurface.


0 votes


I would like to ask whether it is possible to reduce the default margins around the 3D plane cube on 3D plots? I realize that I can change it by relocating the camera and with ZoomModifier but, once the ZoomExtents() is called, the margins are restored back. I attached here a screenshot with the green line showing the margin area that I mean.

Thank you in advance!

  • corvex asked 8 months ago
  • last active 8 months ago
0 votes

Is it possible to define custom extents such that when I call ChartSurface.ZoomExtents() it will zoom out to where I want instead of the default found by the chart?

I have a requirement that dictates the amount of padding around each axis. I use a custom ViewPortManager and override the OnCalculateNewYRange() and OnCalculateNewXRange() functions to set the range.

I use the ZoomState to decide whether to allow zoom to do its job versus my dictation of the range when the zoom has been to extents. This unfortunately shows an awkward bump between the 3 states.

  1. Zoomed
  2. Zoomed to extents
  3. Zoomed to my custom range

Between 2 and 3 there is a “bump” as the chart resizes. Imagine the user double clicks to ZoomExtents and the animation from zoomed goes out to extents and then suddenly does the same from extents to my custom range. It’s really awkward and I don’t want to lose the animation as it’s a very nice user experience instead of an abrupt switch from zoomed to extents.

So, it would be great to set the extents in my derived ViewPortManager such that a ZoomExtents zooms directly to my custom extents instead of the default.

0 votes


Are there any events on the chart which fires on zoom starts and zoom ends which i can use to calculate the time taken for the zoom operation.


Pruthvi Sagar

0 votes


I’ve been wondering. In SciChart’s current WPF version, is there any way to configure the default ViewportManager (or create a new customized one in a simple way) such that whenever I call its ZoomExtents method, the X and Y axes’ ranges will include any custom annotations I’ve added to the chart’s annotations collection?

My custom annotations are basically Images, with fixed Width and Height, and I set their X1 and Y1 properties to hold certain data points I have on the chart. The issue is, I need axes’ ranges to include the Image in it’s entirety, meaning I would have to somehow convert their Widths and Heights to “data point values”, since the new visible range should be in terms of data values, if I’m not mistaken.

Any good example to how this could be done?

  • Ilan Rozen asked 3 months ago
  • last active 3 months ago
2 votes

I’ve been trying to get SciChart to work with good performance and as part of my experimentation am trying to see how RenderPriority.Manual works. As far as I can tell, it doesn’t.

I haven’t been able to find much in terms of samples or docs. According to the little documentation here:

It says

Manual — Never redraws automatically. You must manually call
InvalidateElement() or ZoomExtents() on the SciChartSurface in order
to get it to redraw

Now, when I try to call either of those functions on my SciChartSurface, nothing visually happens. I’ve tried other Invalidate methods as well, and still no refresh love.

I’ve attached the small sample application that repro’s the issue.

Please let me know what I’m doing wrong.


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" />           
2 votes

Hello, SciChart team,
i’m trying to ZoomExtents a chart, which is in in one tab of TabControl, from another tab, but it doesn’t change visible ranges.

i wanted to attach an example project, but every time i try i get “Forbidden” popup & nothing attaches (file size is 900 KB, format – “.zip”)
here’s link for an Example
please help with this not so large but unpleasant issue,
thanks heaps,

0 votes

When setting yAxis to have auto range enabled or when manually calling chartSurface.zoomExtents() after adding new data to chart, the top point are cropped (not shown in the chart). I have attached an image that shows this phenomenon (note: bottom part of the chart is cropped out of the image).

Below is full code of an Activity that reproduces the problem. I also updated the attached image that shows the result of the following code. As you can see both red points with y value of 1.1f are cropped out of the chart.

class MainActivity : AppCompatActivity()
    private val chartBuilder by lazy { SciChartBuilder.instance() }
    private val chartSurface by lazy { createChartSurface() }

    override fun onCreate(savedInstanceState: Bundle?)


        val background = findViewById<ViewGroup>(


    private fun createChartSurface(): SciChartSurface
        val surface = SciChartSurface(this)

        val xAxis = chartBuilder.newNumericAxis()
            .withAxisTitle("X Axis title")
            .withVisibleRange(0.0, 1.0)

        val yAxis = chartBuilder.newNumericAxis()
            .withAxisTitle("Y Axis title")
            .withVisibleRange(0.0, 1.0)

        Collections.addAll(surface.xAxes, xAxis)
        Collections.addAll(surface.yAxes, yAxis)


        return surface

    private fun createSeries(color: Int): FastLineRenderableSeries
        val lineData = chartBuilder.newXyDataSeries(Long::class.javaObjectType, Float::class.javaObjectType)

        return chartBuilder.newLineSeries()
            .withStrokeStyle(color, 2f, true)

    private fun addPoints()
        val xValues = LongValues(longArrayOf(0, 1, 2, 3, 4, 5))

        var lineData = chartSurface.renderableSeries[0].dataSeries as XyDataSeries<Long, Float>
        lineData.append(xValues, FloatValues(floatArrayOf(0.9f, 1f, 1.1f, 0.9f, 1.1f, 1f)))

        lineData = chartSurface.renderableSeries[1].dataSeries as XyDataSeries<Long, Float>
        lineData.append(xValues, FloatValues(floatArrayOf(0f, 0f, 0f, 0f, 0f, 0f)))
Showing 13 results
This template supports the sidebar's widgets. Add one or use Full Width layout.