Pre loader

Tag: multiple YAxis

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 votes
0 answers
19k views

I want to implement a requirement to stack several different y-axes on top of a common x-axis that shows time and that all y-axes share. Like the examples “Vertically Stacked Axes”, “Multi-Pane Stock Charts” and “16-channel EEG”.
The one the is the most similar to what I need is the “Vertically stacked axes” but the lines overlap and are not truly separated (possibly implementation detail).
Now two of the examples use a SciChartGroup and several SciChartSurfaces and one uses one SciChartSurface and changes the Y-Axes.
It is a technical Chart and not used for Stocks. Like several temperature (or even mixing with a pressure) lines but in separate charts like “Vertically stacked Axes” and synced to the timeline axis.
But the y-Axes are configurable with different styles and some could be automatically adjusting the range and some not. They will not share the same visual and behavioral styles and must not overlap.

What would be the best way to go or recommended? SciChartGroup or one SciChartSurface. Would it be even possible to implement the behavior on one surface? Any alternatives?

Update
What makes me ask the question?
I had some code in xaml and could style and databind it but the more this gets configurable and unpredictable at design time I end up creating everything in code. I think especially when using multiple SciChartSurfaces. This deprives me of the possibilities of XAML I believe. I still want to have the possibility to style and bind it without coding tons of lines.

  • Uwe Hafner asked 9 years ago
  • last active 9 years ago
0 votes
18k views

Someone recently asked the question on priority support tickets

Q: How do I have two YAxis on the left and right of the chart but with
the same VisibleRange?

e.g. how to mirror the YAxis on both sides of the chart

We are replicating the answer below for benefit of our userbase:

1 vote
17k views

Hello everybody,

my project is very similar to “Quad Left-Right Y-Axes”-Example. If you have a look at this, the Gridlines only math the Left Axis 1. All other Axes have their Major/Minor Ticks randomly spread. It’s not easy to see fast what value has another series then the first because the Gridlines simply dont match.

Is there a way to have all the Major/Minor Ticks Aligned to the Left Axis 1 ones? (i attached a picture which it should look like) But the Series don’t have the same Range. So the Major steps should only match in Grid, not in value (except 0 should be on one line).

I hope you understand my problem.

thx in advance for help

PS: i use full dynamic MVVM approach, the only code in View is ->

<s:SciChartSurface
Style="{StaticResource SciChartSurfaceStyle}"
GridLinesPanelStyle="{StaticResource GridLinesPanelStyle}"
ChartModifier="{Binding chartModifier}"
SeriesSource="{Binding seriesSource}"
YAxes="{Binding yAxes}"
XAxes="{Binding xAxes}"
Annotations="{Binding annotations}"
>
</s:SciChartSurface>

1 vote
17k views

Hi, I am displaying no of BoxAnnotation , I want to link some of the BoxAnnotation randomly .I want to perform the operaton on annotation with relation.When it move BoxAnnotation,related link should also move accordingly.I am also performing Y axis with yaxisID so Annotation also move to Y direction with Y axis.
Please help me out.
Thanks

0 votes
15k views

I am using the Vertically Stacked Axis example and I would like to set the (initial?) maximum of all the y-axis to the maximum of all the y-axis and the minimum to the minimum of all y-axis. In other words I want that everything use the same YAxis scales. Is there a way to to do this easily? or do I just have to set y min and max in the code for all charts/channels?

  • Michel Moe asked 9 years ago
  • last active 9 years ago
0 votes
12k views

Hello,

I use a Scrollbar/Surface combination to have an overview over several RenderSeries. Since I need individual scaling on each Series I also add 1 YAxis per Renderseries

The problem is that (even when disabling everything drawing related to an axis) adding an axis adds 2 px of white space where the axis would be.

In the attached image you can see an example with 15 axes added.

Here’s the code adding the RenderSeries and the axis (we already tried so many things to make the whitespace disappear as you can see in “createNewAxis”):

public void AddSciRenderSeries(FastLineRenderableSeries renderableSeries)
{
    if (OverviewChartSurface.RenderableSeries.Contains(renderableSeries))
        return;

    OverviewChartSurface.YAxes.Add(createNewAxis(renderableSeries.YAxisId));
    OverviewChartSurface.RenderableSeries.Add(renderableSeries);
    OverviewChartSurface.ZoomExtents();
}

