Pre loader

Tag: Axis

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

1 vote
17k views

I wonder how I can disable the x-Axis from automatically re-scaling when panning a series beyond the available data range? The only time when axes scales change should be when I modify the axes scales via mouse on the respective axis itself. But when I pan a series I do not want any changes in axes scale to occur. How can I accomplish that? Thanks

  • bbmat asked 9 years ago
  • last active 9 years ago
1 vote
9k views

Hello,

Currently I am using ViewportManager.AnimateZoomExtents to animate the data to fit the size of the graph. However, the animation causes the data to reach the very edge (X-Axis Max and Y-Axis Max). Is there a way that I can use AnimateZoomExtents to animate the data out but leave a 10% gap between the edge and X-Axis/Y-Axis Max?

I was able to do this using the following code, but I lose complete animation (which is what I’m looking for).

AxisYVisibleRange = new DoubleRange(AxisYVisibleRange.Min, AxisYVisibleRange.Max + (AxisYVisibleRange.Max * .10))
ViewportManager.AnimateZoomExtents(AnimateZoomTimeSpan);
1 vote
12k views

Hi, I want to color the axis label by its value,

eg.
value < 0 -> show red color
value = 0 -> show gray color
value > 0 -> show green color

similar to this question, but in javascript platform, it seems the LabelProvider has function related to the value(string) formatting only. Is there any ways to styling the label? Thanks!

1 vote
11k views

Hi,
I have some special requirements to solve. First point is to align the axis title position to the top of the axis. So the title is above the axis.

Second thing is to manually edit the visible range min and max inside the axis. So that the label min and max are editable.

Is there any way to do that?

Regards Markus

1 vote
8k views

I am currently following the tutorial at the page listed here.

https://www.scichart.com/documentation/win/current/webframe.html#Tutorial%2003b%20-%20Adding%20Series%20to%20a%20Chart%20with%20MVVM.html

Instead of using the given values to add to the series, I am using very small values like so:

var lineData = new XyDataSeries<double, double>() { SeriesName = "Testing Series" };
lineData.Append(0, 0);
lineData.Append(1, 0.001);
lineData.Append(2, 0.002);

However the axis ticks do not display a high enough resolution as shown in the image attached. Each one will show either 0, 0.001 or 0.002 and no further. I have tried changing the axis MinorDelta and MajorDelta to smaller values but this has not worked. Is there any way to fix this?

  • Hamza Butt asked 2 years ago
  • last active 2 years ago
1 vote
15k views

Hi, I’m trying to position vertical line annotations on a chart. I want to position them on a visible part of the chart, but I need to use the Absolute coordinate mode as I want the annotation to move with the data as the chart is panned or zoomed.

My question is then: how can I find the currently visible extents of the X axis? If the chart is zoomed or panned I need to know what the left and rightmost visible X-axis values are (independent of the data).

1 vote
2k views

Hello,

Normally, if I have a ScichartSurface with a X- and Y-Axis, were both axis AutoRange- properties are set to Always, the surface displays the entire data by adjusting the Visible ranges of the axis after new data has been appended.

This also works if there are multiple Data-Series on the ScichartSurface.

In my case, I have two FastLineRenderableSeries on my Surface. Each of them receiving new data via the Append-function while the x- and y-axis are continuously adjusted automatically to display all the datapoints of both Datasets.

So far so good…

But what would I have to do if I wanted one of the two Datasets to be ignored by the Autorange properties of the x- and y-Axis?

I have already tried to set the X- and YAxisID of one dataset to null, hoping I could make both axis ignore this Dataset while they are adjusting their Visible ranges. However, this only led to error messages.

I could also try to write my own ViewPortManagers and overwrite the OnCalculateNewXRange and OnCalculateNewYRange funvtions, but that seems a little bit excessive.

Is there an easy way to achieve the desired behavior?

Thanks.

1 vote
8k views

Hi,
Just wanted to know how to implement 3D graphics and charts in the Sci chart if possible.

1 vote
18k views

I am using the MVVM pattern.

I trying to manage the number of YAxes in my chart in a dynamic manner by binding the YAxes in the chart to a collection so that each time I add a new line series that line series gets its own axis.

When I do this I am getting a null reference expection.
If I hard code the YAxes or YAxis my chart loads.

Here is the xaml:

<SciChart:SciChartSurface x:Name="historicalChart" 
    RenderableSeries="{Binding HistoricalRenderableSeries, Mode=TwoWay}"
    YAxes="{Binding ChartYAxes, Mode=TwoWay}"
    SciChart:ThemeManager.Theme="ExpressionLight">
   ...
</s:SciChartSurface>

Here is the ViewModel

I tried both an ObservableCollection and a AxisCollection in my view model.

private ObservableCollection<NumericAxis> _chartYAxes = new ObservableCollection<NumericAxis>();
public ObservableCollection<NumericAxis> ChartYAxes
{
  get { return _chartYAxes; }
  set
  {
    _chartYAxes = value;
    NotifyPropertyChanged("ChartYAxes");
  }
}

private AxisCollection _chartYAxes = new AxisCollection();
public AxisCollection ChartYAxes
{
  get { return _chartYAxes; }
  set
  {
    _chartYAxes = value;
    NotifyPropertyChanged("ChartYAxes");
  }
}

Can anyone suggest a way to manage a variable number of YAxes in a chart?

  • sdemooy asked 12 years ago
  • last active 9 years ago
1 vote
20k views

I want YAxis Auto Scale less than the value max 10% and greater value min 10%, how?

  • kingsoff asked 11 years ago
  • last active 9 years ago
1 vote
9k views

Hello,

How do I right-justify the numbers on the y-axis? The y-axis is on the left side of my chart.

Thanks,
Neville

1 vote
303 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.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?

1 vote
14k views

I would like to template items of an AxisCollection assigned to a sciChartSurface in binding of an AxisItemCollectionViewModel. But it looks like I cannot do it as Visual Studio won’t compile my tries.

What i am looking for is something like the EEG 16 channel sample. There the ListBoxItems are styled via a template which is bound to a ViewModelItem. The ListBox itsself is bound to a ViewModelCollection. Depending on how many entries there are entries in the listbox.

So I would like to do something like this:

<SciChartSurface.AxisCollection ItemsSource="{Binding MyAxisCollectionViewModels}" ItemTemplate="{StaticResource AxisItemTemplate}" />

