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

0 votes
281 views

We have 2 graph surfaces with 2 Y axes on each side, but the label formatting of the axes is different. That makes the axes widths different and therefore both the graphs appear as they have different widths. Is there a way to make the axis widths fixed so the graphs can be the same size?

0 votes
1k views

How to programmatically add Scrollbars to MVVM instantiated axes?

I added DateTimeAxisViewModel and NumericAxisViewModel to my code. That works from so far. A way to add scrollbars i couldnt find a some tries.

Are there some ways to get this done? Maybe change the templates of the axes or the chart?

Best regards

0 votes
0 answers
1k views

We are using the candlestick chart, and scrolling off the ends of the plotted data behaves very strangely:
– If I scroll slowly, the chart expands, anchored to the end of the data set (this is expected)
– If I scroll quickly, it lets me scroll beyond the end of the data set
– Once I have scrolled of the end of the data set, touching the screen again jumps back to the data set
– If I scroll slowly so the chart is expanding, and then release touch, the chart continues to move with inertia. If I clock again it jumpos back to expanding mode.

The combination of all these behaviours makes a very confusing and unsatisfying user experience.

Is there a way to change the behaviour? I had a look at https://www.scichart.com/documentation/ios/v2.x/api/dir_2dcc4ec269b335aa862d36c6f6e3093f.html but can’t find anything that might.

We have set:
xAxis is a SCIDateTimeAxis
xAxis.VisibleRange to desired range
xAxis.VisibleRangeLimit = range.Clone() where range is desired range
xAxis.VisibleRangeLimitMode = SCIRangeClipMode.inMax (I guess it should be called minMax but something broke in the build?)
xAxis.AutoRange = SCIAutoRange.Never

with chart modifiers:
– new SCIZoomPanModifier()
– new SCIZoomExtentsModifier()
– new SCIPinchZoomModifier()

Thanks,

Dan

0 votes
1k views

I’ve had great success showing pixel values of a 2D image using the UniformDataSeries3D type. What I’d like to do now is display a subset of the pixel values in an image using a rectangular region of interest. However, it seems that the axes always start from 0. If I want to have the axes to not begin at value 0, will I have to calculate points for the whole image and zoom in? Or is there a way to set what the starting value of the axes are (while still indexing the values at index 0)

0 votes
0 answers
1k views

I have a Chart with two Y-Axes, one on the left and one on the right for a SeriesvalueModifier.
i need to bind the VisibleRange to a Property in the ViewModel. Everything works fine, except for if i zoom via the MouseWheelZoomModifier.
It looks like the Chart gets “stretched” in Y direction. I guess the modifier zooms on both axes, so the property they are both bound to gets two updates, one for each axis.
When i bind the VisibleRange of Axis[A] to theVisibleRange of Axis[B] which is bound to the property also won’t work.
Do you have any idea how this could be fixed ?

what i want to achieve is this behavior:

https://www.scichart.com/questions/question/faq-how-to-have-two-yaxis-on-left-and-right-with-the-same-visiblerange-mirrored-yaxis

 Axis[A]
            <s:NumericAxis
                x:Name="NumericAxis_Mass"
                x:Key="NumericAxis_Mass"
                Id="NumericAxis_Mass"
                AxisTitle="{ext:Localization Chart_Axis_PartialPressure}"
                GrowBy="0.1,0.1"
                VisibleRange="{Binding YVisibleRange,
                                Mode=TwoWay,
                                UpdateSourceTrigger=PropertyChanged,
                                NotifyOnSourceUpdated=True,
                                NotifyOnTargetUpdated=True}" 
                AutoRange="{Binding AnalysesAutoRange_y,
                           Mode=TwoWay,
                           UpdateSourceTrigger=PropertyChanged,
                           NotifyOnSourceUpdated=True,
                           NotifyOnTargetUpdated=True}"
                AxisAlignment="Left"
                Style="{StaticResource Chart.NumericAxis.Style}" />