private NumericAxis createNewAxis(string channelId)
{
    NumericAxis scrollerYAxis1 = new NumericAxis();
    scrollerYAxis1.AutoRange = SciChart.Charting.Visuals.Axes.AutoRange.Always;

    scrollerYAxis1.DrawMajorBands = false;
    scrollerYAxis1.DrawMajorGridLines = false;
    scrollerYAxis1.DrawMajorTicks = false;
    scrollerYAxis1.DrawMinorGridLines = false;
    scrollerYAxis1.DrawMinorTicks = false;
    scrollerYAxis1.DrawLabels = false;

    scrollerYAxis1.BorderBrush = Brushes.Red;
    scrollerYAxis1.FontSize = 0.1;
    Trace.WriteLine("AxisOffset: " + scrollerYAxis1.GetAxisOffset());
    scrollerYAxis1.Padding = new Thickness(0);
    scrollerYAxis1.Margin = new Thickness(0);
    scrollerYAxis1.BorderThickness = new Thickness(0);
    scrollerYAxis1.Id = channelId;

    return scrollerYAxis1;
}

What shall we do to remove the gap on the right?

Thanks for your help!

1 vote
12k views

I’m implementing a toggle between joined and separated axes for my series and I’ve encountered a problem with my SeriesValueModifiers. The modifier seems to be connected to “DefaultAxisId”, when I have my series linked to an axis with that ID the values show up as expected. However, when I separate my series to individual axes the modifiers no longer appears.

Is it possible to collect and show all my SeriesValueModifiers on one axis (keeping the others invisible)? Or perhaps show modifiers on all the axes and stack them on top of each other, keeping labels invisible.

This is the code I’ve got right now:

Adding an axis in my constructor, this one will be used when all the series are using the same axis.

ChartYAxes.Add(new NumericAxis()
{
    Visibility = Visibility.Visible,
    AutoRange = AutoRange.Always,
});

Then I add a new axis for each series.

ChartYAxes.Add(new NumericAxis
{
    Id = tagName,
    Visibility = Visibility.Collapsed,
    AutoRange = AutoRange.Always
});

var renderableSeries = new FastLineRenderableSeries
{
    YAxisId = IsIsolatedCharts ? tagName : "DefaultAxisId"
};

Toggling between these works great, but I need the value labels for this to be useful in any way.

EDIT: In case it’s relevant, here’s the code for toggling.

private void SplitAxes()
{
    var count = Series.Count;
    for (int i = 0; i < count; i++)
    {
        var series = Series[i];
        var name = series.DataSeries.SeriesName;
        //The axes are also added to a dictionary for easy access.
        _axisDictionary[name].GrowBy = new DoubleRange(count - i - 1, i);
        series.RenderSeries.YAxisId = name;
    }
}

private void JoinAxes()
{
    foreach (var series in Series)
        series.RenderSeries.YAxisId = "DefaultAxisId";
}
0 votes
0 answers
12k 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 7 years ago
  • last active 7 years ago
0 votes
12k views

Hi,
I’m prototyping an application with two visible data series and an individual Y-axis for each data series. See the enclosed image.
The Stroke color of each data series, the TickTextBrush and the BorderBrush of the y-axis are updated by normal data Binding through the MVVM pattern.
The problem is that I am not able to data bind the Stroke property of the MajorTickLineStyle for the individual Y-axis.
Do You know if there is a workaround for this through data binding?
The project is enclosed.

  • andreasrep asked 7 years ago
  • last active 7 years ago
0 votes
12k views

Hello,

I am creating a chart which should add a series with its respective X and Y axes on a button click.

I am adding axes as follows:

private void AddYAxis(List<double> yValues)
    {
        var yAxis = new NumericAxis()
        {
            AxisAlignment = AxisAlignment.Left,
            AxisTitle = "Number of Samples (per Series)",
            Id = "first"
        };
        sciChart.YAxes.Add(yAxis);
    }

private void AddXAxis(List<DateTime> xValues)
    {
        var xAxis = new DateTimeAxis()
        {
            TextFormatting = "YYYY-MM-DD HH:mm:ss",
            AxisAlignment = AxisAlignment.Bottom,
            AxisTitle = "Bottom Axis",
            Id = "first"
        };
        sciChart.XAxes.Add(xAxis);
    }

Then, I am adding the renderable series:

 private void AddSeriesClick(List<DateTime> xValues, List<double> yValues)
    {
        var dataSeries = new XyDataSeries<DateTime, double>();
        dataSeries.Append(xValues, yValues);

        var renderSeries = new FastLineRenderableSeries
        {
            Stroke = Color.FromArgb(0xFF, 0x40, 0x83, 0xB7),
            DataSeries = dataSeries,
            StrokeThickness = 2,
        };
        renderSeries.XAxis = sciChart.XAxes.GetAxisById("first");
        renderSeries.YAxis = sciChart.YAxes.GetAxisById("first");
        sciChart.RenderableSeries.Add(renderSeries);
        sciChart.ZoomExtents();
    }