Is this possible? I don’t know how many y-axes i will have. They are configurable by the user.

  • Uwe Hafner asked 9 years ago
  • last active 9 years ago
1 vote
0 answers
11k views

Hi All,

Today’s weirdness was hard to track down but I can now demonstrate it with minimal code.

As a summary to the problem – we may generate multiple user controls each containing a chart that can’t all be viewed on screen at the same time. Our solution was to wrap everything in a ScrollViewer and allow the user to scroll through them. This caused the x Axis and any Right Aligned axis to do weird things with the chart.

On careful observation we noticed that any mouse movements in the axis while dragging were being interpreted as drags on the chart area so it would zoom (or pan) accordingly instead of dragging the Axis in question. Setting the scrollviewer scrollbar visibility to disabled returned the chart to expected behavior.

Can someone tell me what we did wrong or provide a work around suggestion.

The XAML:

<UserControl x:Class="WpfUITest.SciChartMultiaxisTest"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" `enter code here`
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
         mc:Ignorable="d" 
         xmlns:s="http://schemas.abtsoftware.co.uk/scichart" 
         d:DesignHeight="300" d:DesignWidth="300">
<Grid>
    <!-- <ScrollViewer CanContentScroll="False" VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Disabled">  THIS IS OK   -->
    <ScrollViewer CanContentScroll="False" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
        <Grid>
            <s:SciChartSurface x:Name="UserControlSciChartSurface" s:ThemeManager.Theme="Chrome" >
                <s:SciChartSurface.XAxis>                
                    <s:NumericAxis AxisAlignment="Bottom" AxisTitle="XAxis 1" GrowBy="0.01,0.01"/>            
                </s:SciChartSurface.XAxis>

                <s:SciChartSurface.YAxes>
                    <s:NumericAxis x:Name="Left1" Id="Left1" AxisTitle="Left Axis" AxisAlignment="Left" />
                    <s:NumericAxis x:Name="Right1" Id="Right1" AxisTitle="Right Axis" AxisAlignment="Right" />                        
                </s:SciChartSurface.YAxes>

                <s:SciChartSurface.ChartModifier>
                    <s:ModifierGroup>
                        <!-- <s:ZoomPanModifier x:Name="ZoomPanModifier" ExecuteOn="MouseLeftButton" />  -->
                        <s:RubberBandXyZoomModifier x:Name="rubberBandZoomModifier" ExecuteOn="MouseLeftButton"/>
                        <s:ZoomExtentsModifier x:Name="zoomExtentsModifier" ExecuteOn="MouseDoubleClick"/>                            
                        <s:XAxisDragModifier x:Name="xAxisDragModifier" IsEnabled="True" ClipModeX="None" />
                        <s:YAxisDragModifier AxisId="Left1" IsEnabled="True" />
                        <s:YAxisDragModifier AxisId="Right1" IsEnabled="True"/>
                    </s:ModifierGroup>
                </s:SciChartSurface.ChartModifier>
            </s:SciChartSurface>            
        </Grid>
    </ScrollViewer>
</Grid>

I put a simple test series on from the code behind as follows:

        public void AddTestDataSeries()
    {
        XyDataSeries<int, int> testSeriesData = new XyDataSeries<int, int> { SeriesName = "Series1" };
        for(int x = 1; x < 10; x++)
        {
            testSeriesData.Append(x, x);
        }
        FastLineRenderableSeries testSeries = new FastLineRenderableSeries();
        testSeries.DataSeries = testSeriesData;
        testSeries.YAxisId = "Left1";
        testSeries.SeriesColor = Colors.Red;
        this.UserControlSciChartSurface.RenderableSeries.Add(testSeries);
    }

Any ideas anyone?

1 vote
17k 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 I set VisibleRange and VisibleRangeLimit it does not crop the trace (as you can see on the Tan traces that are drawn on the whole surface).

Is there any way to crop the traces to VisibleRange of corresponding Axis?

  • Jan Kaiser asked 9 years ago
  • last active 9 years ago
1 vote
10k views

I want to implement a behavior on all axes with a mouse wheel. After quite some searching and trying I came up with a solution (possibly?).
In my control there are dynamically created one x-axis and several y-axes on one or more charts in a chartgroup.

But from the samples I get the impression the standard way would be to use a Modifier or a behavior like XAxisDragModifier (which does not use Wheel). And all tries to use a modifier did not work (for different reasons see below for some. One also is that I am getting more and more modifiers and they start to interfere with each other – like wheel on center area).

What am I trying to do and how do I think I could solve it “non-standard” way:

User Story:
User wants to change zoom (or pan) via mousewheel on axis.
(
Details just for info. Complete user story:
User can click on Axis to select it (it gets highlighted or border around it) and then the user can change via MouseWheel the Zoom or Pan.
Selecting Pan is done by pressing CTRL Key while mousewheel use. Otherwise zoom.
)

Possible Solution:
How do I think I could solve the mousewheel event capture:
Create a custom Axis:

public class CustomAxis : NumericAxis
{
    protected override void OnMouseWheel(MouseWheelEventArgs e)
    {
        e.Handled = true;
        // Do zooming or paning
    }

}

Other options I ruled out:
Why can’t i use XAxisDragModifier? Besides it does not work with wheel: It does not work for me at all. Probably because my X-Axis has an ID. But that I don’t have during compile-time. So I cannot assign it. So my XAxisDragModifier does nothing.
Why do I not use YAxisDragModifier? Same problem. Several (unknown number) of YAxes with IDs i don’t have at compile time. I would have to add them at runtime. I have a custom behavior linking VMs to Axes and creating them. But debugging shows me that the Modifiers are not available at that time so I cannot add one.

Could this work? Or is there an obvious reason not to do it this way?
I would have to do the zoom and pan functions myself (I hope I can at this place)and I am using a custom ViewportManager as well.

  • Uwe Hafner asked 9 years ago
  • last active 2 years ago
0 votes
0 answers
1k views

Hello to everyone. I want to take the starting point of my bar charts as 20, for example, rather than 0. If the data is 3, I want to create a bar chart going from point 20 to 23, and if it is -3, from point 20 to 17, can you help me?

-1 votes
0 answers
8k views

i want to make y axis big in range as you can see in screenshot . Yaxis is small in Height
want to make it full screen