Axis[B]
                <s:NumericAxis
                x:Key="NumericAxis_Mass_Empty"
                x:Name="NumericAxis_Mass_Empty"
                GrowBy="0.1,0.1"
                TextFormatting="0.00E+00"
                VisibleRange="{Binding YVisibleRange,
                                Mode=TwoWay,
                                UpdateSourceTrigger=PropertyChanged,
                                NotifyOnSourceUpdated=True,
                                NotifyOnTargetUpdated=True}"            
                AutoRange="{Binding AnalysesAutoRange_y,
                           Mode=TwoWay,
                           UpdateSourceTrigger=PropertyChanged,
                           NotifyOnSourceUpdated=True,
                           NotifyOnTargetUpdated=True}"
                AxisAlignment="Right"
                Style="{StaticResource Chart.NumericAxis.Style}"
                DrawLabels="False"
                DrawMajorBands="False"
                DrawMajorGridLines="False"
                DrawMajorTicks="False"
                DrawMinorGridLines="False"
                DrawMinorTicks="False"
                Margin="35,0,0,0"
                Width="auto" />
  • Dirk Heyne asked 2 years ago
  • last active 2 years ago
1 vote
2k views

I want to put multiple Line Charts on a standard WPF TabControl. One Chart per tab.
Each tab should show a different chart with, in general, a different range on its X axis.
After a chart on a tab has been panned or zoomed, then after switching to another tab and then returning to the original tab, then the original X axis values should be preserved.
My problem is that I end up with a behaviour that looks like all the charts share one X axis.

So my question is how can I achieve the desired behaviour?
I did try databinding XAxis and, later, XAxes, but I ended up with the same behaviour.
Thanks in advance to anyone that can help me out with this.

Here is the briefest example I could construct that displays the problem.
It simply displays 3 tabs with different ranges of X values and AutoRange set to “Once”.
When it runs, all 3 charts are displayed with the same X axis range which is only correctly autoranged for the first tab.
The attached images are screenshots of the three tabs.

Here is my XAML:

<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:SciTest" xmlns:s="http://schemas.abtsoftware.co.uk/scichart" x:Class="SciTest.MainWindow"
    Title="MainWindow" Height="300  " Width="500">
<Window.DataContext>
    <local:RSeriesSourceList/>
</Window.DataContext>


<DockPanel>
    <TabControl ItemsSource="{Binding}">
        <TabControl.ItemTemplate>
            <!--This dictates what goes in the Tab header-->
            <DataTemplate>
                <TextBlock Text="{Binding Title}" />
            </DataTemplate>
        </TabControl.ItemTemplate>
        <TabControl.ContentTemplate>
            <!--This dictates what goes in the tab page-->
            <DataTemplate>
                <s:SciChartSurface RenderableSeries="{Binding RSeries}">
                    <s:SciChartSurface.XAxes>
                        <s:NumericAxis/>
                    </s:SciChartSurface.XAxes>
                    <s:SciChartSurface.YAxes>
                        <s:NumericAxis AutoRange="Always"/>
                    </s:SciChartSurface.YAxes>
                </s:SciChartSurface>
            </DataTemplate>
        </TabControl.ContentTemplate>
    </TabControl>
</DockPanel>

And here is the code-behind for the Data Context

    class RSeriesSource
{
    public String Title { get; set; }
    public ObservableCollection<IRenderableSeries> RSeries{get;set;}
    static Random rnd = new Random(); //for generating example data
    public RSeriesSource()
    {
        RSeries = new ObservableCollection<IRenderableSeries>();
    }
    public static RSeriesSource Example(int n)
    {
        RSeriesSource res = new RSeriesSource();
        res.AddRS(n);
        res.Title = "S" + n.ToString();
        return res;
    }