But, I am only able to see the Axis titles and nothing else is rendered in the chart.

Following exception is thrown:

SciChartSurface didn’t render, because an exception was thrown:
Message: AxisCollection.GetAxisById(‘DefaultAxisId’) returned no axis with ID=DefaultAxisId. Please check you have added an axis with this Id to the AxisCollection

Stack Trace: at SciChart.Charting.Model.AxisCollection.GetAxisById(String axisId, Boolean assertAxisExists)
at A.IJ.DB(AxisCollection D, IRenderableSeries I, RenderPassInfo J, IPointResamplerFactory M, IDataSeries& O, IndexRange& S, IPointSeries& T, Int32& AB)
at A.IJ.S(ISciChartSurface D, Size I)
at A.IJ.RenderLoop(IRenderContext2D renderContext)
at SciChart.Charting.Visuals.SciChartSurface.DoDrawingLoop()

The program ‘[17304] SciChart_MultipleXAxis.exe’ has exited with code 0 (0x0).

Can you kindly look into it.

1 vote
12k views

I have multiple series on a chart surface, each with their own y-axis. I do not want to display all y-axes as this would take up half the chart surface.

Is there a way to make the matching y-axis only visible when the mouse cursor hovers over a series (hit-test)? How would I go about that?

Thanks
Matt

  • bbmat asked 7 years ago
  • last active 7 years ago
0 votes
11k views

If you have multiple axes it appears that the order given isn’t honored on the screen.
If signals A, B, C, D are inserted into a list (inserting each item at the zeroth index) the resulting list is D,C,B,A. The order of the list is ignored and order observed is incorrectly: A,B,C,D. The order of the series/y-axes should reflect the order of the list (not the order in which they were inserted).

The following example has been added which shows this. (Clicking “Insert Signal at beginning” multiple times).

Currently we are using a work-around for which any list change, all signals are removed and re-added in the desired order to get the desired result. This is quite slow and causes flickering and flashing of elements on the screen.

Its been 3 weeks since I’ve heard any response..

0 votes
0 answers
11k views

Is it possible to color fill between 2 data series with different Y scales?

0 votes
10k views

Hi,

I’m creating lines chart with data from CSV file.
I have multiple series and each serie has its own YAxis.
As it comes from different CSV files, the number of series and their names are not known in advance.

I create the series in the code (MVVM) .

I’m using the trial version for 2 weeks now and before I purchase the licence, I have two questions:

1) I need to implement a function allowing the user to create multiple VerticalSliceModifier and display data for each serie on the graph and store data to a list or datatable.

Is it possible to have Vertical Slice Tooltip with multiple YAxis ?
If I create a vertical line annotation, can I get data for each serie crossing the line?

2) I need to be able to add annotation dynamically (measure, text, box, lines…).
Is there a way to save annotations to a list (and then to a file) so that if the user reopens the same CSV file he can load and display the corresponding annotations?

Thank you in advance for your answer,
Regards
Nicolas

0 votes
10k views

So I want to draw multiple charts so is there any way I can have stacked yAxes like yAxis 2 should be drawn below yAxis1. I have gone through your example and there I got that we can add multiple surface but its becoming difficult for us to show a crosshair on all surfaces since we have a custom cross hair. Can you guide on same. Thanks in advance

0 votes
0 answers
9k views

Hi,

Multiple X-Axis and Y-Axis with 3 different charts and cursor can be moved along x-axis for the 3 charts.
Please find the screenshot attached.

Please reach out to me if you need any more details.

Thank you
Shaik Nazeer Hussain

1 vote
9k views

Hi

I have multiple SciChartSurfaces aligned using the HorizontalGroupHelper. I also need to have multiple y-axes in the charts. I was hoping to use set the margin on each y-axis, but when I do, the upper axis is drawn outside the window. Is there a work-around?

Example.

<Window x:Class="ScichartTest.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="http://schemas.abtsoftware.co.uk/scichart"
Title="MainWindow"
Width="800"
Height="450">