0 votes
9k views

Hi,

Can Axis show the value of 10-15 level data? Is there any limitation for the numeric axis?

  • Ming Fang asked 7 years ago
  • last active 7 years ago
0 votes
5k views

Hello,

I am trying to set the interval on the x-axis in a polar plot but it doesn’t appear to be accepting it and plotting accordingly. My axis definition is quite simple:

<s:SciChartSurface.XAxis>
       <s:PolarXAxis Name="TFxAxis" MajorDelta="15"/>
</s:SciChartSurface.XAxis>

I am plotting angles and radii so one data point might be (45, 1) and the next (50, 2) and so on where my visible range is TFxAxis.VisibleRange = new DoubleRange(-180.0, 180.0). Very simple plot but it keeps returning to a default of 1 on my MajorDelta for the x-axis and then showing major axes at 50 degree intervals. I’ve tried a variety of solutions but nothing seems to work properly.
Thanks,
Christina

0 votes
8k views

I want to paint my time axis like this:
Chessboard ruler
Or just highlight last week, day, hour.
Is there way to apply style only on part of axis?

0 votes
13k views

I’m trying to change the AutoRange property of my axis in a VisualStateManager storyboard and it’s throwing an exception saying the value is invalid. Is this not possible or should the object/property be accessed differently?

Exception: “The animation(s) applied to the ‘AutoRange’ property calculate a current value of ‘AutoRange.Once’, which is not a valid value for the property.”

<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="AutoRange" Storyboard.TargetName="XAxis">
<DiscreteObjectKeyFrame KeyTime="0" Value="AutoRange.Once"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
.
.
.
<sc:NumericAxis x:Name="XAxis" AxisTitle="Time (s)" TitleFontSize="14" AutoRange="Always"/>

Thanks!

0 votes
10k views

Hi, i’m developing an app in WPF and i found that it crashes when i’m dereferencing the user control where my chart lives in and have 1 or more points selected by code in one chart when the other one is not visible.

i would be very apreciated if someone could tell me a hint of where i have to look for the solution or what do this methods do or touch.

more data about the chart:

  • I have 2 fastlinerenderable series each with 2 Yaxis for itselves and 2 shared XAxis.
  • I also have a modified listbox which is have it’s sincronization synced to the chart.
  • have a modifiergroup to pan,zoom and select.

this is my Selectionmodifier:

<scicharts:DataPointSelectionModifier
                        Name="ChartSelection"
                        SelectionFill="#B1B5B2B2" 
                        XAxisId="{Binding XAxisType, NotifyOnTargetUpdated=True}"
                        TargetUpdated="ChartSelection_TargetUpdated"
                        SelectionStroke="#009E9C9C"
                        IsEnabled="{Binding SelectionMode}" >

I think that this is the axis that breaks my program but it needs it to not crash when i select.

this is my stacktrace:

An unhandled exception of type ‘System.NullReferenceException’ occurred in SciChart.Charting.dll

en SciChart.Charting.ChartModifiers.DataPointSelectionModifier.DeselectAllPointMarkers()
en SciChart.Charting.ChartModifiers.DataPointSelectionModifier.OnXAxisIdDependencyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)

I tried to make a program that could replicate the error but i couldn’t.

thanks in advance.

0 votes
0 answers
11k views

Hello!

I want to use three colors in Xaxis.
But I do not know how to use multiple colors at once.

can put multiple colors through Xaxes,
but when move the scroll bar, the Xaxes colors do not move together. (Top and Buttom Xaxes colors)
I want to move the colors of both Xaxes together. or want to assign multiple colors(over the 3 Colors) to one Xaxis.

You can see the code and graphs through the image.

Tell us how to use it.

Thank you!

0 votes
19k views

Hi

I’m using auto range on a numeric axis. The data can be anything, but I want the axis to never have a range of less than 5.
E.g.: -100 to -95
E.g.: 17 to 22
E.g.: 0 to 5
etc.

What do I need to set to be able to do this? I have tried MinimalZoomConstrain and VisibleRangeLimit without success. Preferably something to set in XAML on my axis.

Thanks.

0 votes
7k 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?

0 votes
17k views

Hi,

I’m trying to achieve the looks of DateTimeCategory XAxis as shown on uploaded screenshot.

Formatting a single row of tick labels is not a hard task (setTextFormatting). The problem arises when there are 2 rows with same frequency (days of the week and dates) and third row with lower frequency (years).

I tried using new line character in text formatting property to break the line for days and dates and it didn’t work. I also tried having two axes bound to the same data series, each one having different formatting and majorDelta, but it seems that they don’t stack up (only first one added is shown).

Any ideas?

  • Igor Peric asked 7 years ago
  • last active 7 years ago
0 votes
16k views

On priority support tickets, a user just asked us how to show and hide the AxisTitle TextBlock without changing the AxisTitle.Text to string.Empty.

The solution uses attached properties and a small custom style, so we thought we’d post it below

0 votes
12k views

SciChart WPF control

I’m trying to configure the axis range using VisibleRange. Is it possible that in Visible range, I set only min value and then max value is set automatically by tracking the maximum value series has? Same way, if I set max value of VisibleRange then min value is set automatically by tracking min value of the series? How to achieve the VisibleRange setting by just setting one of Min/Max value?

  • KC asked 5 years ago
  • last active 5 years ago
0 votes
13k views

Hello.

Thank you for creating great chart library.
I’m now using a trial version for test that is enable to use at project that I’m concerned.

I have one problem that when I set zoom function to chart, and zoomed too much, axis label disappears.
(I used mouse scroll zoom, I attached zoom before image and after image)

How can I control this problem?
Is there any properties or setting for this?

0 votes
10k views

I’m using XyDataSeries<Timespan, double> to plot to my chart.

I want to show elapsed time at chart X-Axis label like below

ex) If Timespan value is 1day 2hour 30min 40sec

Default label style: 02:30:40

Label style I want: 26:30:40

How can I set like that?

0 votes
13k views

Hi,

i have an horizontal line annotation in my chart at a fixed value (some hint for the user “minimum level”) that i always want to be visible. Thus, i’d like to set the axis/chart so that it always shows a range from 0 to 0.05, or larger range if the chart values exceed this range.
I’ve tried to set-up the VisualRangeLimit property to fit my needs but could not achieve my goal.

<s:NumericAxis AxisAlignment="Left"
               Id="MagnitudeAxis"
               VisibleRangeLimit="0, 0.05"
               AxisTitle="{lex:Loc MagnitudeAxisLabel}" />

Are there other options to achieve this or am i doing somthing wrong?

0 votes
0 answers
5k views

Hello! I want to create an AxisMarkerAnnotation but the padding doesn’t match the position of the text on the axis – I would like to align it and what is the way to do it? couldn’t find the right settings

0 votes
7k views

The numeric axis in our app weirdly displays the range from -2000 until 8000, even if it has or hasn’t got data series appended to it. I tried setting the VisibleRange and VisibleRangeLimit when creating the axis, but still no results. Here’s a piece of the code:

new SCINumericAxis
{
   AxisAlignment = SCIAxisAlignment.Left,
   AxisId = "axis_id",
   TextFormatting = " 0%",
   VisibleRangeLimit = new SCIDoubleRange(-30, 100),
   VisibleRange = new SCIDoubleRange(-30, 100)
};

The Y values that we have are doubles, example:

[0]: 98.26171875
[1]: 0
[2]: NaN
[3]: 98.26171875
[4]: 0
[5]: NaN
[6]: 78.203125
[7]: NaN
[8]: 38.96484375
[9]: NaN
[10]: 98.28125
[11]: 0
[12]: NaN
[13]: 68.22265625
[14]: 0

So just by looking at the values, we should have a data range from 0 to 100, but I think somehow it messes up the conversion and ends up with ridiculously large numbers. I’m not doing any additional operations on the data, the printed data above is the data from the XyDataSeries. The Y type is Double, the YMin is 0, the YMax is 98, but still ends up drawing the values until 10000.

0 votes
7k views

Hi SciChart support,

we experience problems with clipping x axis values, depending on x-axis value range.
assume we have xaxis range from 1000000 to 1000001 and a diagram with a margin of lets say 10 pixels to the right of the container control. Depending on the zoom, the label of the mostright xaxis value(e.g. “1000001”) may be clipped just because the string is just too long. Would you recommend to change the margin dynamically to avoid the clipping or is there a way to prevent the chart from putting the rightmost xaxis value label if it exceeds the diagram bounds?

Hope you could help me.

Thanks in advance, Andreas

0 votes
7k views

Is it possible to set different color to axis ticks and axis title.
In 2D-Chart i did it by changing the style of DefaultTickLabel:

<Style x:Key="NumericAxisForMvvm" TargetType="axis:NumericAxisForMvvm">

  <Setter Property="FontSize" Value="12" />
  <Setter Property="FontFamily" Value="Arial" />
  <Setter Property="FontWeight" Value="Bold" />
  <Setter Property="TickTextBrush" Value="Red" />

  <Setter Property="TickLabelStyle">
    <Setter.Value>
      <Style TargetType="s:DefaultTickLabel">

        <Setter Property="FontSize" Value="16" />
        <Setter Property="FontWeight" Value="Normal" />
        <Setter Property="FontFamily" Value="Courier New" />
        <Setter Property="Foreground" Value="Blue" />

        <Setter Property="Template">
          <Setter.Value>
            <ControlTemplate TargetType="s:DefaultTickLabel">
              <ContentControl Content="{Binding}"
                              ContentTemplate="{TemplateBinding ContentTemplate}"
                              IsTabStop="False" 
                              Foreground="{TemplateBinding Foreground}" 
                              FontFamily="{TemplateBinding FontFamily}"
                              FontSize="{TemplateBinding FontSize}"
                              FontWeight="{TemplateBinding FontWeight}"/>
            </ControlTemplate>
          </Setter.Value>
        </Setter>
      </Style>
    </Setter.Value>
  </Setter>
</Style>

Same procedure seems doesn’t work for 3D-Charts.
How can i achieve this?
Is that currently possible?

Best Regards
Silvester

0 votes
12k views

in IOS SDK there are SCIAxisRangeSyncronization and SCIAxisAreaSizeSyncronization for dealing with axis sync. I would like to ask are there any similar classes in Android to do this ? Thanks.

  • Ray Hung asked 7 years ago
  • last active 7 years ago
0 votes
0 answers
14k views

Hi support,
I have two signal, one is SIN waveform and another is COS waveform (like picture 1). Now I want to draw two signal like XY-Chart, how can I fix the same scale of X and Y axis? In the same view scale, the path must like a Circle.

  • Jazz Kuo asked 5 years ago
  • last active 5 years ago
0 votes
21k views

I have a YAxis(NumericAxis) that indicates price, now I want to set different color to the label text(please see the uploaded image):

I’ve seen the ILabelProvider, but it seems to set string format.
How should I do?

  • Yuhang Ji asked 8 years ago
  • last active 8 years ago
0 votes
7k views

Hi,

I’m actually working on new wpf application using Scichart and I’m wondering how to plot only XAxis and YAxis without labels and without gridlines.

Here is my code, I cannot not figure out what is missing to do that:

            <s:SciChartSurface.YAxis>
                <s:NumericAxis VisibleRange="{Binding ...}"
                               MajorGridLineStyle="{Binding ...}"
                               TickLabelStyle="{Binding ...}"
                               MajorDelta="{Binding ...}"
                               MinorDelta="1"
                               AutoTicks="False"
                               AxisAlignment="Left"
                               DrawMajorGridLines="false
                               DrawMinorGridLines="false"
                               DrawMajorBands="false"
                               DrawMajorTicks="false"
                               DrawMinorTicks="false"
                               DrawLabels="false"
            </s:SciChartSurface.YAxis>


        <Style x:Key="NoGraphGridLineStyle" TargetType="s:NumericAxis">
            <Setter Property="Visibility" Value="Collapsed" />
        </Style>
0 votes
12k views

Hi, guys

Is it possible to draw axis line at axis area? See attachment.

0 votes
2k views

Hello.
Thanks for previous answer but I can’t check how it work because of new problem. I develop WPF application and try to use MVVM as architecture pattern. In the Model part of my application I used a loop started in the new thread. In that loop I get some data which received to ViewModel and used as chart data. Looks as usual.
But then I tried to set visible range updated object which bound to axis I get exception ‘System.InvalidOperationException: ‘The calling thread cannot access this object because a different thread owns it.’ in my loop. I know it happens in WPF applications and need to use Dispatcher to solve it. But as I know if you try to use MVVM you not needed to use Dispatcher often because WPF-binding in most cases is thread-safe. That happend in my case? How to solve it?
Parts of my code:

XAML

<Window x:Class="HMI.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:s="http://schemas.abtsoftware.co.uk/scichart"
        xmlns:localVM="clr-namespace:MyCom.HMI.ViewModel"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">
    <Window.DataContext>
        <localVM:HMIViewModel/>
    </Window.DataContext>
    <Window.Resources>
        <localVM:InverseBooleanConverter x:Key="InverseBooleanConverter"/>
        <localVM:ProcessStateToColorConverter x:Key="ProcessStateToColorConverter"/>
        <localVM:ProcessStateToStartedConverter x:Key="ProcessStateToStartedConverter"/>
        <localVM:ProcessStateToStoppedConverter x:Key="ProcessStateToStoppedConverter"/>
    </Window.Resources>
    <DockPanel>
        <StackPanel DockPanel.Dock="Top" Orientation="Horizontal">
            <StackPanel DockPanel.Dock="Left" Orientation="Vertical" Width="520">
                <Border DockPanel.Dock="Top" Margin="5" Padding="5" BorderBrush="Black" BorderThickness="1,1,1,1" CornerRadius="5">
                    <StackPanel DockPanel.Dock="left" Orientation="Horizontal" Height="40">
                        <Ellipse Margin="5" Height="20" Width="20" HorizontalAlignment="Left" VerticalAlignment="Center" Stroke="Black" Fill="{Binding ProcessState, Converter={StaticResource ProcessStateToColorConverter}}"/>
                        <Label Content="State" Margin="5" Width="90" HorizontalContentAlignment="Left" VerticalContentAlignment="Center"/>
                    </StackPanel>
                </Border>
                <Border DockPanel.Dock="Top" Margin="5" Padding="5" BorderBrush="Black" BorderThickness="1,1,1,1" CornerRadius="5">
                    <Grid DockPanel.Dock="Left" Height="300">
                        <s:SciChartSurface ChartTitle="Profil" RenderableSeries="{s:SeriesBinding RenderableSeries}">
                            <s:SciChartSurface.XAxis>
                                <s:NumericAxis AxisTitle="Position, m" VisibleRange="{Binding XVisibleRange, Mode=TwoWay}"/>
                            </s:SciChartSurface.XAxis>
                            <s:SciChartSurface.YAxis>
                                <s:NumericAxis AxisTitle="Size, um" VisibleRange="{Binding YVisibleRange, Mode=TwoWay}"/>
                            </s:SciChartSurface.YAxis>
                        </s:SciChartSurface>
                    </Grid>
                </Border>
            </StackPanel>
...

ViewModel

namespace MyCom.HMI.ViewModel
{
    public class HMIViewModel : BindableBase
    {      
        private readonly HMIModel _model = new();

        public HMIViewModel()
        {
            _renderableSeries = new ObservableCollection<IRenderableSeriesViewModel>();

            ((INotifyCollectionChanged)_model.TestControlData).CollectionChanged += (s, e) =>  { TestControlDataChanged(e); };

            InitCharts();
        }

...

        private ObservableCollection<IRenderableSeriesViewModel> _renderableSeries;
        public ObservableCollection<IRenderableSeriesViewModel> RenderableSeries
        {
            get { return _renderableSeries; }
            set
            {
                SetProperty(ref _renderableSeries, value, nameof(RenderableSeries));
            }
        }

        private IRange _xVisibleRange;
        public IRange XVisibleRange
        {
            get => _xVisibleRange;
            set
            {
                if (_xVisibleRange != value)
                {
                    SetProperty(ref _xVisibleRange, value, nameof(XVisibleRange));
                }
            }
        }

        private IRange _yVisibleRange;
        public IRange YVisibleRange
        {
            get => _yVisibleRange;
            set
            {
                if (_yVisibleRange != value)
                {
                    SetProperty(ref _yVisibleRange, value, nameof(YVisibleRange));
                }
            }
        }

        private XyDataSeries<double, double> _lineDataDiameter1;

...

        private void InitCharts()
        { // TODO
            _lineDataDiameter1 = new XyDataSeries<double, double>()
            { 
                SeriesName = "Diameter1"
            };

            RenderableSeries.Add(new LineRenderableSeriesViewModel()
            {
                StrokeThickness = 2,
                Stroke = Colors.SteelBlue,
                DataSeries = _lineDataDiameter1,
                StyleKey = "LineSeriesStyle"
            });
        }

        private void TestControlDataChanged(NotifyCollectionChangedEventArgs args)
        {
            if (args.Action == NotifyCollectionChangedAction.Add && args.NewItems?.Count > 0)
            {
                var testControlActualState = args.NewItems.Cast<TestControlActualState>();

                List<double> xValues = new();
                List<double> yValuesDiameter1 = new();

                foreach (var item in testControlActualState) 
                {
                    if (item.Diameter1 > 0f)
                    {
                        xValues.Add(item.FiberLength);
                        yValuesDiameter1.Add(item.Diameter1);
                    }
                }

                _lineDataDiameter1.Append(xValues, yValuesDiameter1);

                // TODO
                if (xValues.Count > 0)
                {
                    var cuurMaxValueX = xValues.Max();
                    XVisibleRange.Max = cuurMaxValueX;
                    XVisibleRange.Min = cuurMaxValueX - 7000f > 0 ? cuurMaxValueX - 7000f : 0;
                }

                // TODO
                if (yValuesDiameter1.Count > 0)
                {
                    var cuurMaxValueY = yValuesDiameter1.Max();
                    YVisibleRange.Max = cuurMaxValueY + 50;
                    YVisibleRange.Min = 0;
                }
            }
        }

Model

namespace MyCom.HMI.Model
{
    public class HMIModel : BindableBase, IDisposable
    {
        private readonly ObservableCollection<TestControlActualState> _testControlData;
        internal ReadOnlyObservableCollection<TestControlActualState> TestControlData { get; }

        public HMIModel()
        {
            _testControlData = new ObservableCollection<TestControlActualState>();
            TestControlData = new ReadOnlyObservableCollection<TestControlActualState>(_testControlData);
        }

...

        private void StartPollerThread()
        {
            _pollerCancellationToken ??= new CancellationTokenSource();

            if (!_pollerCancellationToken.IsCancellationRequested)
            {
                Task.Factory.StartNew(() => PollerDoWork(_pollerCancellationToken.Token), TaskCreationOptions.LongRunning);
            }
        }

        private void PollerDoWork(CancellationToken cancellationToken)
        {
            try
            {
                Thread.CurrentThread.Priority = ThreadPriority.Lowest;
                IsPollerStarted = true;

                while (!cancellationToken.IsCancellationRequested && (_isKeepConnection || _countOfTrying <= MAX_COUNT_OF_TRYING))
                {
                    try
                    {
                        _testControlData.Add(_emulator.GetTestControlActualState());

                        if (!_isKeepConnection && _countOfTrying > 0)
                        {
                            Thread.Sleep(_pollerTimeout / REASK_COEFICIENT);
                            continue;
                        }
                    }
                    catch
                    {
                        // Thread must be alive!!! ...ALWAYS!!!
                    }
                    Thread.Sleep(_pollerTimeout);
                }
            }
            finally
            {
                IsPollerStarted = false;
                _pollerCancellationToken = null;
            }
        }
0 votes
0 answers
10k views

Hi:

My name is Harold Ramírez and I have a question I would like you to answer because I don’t find any doucmentation about it online.

I have a WPF application with several charts, some of them in 3D. These 3D charts have the X axis in horizontal, Y in vertical and the Z in depth. I want only to keep the labels on the X and Y axis, on the left and bottom of the chart.

The only documentation I have found is this page: https://www.scichart.com/documentation/v5.x/webframe.html#Showing%20Axis%20Labels%20on%20one%20side%20of%20the%203D%20Chart.html, and only shows how to make it in XAML, but I need it to do it programatically in C#.

Thank you for your time.

Harold.

0 votes
10k views

I getting a weird behavior on my xAxis and yAxis with a real time SciChart.

The labels on axes and the chart itself start shaking like it is trying to update positions but it never gets steady.

I have a background routine adding data to the data series every second and every chart have two series with 2 YAxis, there are only two charts visible in the window at a given time.

Also I have noticed that after a few minutes of doing this the window itself get sluggish and not responsive anymore, I switch to another tab which doesn’t have a chart it start responding again.

Have anyone seeing something like this?

I have tried the Performance Tips and Tricks but nothing changes this behavior.

I’m using a Surface 3 pro with SciChart version 3.3.0.5909

Here is my XAML and the dispatcher timer adding data to the dataseries.

<UserControl 
x:Class="PulseControl.CustomControls.RealTimeEnergy" 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:m="clr-namespace:PulseControl.Models"
xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" 
xmlns:ee="http://schemas.microsoft.com/expression/2010/effects" 
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" 
xmlns:Custom="http://metro.mahapps.com/winfx/xaml/shared" 
xmlns:PulseControl="clr-namespace:PulseControl" 
xmlns:converters="clr-namespace:PulseControl.Converters" 
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns:s="http://schemas.abtsoftware.co.uk/scichart" 
xmlns:cc="clr-namespace:PulseControl.CustomControls"
Width="Auto"
Background="{StaticResource WindowBackgroundBrush}" 
mc:Ignorable="d" d:DesignHeight="140" d:DesignWidth="600" d:DataContext="{d:DesignInstance {x:Type m:MainWindowsModel}}"
>
<UserControl.Resources>
    <ResourceDictionary>
        <converters:IntToKiloConverter x:Key="Int2Kilo" />
    </ResourceDictionary>
</UserControl.Resources>

<DockPanel 
    Background="{StaticResource WindowBackgroundBrush}" >

    <Grid 
        DockPanel.Dock="Top"
        Height="140">
        <Grid.RowDefinitions>
            <RowDefinition Height="100"></RowDefinition>
            <RowDefinition Height="40"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="170"></ColumnDefinition>
            <ColumnDefinition Width="*"></ColumnDefinition>
            <ColumnDefinition Width="170"></ColumnDefinition>
        </Grid.ColumnDefinitions>


        <Border 
            Grid.Column="0"
            Grid.Row="0"
            CornerRadius="50"
            Width="170"
            Margin="0"
            Padding="0"
            Background="{StaticResource ColorLeftChartBrush}"
            BorderThickness="1">
            <TextBlock 
                Style="{StaticResource FieldTextBoxStyle}"
                Foreground="{StaticResource BlackBrush}"
                HorizontalAlignment="Center"
                Padding="0"
                Margin="0"
                FontSize="60"
                VerticalAlignment="Center"
                Text="{Binding Laser.OpData.AvgKiloVoltagePerSecond, Mode=OneWay, StringFormat={}{0:N1}}">
            </TextBlock>
        </Border>

        <Label
            Grid.Column="0"
            Grid.Row="1"
            Style="{StaticResource FieldLabelStyle}"
            FontSize="20"
            HorizontalAlignment="Center"
            VerticalAlignment="Top">
            Voltage (kV)
        </Label>


        <s:SciChartSurface 
            Name="sciChart" 
            Grid.Column="1"
            Grid.RowSpan="2"
            Height="140"
            Background="{StaticResource WindowBackgroundBrush}"
            s:SciChartGroup.VerticalChartGroup="OPERATION"
            Width="Auto"
            Margin="0"
            Padding="8 8 8 10"
            RenderPriority="Low"
            MaxFrameRate="30">

            <s:SciChartSurface.RenderableSeries>

                <s:FastMountainRenderableSeries 
                    x:Name="serieVoltage" 
                    SeriesColor="{StaticResource ColorLeftChart}" 
                    StrokeThickness="2"
                    YAxisId="LAXIS"
                    DataSeries="{Binding ChartData.ChartDataVoltage}">
                    <s:FastMountainRenderableSeries.AreaBrush>
                        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                            <GradientStop Color="#A860a917" Offset="0"/>
                            <GradientStop Color="#3360a917" Offset="1"/>
                        </LinearGradientBrush>
                    </s:FastMountainRenderableSeries.AreaBrush>
                </s:FastMountainRenderableSeries>