    FastLineRenderableSeries AddRS(int offset)
    {
        XyDataSeries<Double, Double> Series = new XyDataSeries<Double, Double>();
        for (int ix = 0; ix < 10; ix++)
        {
            Series.Append(offset * 5 + ix, offset + rnd.NextDouble());
        }
        FastLineRenderableSeries res = new FastLineRenderableSeries();
        res.DataSeries = Series;
        //if (yAx != null)
        //    res.YAxisId = yAx.Id; //Use the Id NOT the axis
        RSeries.Add(res);
        return res;
    }
}

class RSeriesSourceList : ObservableCollection<RSeriesSource>
{
    public RSeriesSourceList()
    {
        for (int i = 0; i < 3; i++)
        {
            Add( RSeriesSource.Example(i));
        }
    }
}
0 votes
4k views

Have a good day!
Is there any way to make two and more axis to take place in the same position (one overlays another).
I’ve tried to do this using margin, but the surface had moved to the left border (picture 1).

<visuals:NumericAxis VisibleRange="{Binding YVisibleRange, Mode=TwoWay}" 
                                 Width="40" 
                                 DrawLabels="False" 
                                 DrawMajorBands="False"
                                 DrawMajorTicks="False"
                                 DrawMinorTicks="False"
                                 DrawMinorGridLines="False"
                                 MaxAutoTicks="6"/>         
            <visuals:NumericAxis DrawLabels="True" 
                                 Width="40" 
                                 Id="Chart1"
                                 Margin="0,0,-120,0"
                                 Visibility="Visible"
                                 AutoTicks="True"
                                 MaxAutoTicks="4"/>

            <visuals:NumericAxis DrawLabels="True" 
                                 Width="40"
                                 Id="Chart2" 
                                 Margin="0,0,-120,0"
                                 Visibility="Visible" 
                                 MaxAutoTicks="4"/>

Thanks in advance!

  • Egor asked 4 years ago
  • last active 4 years ago
1 vote
4k views

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
5k views

I made an example based on the “Vertically Stacked Axes” from SciChart Examples. The main difference is that I can add DataSeries / YAxes on the fly.

The problem is that when DrawMajorGridLines, DrawMinorGridLines are turned ON the are drawn only at the first trace.

  • Jan Kaiser asked 4 years ago
  • last active 4 years ago
1 vote
7k views

Hello,

I have a SciChart with multiple y-axes. Thanks to the ZoomPanModifier the user can pan the whole chart by dragging (holding the left mouse button down and moving the mouse). Good! But it should also be possible for the user to pan a certain axis (meaning : changing the min and max values of the axis) and that doesn’t seem to be possible with the built-in ChartModifiers.

So then I thought, no problem, I make my own ChartModifier to handle this (I already implemented two other modifiers for other mouse interactions before, so I get the hang of this :-)). But I don’t get this to work correctly.

My first attempt was to derive from ChartModifierBase and then handle events like OnModifierMouseDown and OnModifierMouseUp. Problem there is that OnModifierMouseUp doesn’t get called when the mouse is not over the chart surface anymore. That is a problem because the user can release the mouse button when the mouse is over another part of the WPF window or even outside of the application window and somewhere else on the screen.

My second attempt was to inherit from ZoomPanModifierBase because the ZoomPanModifier handles these ‘mouseups’ correctly. I try by overriding the Pan(System.Windows.Point currentPoint, System.Windows.Point lastPoint, System.Windows.Point startPoint) method but this method only gets called when the panning starts on the chart area itself, not on one of the axes, so it doesn’t seem to be a solution either.

 public class AxisPanModifier : ZoomPanModifierBase
{
    public override void Pan(System.Windows.Point currentPoint, System.Windows.Point lastPoint, System.Windows.Point startPoint) {
        // Does not get called when the dragging starts on an axis.
    }
}

Can someone give me a tip on how to proceed or does someone already have a solution for this ? Thanks for any help in advance. đŸ™‚

Best greetings,
Stefaan

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