Pre loader

Category: WPF

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

I’m rebuilding a program to adhere to MVVM and so I’m trying to figure out little tricks to do things I did previously in the code-behind.

I’d like to be able to right-click on a selected series and add a point at that location. I’m doing this in my previous application but I’m not too sure the best route to take with the MVVM application.

I’m currently selecting a series with the SeriesSelectionModifier, but I’m also not sure if there’s a “SelectedSeries” property I can get from the modifier either.

Maybe a Trigger that detects a right mouse click on a selected series that calls a command to add the point?

Or is there just not a way to do this with the chart and I need to rely on subscribing to events?

Thanks!

Answer:

I created a property named SelectedSeries which looks like this…

    public IRenderableSeries SelectedSeries
    {
        get
        {
            if (SciChart.SelectedRenderableSeries.Count > 0)
            {
                return SciChart.SelectedRenderableSeries[0];
            } else
            {
                return null;
            }
        }
    }

Then, I created a MouseRightButtonUp event to see if I right-clicked on SelectedSeries. If so, it adds a point. If I clicked on an existing point, it deletes that point.

    private void _sciChart_MouseRightButtonUp(object sender, MouseButtonEventArgs e)
    {
        if (SelectedSeries != null)
        {
            HitTestInfo hitTestToDelete = SelectedSeries.HitTest(rawPoint: MouseDownPosition, hitTestRadius: 10);

            if (hitTestToDelete.IsHit == true)
            {
                // Do nothing if the first or last point is hit
                if (hitTestToDelete.DataSeriesIndex == 0 || hitTestToDelete.DataSeriesIndex == SelectedSeries.DataSeries.Count - 1)
                {
                    return;
                }

                // Delete point
                DeletePoint(point: hitTestToDelete);
            } else
            {
                // Add point if hitting series
                HitTestInfo hitTestToAdd = SelectedSeries.HitTest(rawPoint: MouseDownPosition, hitTestRadius: 10, interpolate: true);

                if (hitTestToAdd.IsHit == true)
                {
                    // Add point
                    AddPoint(point: hitTestToAdd);
                }
            }
        }
    }
  • Greg Knox asked 5 years ago
  • last active 5 years ago
0 votes
3k views

Recently a customer asked us on a support ticket:

We are trying to free the memory used by SciChart but it seems like
there is a large amount of memory still held somewhere in the code.
Attached

Bug scenario:

  1. Run the 50-Channel EEG Example
  2. Start the UI, With task manager memory usage is around 40 MB.
  3. Press Run, memory usage increase to ~130 MB.
  4. Press Stop, memory usage remains the same (around 130 MB).
  5. Call the garbage collector manually, on the second call of the garbage collector the memory stays above 100 MB.

How can we release the memory allocated by a DataSeries in SciChart WPF?

0 votes
9k views

If YAxis AxisAlignment is set to AxisAlignment.Left, then functions
XAxis.GetDataValue and XAxis.GetCoordinate give incorrect values (shifted by YAxis width).

Need to add/subtract YAxis width to get correct values, like that:

this.chart.XAxis.GetCoordinate(verticalLine.X1) + this.chart.YAxis.ActualWidth

this.chart.XAxis.GetDataValue(e.MousePoint.X - this.chart.YAxis.ActualWidth)
  • anth asked 11 years ago
0 votes
8k 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
13k views

CategorizedDateTimeAxis is not suitable for financial intraday charts of instruments with low liquidity and pre/afterhours charts. It discards time periods (minutes) with no trades, ‘compresses time’ and makes picture confusing. They don’t do it in good trading platforms.
DateTimeAxis would help here. But is there any hack to remove time periods when market closed, weekend, holidays?
If not please consider it as new feature request. It can be implemented as a collection of time periods to remove or show.

  • RTrade A asked 10 years ago
  • last active 4 years ago
0 votes
0 answers
6k views

hello,

I am trying to plot multiple line series in a chart and i do use MVVM pattern
here is how i setup collection of series and append data
1. I create a collection of series ,say 10000 and bind it to series source
2. Get each series and append data in worker thread. I use SuspendUpdate during appending data.

The problem i am facing is , once the series is appended with the data (i am trying to add 10 points) is not showing in chart immediately and it blocks the UI thread
.It starts displaying series some where after 100 series are appended.

Could you please let me know the best approach to follow to get the best performance?.

Thanks
Deep

0 votes
14k views

Hi,

I am using CategoryDateTimeAxis for creation so my VisibleRange is an IndexRange. When I am loading my whole data over chart, I want to set VisibleRange for 3 month by default. So how can I get Min and Max value from VisibleRange as DateTimes?

I don’t see any method which would convert our DateRange to IndexRange and vice verse, so that I can set up my VisibleRange.

Please help!

0 votes
15k views

Hi there, How can i use ZoomExtents() on MVVM ?

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

I have an impulse series chart, and with SciChart v3.x the rollover modifier line would “snap” to the nearest point. Since migrating to v6.5 this no longer happens – only the rollover marker snaps, not the vertical line. Setting UseInterpolation=”False” has no effect.

I’ve only noticed this on the impulse series, and the rollover line does still snap on other types (e.g. line, scatter). I just wanted to check that I’m not missing something, or if there any way to reinstate this snapping behaviour?

1 vote
14k views

This “how do I” is primarily born from my question about multi-click annotations. This could also be it’s own topic so here goes:

How do I link annotations so that when the X2Y2 of line1 moves, X1Y1 of line 2 will move? Doing this in one direction I’ve been able to do. However, when I move X1Y1 of line2, line 1’s X2Y2 aren’t updated so they separate. Ideally, this should probably be event based. Is there a way to subscribe to the movement of the handles of a BaseAnnotation? My annotations are created dynamically so the linking method would need to be run time compatible.

0 votes
7k views

Hi,

Please see the 2 images attached. I would like to reproduce something similar to what’s on the images using scichart ie. being able to select/unselect certain parts of the series by placing a control on certain datapoints (being able to add a checkbox to the surface would be great). What options do I have?

One more question, Is it possible to add a label to LineAnnotations?

Thanks.

0 votes
13k views

Hi team,

How to access, enable and disable scrollbar in c# wpf?

My declaration is as of below.

            <sc:SciChartScrollbar Axis="{Binding ElementName=SciChart, Path=XAxis}" Height="18" Width="150" />

Thanks in advance.

  • Adrian Loh asked 5 years ago
  • last active 5 years ago
0 votes
7k views

Hey,

I have followed the 50 EEG example in creating a group of graphs which is populated using a listbox and a data template. The graphs are created and populated correctly. The issue arises when creating graph modifiers (eg Rollover, Zoom). Is there an issue with selecting these graphs or adding modifiers.

Thank You

0 votes
11k views

Hi All,

I have a linear graph which represents a measure in real time (I have a loop that gets a value at each iteration). I have a FastLineRenderableSeries with a DataSeries in which I append x and y vector. The y vector is full of Double.NaN values, and it is updated with valid values at each loop iteration. During the representation, I can only see valid values, and NaN values are not represented. Everything ok.

But now I have changed from FastLineRenderableSeries to CustomRenderableSeries (due to markers and other issues), and I have a strange effect on real time visualization (see attached picture). It seems that NaN values are represented as infinite, so I can see a vertical line at last real value.

I have set DrawNaNAs = LineDrawMode.Gaps but it doesn’t work. Am I doing something wrong? Is there something extra I have to set regarding CustomRenderableSeries?

Thanks in advance

0 votes
10k views

Hi every one,
In order to pan and zoom the graph (from the example https://www.scichart.com/wpf-chart-example-pan-on-mouse-drag/ ), I used MouseWheelZoomModifier for zooming and ZoomPanModifier for panning.
The code is as below:

                <s:ZoomPanModifier x:Name="zoomPanModifier"
                                   ClipModeX="ClipAtExtents"
                                   ExecuteOn="MouseLeftButton"
                                   IsEnabled="True" />
            </s:ModifierGroup>

However, when I zoom out the graph and pan it horizontally, the graph auto stretch (auto zooming). That is not what I expected, I want disable this feature but I have no idea how to do it.

enter image description here

  • Quan Tran asked 8 years ago
  • last active 8 years ago
1 vote
14k views

Is it possible to have different colors of FastColumnRenderableSeries based on up/down candle of FastCandlestickRenderableSeries if they have shared VisibleRange. This is done in many trading platforms. If not, please consider it as feature request.

Sample picture from Google

0 votes
7k views

Hi guys!
Is there a way to Format all number shown in a Chart to have always 3 Decimal places shown?

0 votes
12k views

Hallo,

I have a problem with drawing of 2d data in a map. The metadata for the respective points change when you zoom in or move the map.

LandmarkCollection landMarks = new LandmarkCollection();
            NAVLandmarkCollection landmarkCollection = NAVLandmarkCollection.Deserialize(@"C:\Users\Serva_admin\Documents\AGV-Viso\VS_Projekte\AGV-Viso-2\AGV-Viso-2\16-02-06-18-23-ING.lmf");
            for (int i = 0; i < landmarkCollection.Count; i++)
            {
                NAVLandmark lm = landmarkCollection.get(i);
                landMarks.Landmarks.Append(lm.X, lm.Y, new Serva.Base.Navigation.Client.NavigationPlugin.MetaData.LandmarkName("G-" + i, lm.X, lm.Y));
            }

            communicationBus.Publish(landMarks);

This function is called once and the data does not change anymore.

I uploaded the pictures of my problem in the attachment.
You can see the Name of the Point in the top-left corner changed.

I hope you can me help.

  • Tim Nowak asked 5 years ago
  • last active 5 years ago
0 votes
14k views

From example “SciTrader” I created stockcharting which allows to see multiple charts. From main menu I’m creating new windows with content of userControl from example, binds them to ViewModel class and put ViewModel instances into collection of ViewModels. It works fine with historic and realtime date for different stocks. But I have a problem when I’m adding crosshair cursor in my charts. If I have a mouse with crosshair in one chart in all others chart I have vertical line of this crosshair in the same X axis point. And If I scroll chart with left mouse pressed others chart affected too.
I suggest the problem is in this piece of code:

<sciChart:SciChartSurface.ChartModifier>
<sciChart:ModifierGroup sciChart:MouseManager.MouseEventGroup="MySharedMouseGroup">
<sciChart:XAxisDragModifier />
<sciChart:YAxisDragModifier />
<sciChart:ZoomPanModifier IsEnabled="True" />
<sciChart:CursorModifier IsEnabled="True"/>
<!–<sciChart:RubberBandXyZoomModifier IsEnabled="{Binding ChartModifier, Mode=TwoWay, Converter={StaticResource IsModifierTypeConverter}, ConverterParameter=RubberBandZoom}" IsXAxisOnly="True" />–>
<sciChart:MouseWheelZoomModifier />
<sciChart:ZoomExtentsModifier ExecuteOn="MouseDoubleClick" />
</sciChart:ModifierGroup>
</sciChart:SciChartSurface.ChartModifier>

Please give me some hints how can I have independent crosshair appearing only in window where my mouse is.

It worked fine with stockchart controls from CreateRealTimeTickingStockChart but I want to use SciChartSurface from SciTrader example because of volume pane and more powerfull customizing ability of SciChartSurface.

0 votes
12k views

I’m working on a project that updates about 100,000 pointers in real time, but it takes too much time to change the individual colors of the pointers.
Is there any quick way to change pointer individual color?

1 vote
5k views

I must be missing something here.
I’ve followed the tooltips and hit test 3d chart examples.
All I need is the X, Y, Z coordinates that you get with the tooltip.
The only example I’ve found is for scatter points using VertexSelectionModifier3D and OnScatterDataChanged event.
But I cant figure out how to do something similar with GridDataSeries (Uniform or non-uniform).
I’ve tried the “ToolTipOpening” event but it doesn’t trigger when the tooltip opens.
This is the last thing I need before I commit to a licence.
The chart is working fine for my use case otherwise.
Thanks!

  • Blaz Majcen asked 11 months ago
  • last active 10 months ago
0 votes
12k views

I am binding my chart to an ObservableCollection that consists of many XYDataSeries. When I create and add the XyDataSeries, I set the SeriesName and Stroke properties. The data shows on the chart. I have the following Legend Template:

    <DataTemplate x:Key="LegendItemTemplate" DataType="s:SeriesInfo">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <CheckBox Grid.Column="0" 
                      Margin="5,0"
                      HorizontalAlignment="Left"
                      VerticalAlignment="Center"        
                      Foreground="{StaticResource BlackBrush}"
                      Content="{Binding SeriesName}"
                      IsChecked="{Binding RenderableSeries.IsVisible, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                      Visibility="{Binding LegendData.ShowVisibilityCheckboxes, RelativeSource={RelativeSource AncestorType=s:SciChartLegend}, Converter={StaticResource VisibleWhenTrueConverter}}" />


            <xctk:ColorPicker Grid.Column="2"  x:Name="cpPalette" 
                              ColorMode="ColorPalette" VerticalAlignment="Center"
                              SelectedColor="{Binding RenderableSeries.Stroke, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Height="25" Width="40" />

        </Grid>
    </DataTemplate>

However, when I change the colour using the Colorpicker, my charts series are not updated (ie, changing colour)

0 votes
10k views

I successfully set my x-axis visible range between 0.0 and 5.0. I would like to have major grid lines every 1.0. How can I do this? I see a MajorDelta property which I set to 1.0. This did not work. Instead, the major grid lines are every 0.5 on the x axis.

0 votes
0 answers
6k views

Hi,

I’m trying to enable the use of multiple VerticalLineAnnotations and show the corresponding SeriesInfo in an extra legend to the user. Utilizing the RolloverModifier Tooltips example, this works quite easily for the position and values of the VerticalLineAnnotations. However, I would like to show differences (X and Y) between the values of two VerticalLineAnnotations in the same manner.

My approach was to subclass ChartDataObject and add an ObservableCollection of a custom class (SeriesDifferenceInfo) providing properties, which exhibit DeltaX and DeltaY for binding in the surface. For keeping this collection up to date when adding or removing a VerticalLineAnnotation, I registered for the CollectionChanged event of SeriesInfo in my subclassed ChartDataObject and wanted to update the Collection of SeriesDifferenceInfo subsequently. But somehow this event appears not to be triggered on a change in the list of SeriesInfo. Am I doing something wrong or is this intended behaviour? Of course, I could simply call a method UpdateDifferenceCollection(), when adding/removing a VerticalLineAnnotation, but is this really neccessary?

Also, the next problem is triggering PropertyChanged for the DeltaX and DeltaY values when the values of one SeriesInfo changed. I guess this could be done by listening to e.g. a drag event of VerticalLineAnnotation, but is there a more straightforward way to do this?

Best regards
Phil

0 votes
6k views

Dear all,

I was wondering what is the chart recommand use for optimal performance on the following scenario :

  • What is the max number of point a chart can accept in a sceries of data ( my customer have nearly 10000 points to be display)
  • what is the max number of chart instance that can be visible at same time ? ( for instance user would like to see more that one chart on one screen

Thanks for those information

regards

  • sc sc asked 6 years ago
  • last active 6 years ago
0 votes
4k views

Kind regards, I need to build an application in C # for an Intel RealSense D415, I must capture the image of a person’s back to be able to view it in 3D, SciChart WPF SDK can be the solution to help me make this application? Thanks for the reply

0 votes
9k views

I saw an obj file appear on the chart through SceneObject But I want to use custom polygon as a point marker for my ScatterRenderableSeries. Can you apply obj file to PointMarker3D? Or How do I add 3d polygon to chart via obj file in viewmodel?

0 votes
7k views

Hello,

I want to implement a custom deltaX cursor in my software. It consists in two vertical lines that can be moved be the user and the idea to get the delta x (DateTime) between the two lines.
I’ve started to implement it by using two custom VerticalLineAnnotation added to a VerticalSliceManager. As my chart is a real time chart, I don’t want my cursors postions changed exepct on user interaction, that’s why I set to Relative the CoordinateMode property of my two Annotations.
The display and the interaction works fine, but when I try to retrieve the actual position of one cursor to compute the delta I have some trouble to convert the relative position to a DateTime value.
I have override the OnDragDelta() method, the relative value of X1 is correct but when I try to convert it into a DateTime by using FromRelativeCoordinate, I still have Date in 1899. I also try to interpret this as OA Date but I still have wrong date.

Do you have an idea ?
Thanks

 public override void OnDragDelta()
    {
        if (_sciChartSurface.XAxis != null)
        {
            double dataValue = (double)this.FromRelativeCoordinate((double)this.X1, _sciChartSurface.XAxis);
            DateTime classic = new DateTime((long)dataValue);
            DateTime fromOa = DateTime.FromOADate(dataValue);
            Debug.WriteLine("CLASSIC "+ classic);
            Debug.WriteLine("OA "+ fromOa);
        }
    }
0 votes
11k views

Hi,
I have a multichart MVVM Light based application with each chart having its own view model. In particulat I have an XYScatter chart with multiple series, each coloured differently. I need to select a point in one of the series with the left mouse button such that all that series points change and the index of the selected series is available in my view model. Simultaneously I need to have the groupRubberBandZoomModifier, groupXAxisDragModifier & groupYAxisDragModifier enabled.

I’ve found a couple of ways of doing this, overriding a modifier or EventToCommand directly on the mouse events and re-drawing the appropriate series, but I either don’t get the interrupt or the groupRubberBandZoomModifier doesn’t work and I can’t figure out what is happening.

Please could you elaborate on how the interrupts are handled in this situation.

Many Thanks
Dai

  • Dai asked 11 years ago
0 votes
6k views

Hi,
Is it possible to assign different y-axis ids on points of a single data series?

0 votes
11k views

Hello,

I’m working on an analysis software that uses Scichart API for generating graphics in WPF.

I recently used Scichart IOS / Android apps and I really liked the graphics animations.

However, I did not find the way to do the same thing in WPF.

Is it possible to animate the loading of graphics or any other animation?

Thank you.

0 votes
0 answers
11k views

Hi Andrew, Support Guys,

I have a little question.
In my chart i have a chart series XyScatterRenderableSeries DateTime, float which is working fine, on it i have placed the standard tooltip :

……

where i am showing SeriesName, YValue, XValue.

The question is: in my Dataseries i would like to add to every datapoint additional info like IDNum, Value , etc. and then be able to show this additional info when using the tootip on that point in the chart toghether with the ones already shown.

Which could be the correct approch to achieve this?

Another question…..
I am looking also on the multiple X-Axes example where you are placing top and bottom Axis.
My problem is that in my Dataseries i have two DateTime values for one point , i.e if i have a value 1.1/1-feb-2014/StartTime(0) then sencond point will have value 1.2/1-Feb-2014+1hour/StartTime(0)+1hour…. and so on. The goal is to show theese two different datetime XAsis for the same points.How can this be done ?
Is it also possible to have theese two different X-Axes both on the bottom of the chart.

Many Thanks

Cheers
Giuseppe

  • jp13 asked 10 years ago
0 votes
6k views

Hi,

I see one can set an optional PointMarker in FastErrorBarsRenderableSeries. I thought doing so would cause the markers to be drawn at the data points. But this isn’t happening. And in the ErrorBars demo code, you define a separate XyScatterRenderableSeries to draw the data points.

What’s the preferred way? Obviously I can use both an XyScatterRenderableSeries and a FastErrorBarsRenderableSeries, but I’d rather just have one if it can draw both.

Thanks,
–George

  • yefchak asked 8 years ago
  • last active 8 years ago
0 votes
6k views

Hello. On my 3D chart, I set VisibleRange for the X and Z axes. My DataSeries contains more points than just those within the VisibleRange, but I don’t expect to see points outside VisibleRange (see the example image below).

Update:

To reproduce this effect I added this line to the CreateAScatter3DChart constructor in the SimpleScatterChart3D example:

SciChart.XAxis.VisibleRange = new DoubleRange(0, 5);

All the points in the data series appear, even those outside VisibleRange. How do I get the chart to clip the points so that only the points within VisibleRange are visible?

0 votes
10k views

XAxis Labels

I want to have a label on the x axis for each custom annotations. Is this possible. if so how do i do that.

Thanks

0 votes
0 answers
3k views

Hi

I need to create complicated candle stick, beside OHLC, I need to put point market inside candle to mark mean and 50% percentile, each with an individual point marker, is it possible to achieve this?

Thanks.

Sally

0 votes
15k views

Hi,

Can someone let me know if Scichart is fast when it comes to rendering say 1000’s/10000’s line series on a single chart. I know its very fast for a series with lots of points, however I would be creating lots of series with < 500 points each up to 10k series on a chart. I could possibly limit it to 1000 series by sampling the data. This would be fastline series.

0 votes
11k views

Hello,

I’m using v3.2 SciChart and cannot figure with this problem:

    <SciChart:SciChartSurface x:Name="sciChart">
        <!--  Create X Axis  -->
        <SciChart:SciChartSurface.XAxis>
            <SciChart:NumericAxis   AxisTitle="{Binding XAxisLabel}"   VisibleRange="-20, 50"/>
        </SciChart:SciChartSurface.XAxis>
        [...]
    <SciChart:SciChartSurface/>

It seems that negative values are not displayed correctly, it’s showing these data:
-2 -1 0 10 20 30 40 50

If I set textFormatting to “#.0”, it shows
-20, -10, ,0 10,0 20,0 30,0 40,0 50,0

It’s like negative sign is considerate as a digit.

0 votes
12k views

Hello, guys and gals. So I’m attempting to provide two pieces of information with a single plotted series. In this scenario it is important that we display the Signal-to-Noise ratio of our data along with the data itself. Now, this can create quite a cluttered chart. So the hopeful alternative is to vary the color in some way as the SNR varies. So the overall question is this: Can a single series have a localized variation in color?

0 votes
2k views

I’m trying to create a chart with a single FastLineRenderableSeries, that will have one Y axis, and two X axes.
The first X axis will be a simple NumericAxis, but I want the second X axis to show a string value plotted for each point in the series.

For example, if I have a line series with 3 points
[x:0, y:10]
[x:10, y:20]
[x:20, y:10]

I want the first X axis to show a simple 0-20 range, but I want the second X axis to have “Point1” at x=0, “Point2” at x=10 and “Point3” at x=20.

I have tried with AxisMarkerAnnotation, but this appears to always rotate the text vertically (I need the text horizontal like on a normal Axis)

The second problem is that when you zoom out, the axes go out of sync? I have tried to resolved this using

 private void XNumericAxis_VisibleRangeChanged(object sender, Charting.Visuals.Events.VisibleRangeChangedEventArgs e)
    {
        XNameAxis.VisibleRange = XNumericAxis.VisibleRange;
        XNameAxis.GrowBy = XNumericAxis.GrowBy;
        XNameAxis.MajorDelta = XNumericAxis.MajorDelta;
    }

but it still goes out of sync (see attached images).

Full code :

 <s:SciChartSurface x:Name="sciChart"
                   GridLinesPanelStyle="{StaticResource GridLinesPanelStyle}"
                   Style="{StaticResource SciChartSurfaceStyle}">

    <s:SciChartSurface.RenderableSeries>
        <s:FastLineRenderableSeries x:Name="lineSeries"
                                    Stroke="Plum"
                                    StrokeThickness="3">
            <s:FastLineRenderableSeries.SeriesAnimation>
                <s:FadeAnimation AnimationDelay="0:0:0.2"
                                 Duration="0:0:1" />
            </s:FastLineRenderableSeries.SeriesAnimation>
        </s:FastLineRenderableSeries>
    </s:SciChartSurface.RenderableSeries>

    <s:SciChartSurface.XAxes>
        <s:NumericAxis Style="{StaticResource XAxisStyle}"
                       AxisBandsProvider="{Binding XAxisBands}"
                       VisibleRangeChanged="XNumericAxis_VisibleRangeChanged"
                       x:Name="XNumericAxis" />
        <s:NumericAxis Style="{StaticResource XAxisStyle}"
                       LabelProvider="{Binding XAxisLabels}"
                       AutoRange="Never"
                       x:Name="XNameAxis"
                       Id="NameAxis" />
    </s:SciChartSurface.XAxes>

    <s:SciChartSurface.YAxes>
        <s:NumericAxis Style="{StaticResource YAxisStyle}"
                       AxisAlignment="Left" />
    </s:SciChartSurface.YAxes>
    <s:SciChartSurface.ChartModifier>
        <s:ModifierGroup>
            <s:ZoomPanModifier />
            <s:ZoomExtentsModifier />
            <s:MouseWheelZoomModifier />
        </s:ModifierGroup>
    </s:SciChartSurface.ChartModifier>

    <s:SciChartSurface.Annotations>

        <s:AxisMarkerAnnotation X1="0"
                                XAxisId="NameAxis"
                                AnnotationCanvas="XAxis">
            <s:AxisMarkerAnnotation.PointerTemplate>
                <DataTemplate  DataType="{x:Type s:AxisInfo}">

                </DataTemplate>
            </s:AxisMarkerAnnotation.PointerTemplate>
            <s:AxisMarkerAnnotation.LabelTemplate>
                <DataTemplate  DataType="{x:Type s:AxisInfo}">
                    <TextBlock Text="Point 1"
                               Foreground="Black"
                               FontWeight="Normal" />
                </DataTemplate>
            </s:AxisMarkerAnnotation.LabelTemplate>
        </s:AxisMarkerAnnotation>

        <s:AxisMarkerAnnotation X1="10"
                                XAxisId="NameAxis"
                                AnnotationCanvas="XAxis">
            <s:AxisMarkerAnnotation.PointerTemplate>
                <DataTemplate  DataType="{x:Type s:AxisInfo}">

                </DataTemplate>
            </s:AxisMarkerAnnotation.PointerTemplate>
            <s:AxisMarkerAnnotation.LabelTemplate>
                <DataTemplate  DataType="{x:Type s:AxisInfo}">
                    <TextBlock Text="Point 2" />
                </DataTemplate>
            </s:AxisMarkerAnnotation.LabelTemplate>
        </s:AxisMarkerAnnotation>

        <s:AxisMarkerAnnotation X1="20"
                                XAxisId="NameAxis"
                                AnnotationCanvas="XAxis">
            <s:AxisMarkerAnnotation.PointerTemplate>
                <DataTemplate  DataType="{x:Type s:AxisInfo}">

                </DataTemplate>
            </s:AxisMarkerAnnotation.PointerTemplate>
            <s:AxisMarkerAnnotation.LabelTemplate>
                <DataTemplate  DataType="{x:Type s:AxisInfo}">
                    <TextBlock Text="P3" />
                </DataTemplate>
            </s:AxisMarkerAnnotation.LabelTemplate>
        </s:AxisMarkerAnnotation>

    </s:SciChartSurface.Annotations>
</s:SciChartSurface>
  • forl forl asked 11 months ago
  • last active 11 months ago
0 votes
12k views

Hello,

I am dynamically creating axes/series in my ViewModel, and binding to them in my view. I have this working for the most part, except for this issue:
I can’t find a way to access the chart’s ZoomExtentsCommand. I’ve tried binding to it using TwoWay and OneWayToSource modes, but since I presume there is no change to this command to trigger the binding, it is not being set in my ViewModel. Alternatively, is there a way to set a chart to automatically ZoomExtents when a series has new data appended?

Any assistance with it would be greatly appreciated. Let me know if you need any more information. Here is my chart code:
<s:SciChartSurface x:Name="_plot" s:ThemeManager.Theme="ExpressionLight"
YAxes="{Binding YAxisCollection}"
RenderableSeries="{Binding Series}"
SeriesSource="{Binding XySeries}">
<s:SciChartSurface.XAxis>
<s:DateTimeAxis AutoRange="Once" DrawMinorGridLines="False" DrawMinorTicks="False" TextFormatting="yyyy-MM-dd HH:mm:ss"
AxisTitle="Time"/>
</s:SciChartSurface.XAxis>
</s:SciChartSurface>
And the stack trace for the NullReferenceException:
at Abt.Controls.SciChart.ChartModifiers.ApiElementBase.OnYAxesDrasticallyChanged(Object sender, EventArgs e)
at Abt.Controls.SciChart.ChartModifiers.ApiElementBase.SubscribeAxesCollectionChangedNotification()
at Abt.Controls.SciChart.ChartModifiers.ChartModifierBase.set_ParentSurface(ISciChartSurface value)
at Abt.Controls.SciChart.Visuals.SciChartSurface.c17a2aebd4e4e950c58f08eecb7345e25(IChartModifier cb3ae4876489792efaa30435741196ca4)
at Abt.Controls.SciChart.Visuals.SciChartSurface.OnChartModifierChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
at System.Windows.Baml2006.WpfMemberInvoker.SetValue(Object instance, Object value)
at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(XamlMember member, Object obj, Object value)
at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value)
at MS.Internal.Xaml.Runtime.PartialTrustTolerantRuntime.SetValue(Object obj, XamlMember property, Object value)
at System.Xaml.XamlObjectWriter.Logic_ApplyPropertyValue(ObjectWriterContext ctx, XamlMember prop, Object value, Boolean onParent)
at System.Xaml.XamlObjectWriter.Logic_DoAssignmentToParentProperty(ObjectWriterContext ctx)
at System.Xaml.XamlObjectWriter.Logic_CheckAssignmentToParentStart(ObjectWriterContext ctx)
at System.Xaml.XamlObjectWriter.Logic_CreateAndAssignToParentStart(ObjectWriterContext ctx)
at System.Xaml.XamlObjectWriter.WriteStartMember(XamlMember property)
at System.Xaml.XamlWriter.WriteNode(XamlReader reader)
at System.Windows.Markup.WpfXamlLoader.TransformNodes(XamlReader xamlReader, XamlObjectWriter xamlWriter, Boolean onlyLoadOneNode, Boolean skipJournaledProperties, Boolean shouldPassLineNumberInfo, IXamlLineInfo xamlLineInfo, IXamlLineInfoConsumer xamlLineInfoConsumer, XamlContextStack`1 stack, IStyleConnector styleConnector)
at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
at [MyControl].InitializeComponent()
 

 

 

0 votes
10k views

Hi

From the post that I have been reading it shall be possible to use virtualized dataplots, where data is fetched on demand. I also undertand that you have plans to integrate this functionality tighter with your API.

My questions:
* do you have an example of a virutalized dataplot?
* if, and then when will you have more tightly integrated support for virtualzied dataseries?

1 vote
14k views

In RubberBandXyZoomModifier it is possible to zoom only in X axis direction by setting IsXAxisOnly property. Is there way to zoom only in Y axis direction? Unfortunately there is no such property like IsYAxisOnly..

  • anth asked 11 years ago
  • last active 8 years ago
0 votes
12k views

Hi folks,

What’s the recommended practice for returning values from hit testing back to my viewmodel? I’m calling HitTest() from a mouse click handler in my view codebehind, but I’d like to deal with the results in the viewmodel.

Thanks,
–George

  • yefchak asked 11 years ago
  • last active 5 years ago
0 votes
9k views

I have a chart that has real-time data being added to it and I want to ensure the chart sizes up to show everything. This chart also displays series that have already been added and I would like to zoom in/out on those. How would I handle both of these at the same time?

1 vote
0 answers
6k views

Is it possible to add color gradients to part of the mesh on an ObjectModel3D? We would love to use SciChart exclusively for our charts because they are easy to work with and almost all of the other charts in our software are SciChart charts.

Currently, we use LightningCharts for our 3D heads and the have a method call UpdateFill which applies a color gradient to part of the mesh. This shading is done using the geometry data generated from LightningCharts after the head is rendered. I didn’t see a similar method in SciChart but I don’t know that it is necessary because the geometry will be the same ever time the chart is rendered so we can just use the data generated from LightningCharts.

I’ve included a screenshot showing what I’ve been able to create with SciChart and a screenshot showing what the chart looks like currently with LightningCharts. The brain is a .obj file (along with the scalp and face but those are separate and don’t require any shading). The sensor locations (Fp1, Fp2, O1, and O2) are added using the ScatterRenderableSeries3D (I haven’t added annotations for the locations yet).

SciChart

LightningCharts

0 votes
11k views

Hi,
Is it possible to show contour of bars in ColumnRenderableSeries3D?
Is there way to do this?

ColumnRenderableSeries3D has a Stroke property, but does not appear to have any effect on setting this property.

best regards
Silvester

0 votes
10k views

I’m not clear how you set up FIFO with the SciStockChart class and mvvm; docs are a little weak; all the examples seem to use datasets rather than ChartSeriesViewModel. Do I simply set the fifocapacity? Do I need to set it at instantiation? Do all the ChartSeriesViewModels in a collection need to have the same Fifocapacity? Can I change the fifocapacity at runtime; and if so how would I change the capacity of all of the ChartSeriesViewModels (assuming they must all be the same) in a collection?

thanks in advance.

0 votes
6k views

I want to create a chart like the attached image file.
I want to mark points with different colors depending on the number of data corresponding to the x and y axes.
As a result of searching, there is a HeatmapColorPalette. Is it good to use this?
If there is a more suitable chart, please introduce it.
thank you

Showing 51 - 100 of 3k results