                <s:FastMountainRenderableSeries 
                    x:Name="serieEnergy" 
                    SeriesColor="{StaticResource ColorRightChart}" 
                    StrokeThickness="2"
                    YAxisId="RAXIS"
                    DataSeries="{Binding ChartData.ChartDataEnergy}">
                    <s:FastMountainRenderableSeries.AreaBrush>
                        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                            <GradientStop Color="#A83376E5" Offset="0"/>
                            <GradientStop Color="#333376E5" Offset="1"/>
                        </LinearGradientBrush>
                    </s:FastMountainRenderableSeries.AreaBrush>
                </s:FastMountainRenderableSeries>

            </s:SciChartSurface.RenderableSeries>

            <s:SciChartSurface.XAxis >
                <s:DateTimeAxis Name="xAxis" AutoRange="Always"  IsStaticAxis="True" TextFormatting="dd HH:mm" SubDayTextFormatting="HH:mm:ss" CursorTextFormatting = "mm:ss" Foreground="White"  />
            </s:SciChartSurface.XAxis>

            <s:SciChartSurface.YAxes>
                <s:NumericAxis 
                    AutoRange="Always" 
                    GrowBy="0,0.5"
                    IsPrimaryAxis="True"
                    AxisAlignment="Right"
                    Id="RAXIS"
                    Style="{StaticResource NoMinorLines}">
                </s:NumericAxis>
                <s:NumericAxis 
                    AutoRange="Always" 
                    GrowBy="0,0.25"
                    IsPrimaryAxis="False"
                    Id="LAXIS"
                    AxisAlignment="Left"
                    Style="{StaticResource NoMinorLines}">
                </s:NumericAxis>
            </s:SciChartSurface.YAxes>

            <s:SciChartSurface.ChartModifier>
                <s:ModifierGroup>
                    <s:RubberBandXyZoomModifier IsEnabled="{Binding ChartData.ZoomEnabled, Mode=TwoWay}" IsXAxisOnly="True"></s:RubberBandXyZoomModifier>
                    <s:ZoomPanModifier IsEnabled="{Binding ChartData.PanEnabled, Mode=TwoWay}"></s:ZoomPanModifier>
                    <s:MouseWheelZoomModifier IsEnabled="{Binding ChartData.MouseWheelEnabled, Mode=TwoWay}"></s:MouseWheelZoomModifier>
                    <s:RolloverModifier IsEnabled="{Binding ChartData.RolloverEnabled, Mode=TwoWay}"></s:RolloverModifier>
                    <s:CursorModifier IsEnabled="{Binding ChartData.CursorEnabled, Mode=TwoWay}"></s:CursorModifier>
                    <s:YAxisDragModifier></s:YAxisDragModifier>
                    <s:XAxisDragModifier></s:XAxisDragModifier>
                    <s:ZoomExtentsModifier></s:ZoomExtentsModifier>
                </s:ModifierGroup>
            </s:SciChartSurface.ChartModifier>

        </s:SciChartSurface>

        <Border 
            Grid.Column="2"
            Grid.Row="0"
            CornerRadius="50"
            Width="170"
            Margin="0"
            Padding="0"
            Background="{StaticResource ColorRightChartBrush}"
            BorderThickness="1">
            <TextBlock 
                Style="{StaticResource FieldTextBoxStyle}"
                Foreground="{StaticResource BlackBrush}"
                HorizontalAlignment="Center"
                Padding="0"
                Margin="0"
                FontSize="60"
                VerticalAlignment="Center"
                Text="{Binding Laser.OpData.AvgEnergyPerSecond, Mode=OneWay, StringFormat={}{0:N1}}">
            </TextBlock>
        </Border>

        <Label
            Grid.Column="2"
            Grid.Row="1"
            Style="{StaticResource FieldLabelStyle}"
            FontSize="20"
            HorizontalAlignment="Center"
            VerticalAlignment="Top">
            Energy (mJ)
        </Label>

    </Grid>

</DockPanel>

Model

void _timer_Tick(object sender, EventArgs e)
    {
        DateTime now = DateTime.Now;

            // Things to do when running
        SafeAddPoint(_chartDataEnergy, now, Laser.OpData.AvgEnergyPerSecond);
        SafeAddPoint(_chartDataEfficiency, now, Laser.OpData.ChamberEfficiency * 100.0);
        SafeAddPoint(_chartDataVoltage, now, Laser.OpData.AvgKiloVoltagePerSecond);
        SafeAddPoint(_chartDataPressure, now, Laser.OpData.Pressure);
        SafeAddPoint(_chartDataSigmaEnergy, now, Laser.OpData.SampleSigma);
        SafeAddPoint(_chartDataSigmaPercentage, now, Laser.OpData.SampleSigmaPercentage);
        SafeAddPoint(_chartDataTemperature, now, Laser.OpData.Temperature);
    }

    private void SafeAddPoint(IDataSeries serie, DateTime dt, double val)
    {
        if (serie.ParentSurface != null)
            using (serie.ParentSurface.SuspendUpdates())
                ((XyDataSeries<DateTime, double>)serie).Append(dt, val);
        else
            ((XyDataSeries<DateTime, double>)serie).Append(dt, val);
    }
0 votes
13k views

I am using the CategoryDateTimeAxis to fetch data in minute resolution for a few days and then append realtime data in one second resolution to it. Since the CategoryDateTimeAxis uses equidistance calculations I was wondering if it is possible to override that behaviour somehow? I.e. can I control the distance calculation somehow?

I am currently switching to CategoryDateTimeAxis because DiscontinuousDateTimeAxis provides to much of a performance hit for our use case.

0 votes
6k views

We are evaluating SciChart for use in our product which includes displaying higher precision date time information that the .NET framework DateTime can provide (1 tick = 100ns resolution).

I started by sub-classing the AxisBase class, but I am having issues finding documentation that could help in implement certain methods.

Some of the methods below are outlined–but a full, custom axis example (i.e. example of DateTimeAxis) would be of even greater help.


IRange CalculateYRange(RenderPassInfo renderPassInfo) — Is this only used for YAxis? How does orientation affect the range?

List GetSupportedTypes() — Is this supported IRange types? What types are these?

IRange GetDefaultNonZeroRange() — Is this just the smallest non-Undefined range? Else what is default?

void CalculateDelta() — This has no parameters or return values. The documentation is not clear on what members must need to be set here. Without any example it seem impossible to know how to implement this.

Why does IRange define Diff as type T? In the case of DateRange Diff becomes DateTime. Shouldn’t diff be of type TimeSpan? Are the ticks in the DateTime simply used as a TimeSpan type value? (Assuming Diff is the span of the range). I could implement IRange and use different types (DateTime and TimeSpan) respectively for Min/Max and Diff in this case (assuming I don’t need the templated version of the type.

0 votes
11k views

Hi:

My name is Harold Ramírez and I have a question I would like you to answer because I don’t find any doucmentation about it online.

I have a WPF application with several charts, some of them in 3D. These 3D charts have the X axis in horizontal, Y in vertical and the Z in depth. I want only to keep the labels on the X and Y axis, on the left and bottom of the chart.

The only documentation I have found is this page: https://www.scichart.com/documentation/v5.x/webframe.html#Showing%20Axis%20Labels%20on%20one%20side%20of%20the%203D%20Chart.html, and only shows how to make it in XAML, but I need it to do it programatically in C#.

Thank you for your time.

Harold.

0 votes
13k views

Hi

We are using a simple SciChart setup like the following:

        <Grid Margin="20,45,50,20">

    <!--  Create the chart surface  -->
    <s:SciChartSurface Name="SparseValuesPlot" s:ThemeManager.Theme="Chrome">

        <!--  Declare RenderableSeries  -->
        <s:SciChartSurface.RenderableSeries>
            <s:FastLineRenderableSeries DataSeries="{Binding Values}" Style="{Binding PlotStyle, Converter={StaticResource plotStyleConverter}}" />
        </s:SciChartSurface.RenderableSeries>

        <!--  Create an X Axis  -->
        <s:SciChartSurface.XAxis>
            <s:NumericAxis AxisAlignment="Bottom" GrowBy="0.1, 0.1" AxisTitle="{Binding XAxisTitle}" AutoRange="Never" VisibleRange="{Binding XRange}" />
        </s:SciChartSurface.XAxis>

        <!--  Create a Y Axis  -->
        <s:SciChartSurface.YAxis>
            <s:NumericAxis AxisAlignment="Left" GrowBy="0.1, 0.1" AxisTitle="{Binding YAxisTitle}" AutoRange="Never" VisibleRange="{Binding YRange}" />
        </s:SciChartSurface.YAxis>

    </s:SciChartSurface>
</Grid>

Is there a way to fix the aspect ratio of the chart such that a unit on the x-axis is displayed with the same number of pixels than a unit on the y-axis?

Right now the chart is streched with the surrounding grid. I tried to set height and width of the SciChartSurface but this does not keep the relations because the axis label areas may take different amount of space.

Thanks
Julian

0 votes
10k views

I am using an SCINumericAxis for my y-axis. I am setting the visibleRange to (Min = 28, Max = 76). I am leaving the minorsPerMajor to the default of 5. However when looking at my graph (attached) you can see that the major tick labels are actually every 6 minors, e.g. 30, 36, 42, etc. when they should be 30, 35, 40, etc for minorsPerMajor set to 5.

Please advise on how to fix this issue as my major tick labels should be every 5, not every 6.

  • Brad Taber asked 4 years ago
  • last active 4 years ago
0 votes
14k views

Hi,

I have some charts binded to a viewmodel. I wanted to produce a bar chart, so I want to modify the AxisAlignment.

If I specify a hardcoded alignment in the XAML, it works fine.

If I bind the alignment to the viewModel, the chart does not render, and I get the following error in the output:

 SciChartSurface didn't render, because an exception was thrown:
      Message: The specified Visual and this Visual do not share a common ancestor, so there is no valid transformation between the two Visuals.

Stack Trace:    at System.Windows.Media.Visual.TransformToVisual(Visual visual)
   at A.cac257c85637821690b32a44bda9b120f.cd0eaed29fc1e87dfe7aa912a7f678b57(FrameworkElement c5aaca7e2018a1512249ec2e2170b4cc6, UIElement c708323fb6eac118d4fd2c5913dc2a6ed)
   at A.cac257c85637821690b32a44bda9b120f.cd0eaed29fc1e87dfe7aa912a7f678b57(FrameworkElement c5aaca7e2018a1512249ec2e2170b4cc6, IHitTestable cc9d5fbe91f2861ee865bbb5439d3b84d)
   at Abt.Controls.SciChart.Visuals.Axes.AxisBase.GetAxisOffset()
   at Abt.Controls.SciChart.Visuals.Axes.AxisBase.GetAxisParams()
   at Abt.Controls.SciChart.Visuals.Axes.AxisBase.OnBeginRenderPass()
   at A.cda144392e546b245ef5bb1ee71f22b3a.c64a51c8ba6b7cbda8b9d9380d6337036(ISciChartSurface c17037e8328cd0abc02d2a6957dfa450c, RenderPassInfo c16b8d70d2b6ecad8f9fca7ac3f5177b8)
   at A.cda144392e546b245ef5bb1ee71f22b3a.c1a2306a5cc0452a04d135e77f0de4ff1(ISciChartSurface c17037e8328cd0abc02d2a6957dfa450c, Size cacf0a4a95d1143f0c11e20d4508e7132)
   at A.cda144392e546b245ef5bb1ee71f22b3a.RenderLoop(IRenderContext2D renderContext)
   at Abt.Controls.SciChart.Visuals.SciChartSurface.ca065c0b671221e0e603d0e9bf2792494()

This is the axis XAML:

 <s:SciChartSurface.XAxis>
                                    <s:NumericAxis AxisAlignment="{Binding XAxisAlignment}" LabelProvider="{Binding LabelProvider}" AutoTicks="False" MajorDelta="1" MinorDelta="1" DrawMinorGridLines="False">
                                    </s:NumericAxis>
                                </s:SciChartSurface.XAxis>

                                <s:SciChartSurface.YAxis>
                                    <s:NumericAxis AxisAlignment="{Binding YAxisAlignment}" AxisTitle="Number of crimes" GrowBy="0,1"/>
                                </s:SciChartSurface.YAxis>

And the properties I’m binding to:

public AxisAlignment XAxisAlignment { get; private set; }

public AxisAlignment YAxisAlignment { get; private set; }

Any help is appreciated.

Thanks,
Charbel

  • cabdo asked 10 years ago
  • last active 10 years ago
Showing 1 - 50 of 67 results

Try SciChart Today

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

Start TrialCase Studies