<Grid>
    <Grid.ColumnDefinitions>
        <ColumnDefinition />
        <ColumnDefinition />
    </Grid.ColumnDefinitions>

    <!--  Chart left  -->
    <s:SciChartSurface s:HorizontalGroupHelper.HorizontalChartGroup="group">

        <s:SciChartSurface.XAxis>
            <s:NumericAxis
                AxisAlignment="Left"
                AxisTitle="x" />
        </s:SciChartSurface.XAxis>

        <s:SciChartSurface.YAxes>
            <s:NumericAxis
                Margin="0,0,0,12"
                AxisAlignment="Top"
                AxisTitle="Left y1"
                Id="LeftY1" />
            <s:NumericAxis
                Margin="0,0,0,12"
                AxisAlignment="Top"
                AxisTitle="Left y2"
                Id="Lefty2" />
            <s:NumericAxis
                Margin="0,0,0,12"
                AxisAlignment="Top"
                AxisTitle="Left y3"
                Id="LeftY3" />
        </s:SciChartSurface.YAxes>

    </s:SciChartSurface>

    <!--  Chart right  -->
    <s:SciChartSurface
        Grid.Column="1"
        s:HorizontalGroupHelper.HorizontalChartGroup="group">

        <s:SciChartSurface.XAxis>
            <s:NumericAxis
                AxisAlignment="Left"
                AxisTitle="x" />
        </s:SciChartSurface.XAxis>

        <s:SciChartSurface.YAxes>
            <s:NumericAxis
                AxisAlignment="Top"
                AxisTitle="Right y1"
                Id="RightY1" />
        </s:SciChartSurface.YAxes>

    </s:SciChartSurface>

</Grid>

enter image description here

0 votes
8k views

Hi,

Using the ZoomExtentsModifier on multiple axis used to work in an earlier version of SciCharts, but is broken in 4.3.0. I have two y-axes set up, left and right on my chart, with the right-hand-side just mirroring the left. When I double-tap to zoom to the x/y range of the graph, only the x range is modified. If I disable the change listener that mirrors the range change on the primary y axis, double tap works as expected, but my right hand side y-axis no longer mirrors the primary axis range. This is how I’ve set up the dual axes:

        let yAxis = SCINumericAxis()
        yAxis.axisTitle = "Acceleration (g)"
        yAxis.axisAlignment = .left
        yAxis.visibleRangeLimitMode = .minMax
        chart?.yAxes.add( yAxis )

        // Add an additional visible yAxis to the right without label
        let yAxisRight = SCINumericAxis()
        yAxisRight.axisAlignment = .right
        yAxisRight.axisId = "yAxisRight"
        chart?.yAxes.add( yAxisRight )

        // Sync values with left (primary) axis
        yAxis.visibleRangeChangeListener = { (axis, oldRange, newRange, isAnimating) in
            yAxisRight.visibleRange = newRange
        }

Commenting out the listener at the bottom fixes the ZoomExtentsModifier problem, but is obviously not a workable solution. Any help would be appreciated. Thanks

0 votes
8k views

Hello all,

I am trying to create multiple Y axes using below example. I am not able to render the left Y axis as per the data series. Any input would help fixing this issue. Please see the attached screenshot.

https://www.scichart.com/documentation/win/current/Tutorial%2008b%20-%20Adding%20Multiple%20Axis%20with%20MVVM.html

Thanks.
Naveen

1 vote
6k views

Hi, I wanted to make a multiple Y-Axis scale with multiple series plot into their respective Y scale. Like this,

Series A plot to 1st Y-axis Scale
Series B plot to 2nd Y-axis Scale
Series C plot to 3rd Y-axis Scale
Series D plot to 4th Y-axis Scale

and all those series are not overlapping each other. I want to do like the picture attached but with the series are not overlapping to each other.

1 vote
6k views

Hi,

I have used WPF Chart Vertically Stacked YAxis example:
WPF Chart Vertically Stacked YAxis | Fast, Native, Charts for WPF (scichart.com)

and WPF Chart Multiple YAxis example:
WPF Chart Multiple YAxis | Fast, Native, Charts for WPF (scichart.com)

I have managed to achieve both individually but now essentially I would like to combine them.

I have been trying to alter the Right Axes Panel Template to allow this but it seems to only allow one or the other.

My main difference from the examples is that I have a collection of Yaxes of NumericAxisViewModel type in my viewmodel that is decided by the user at runtime before creating the chart and so is not defined in the xaml and bound with the YAxes property on the surface using AxesBinding.

I want to be able to vertically stack some of the Yaxes and have the rest stack horizontally side by side on the same axis alignment side, in my case the right side.

Is this something that is possible? If so how do I achieve this?

Let me know if you need any more info.

Cheers,
Grahame

1 vote
2k views

I am considering applying server-side licensing for my javerScript application.

In the document below, there is a phrase “Our server-side licensing component is written in C++.”
(https://support-dev.scichart.com/index.php?/Knowledgebase/Article/View/17256/42/)

However, there is only asp.net sample code on the provided github.
(https://github.com/ABTSoftware/SciChart.JS.Examples/tree/master/Sandbox/demo-dotnet-server-licensing)

I wonder if there is a sample code implemented in C++ for server-side licensing.

Can you provide c++ sample code?
Also, are there any examples to run on Ubuntu?

  • thier tom asked 1 year ago
  • last active 1 year ago
Showing 22 results

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies