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

0 votes
34 views

When I enter PathAnnotation in the xaml, I get the error “The type ‘s:PathAnnotation’ was not found.” I do have the following Annotation types available:
– AxisMarkerAnnotation
– BoxAnnotation
– CustomAnnotation
– HorizontalLineAnnotation
– LineAnnotation
– LineArrowAnnotation
– SeriesValueAxisMarkerAnnotation
– TextAnnotation
– VerticalLineAnnotation

I want to be able to make a star shape annotation, and PathAnnotation seemed to be the only way to do this. Please let me know if there’s another way to do this.

Thanks,
Rachel

0 votes
0 answers
23 views

Using MVVM I am trying to force my 2nd Y axis to a specific min and max value. I’m setting the AutoRange to never and the VisibleRange to a DoubleRange(min, max) in my ViewModel in a function named ‘SetAxes(min, max)’.

The behavior seems to be that it works the first time I add a measurement to my chart. On subsequent updates to the chart (when I tell the chart via a method in my model to change it’s axes) it doesn’t update. Here is what I have…

        public void SetAxes(double min, double max)
        {
            RightAxisAutoRange = AutoRange.Never;
            RightAxisVisibleRange = new DoubleRange(min, max);
        }

        // 2nd axis range
        private IRange _rightAxisVisibleRange;
        private AutoRange _rightAxisAutoRange;
        public IRange RightAxisVisibleRange 
        { 
            get { return _rightAxisVisibleRange; }  
            set { SetProperty(ref _rightAxisVisibleRange, value); } 
        }
        public AutoRange RightAxisAutoRange  
        { 
           get { return _rightAxisAutoRange; } 
           set { SetProperty(ref _rightAxisAutoRange, value); } 
       }

       <!-- 2nd Y Axis -->
            <s:NumericAxis AxisTitle="{Binding Path=RightAxisTitle}" 
                           Id="YAxis2"
                           AxisAlignment="Right"
                           Visibility="{Binding Path=RightAxisVisibility}"                               
                           FontFamily="Arial"
                           VisibleRange="{Binding Path=RightAxisVisibleRange}"  
                           AutoRange="{Binding Path=RightAxisAutoRange}"
                           GrowBy="0.1, 0.1" 
                           Style="{DynamicResource ResourceKey=RatioAxisStyle}"
                           s:CursorModifier.AxisLabelContainerStyle="{StaticResource CursorModAxisLabelStyle}"
                           s:CursorModifier.AxisLabelTemplate="{StaticResource CursorModAxisLabelTemplate}" />

Don’t get hung up on the “SetProperty” function in my setters. That’s just an internal mechanism I use in a base class which implements INotifyPropertyChanged.

What I’ve noticed is that the moment I decide to zoom the right Y axis refuses to ever go back to it’s original range. I suppose a way to turn off 2nd Y axis zooming would resolve my problem?

0 votes
29 views

Hello,

how can i implement a vertically stacked y axis chart like in your example (WPF Chart Vertically Stacked YAxis) with MVVM and a varying number of y axes. Your example has a fixed number of y axes and the needed YAxesPanel is directly implemented in your xaml code. What is the best way to achieve the same result with a varying number of y axis?

Best regards
Alexander

0 votes
31 views

Dear SciChart Team:

My application interface is shown in the attached file. There are four Y-axis and one X-axis. One curve corresponds to one Y-axis. I use the dragging of two HorizontalLineAnnotations and Y1 subtraction to calculate Diminish, but this can only get HorizontalLineAnnotation. Dominish with the Y axis specifying YAxisId, if I want to get Diminish for all Y axes at once, what is the recommended method?

0 votes
0 answers
19 views

To avoid arrays in LOH the UniformHeatmapDataSeries should use IList[] or Span instead of TZ[,].

0 votes
0 answers
21 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
0 answers
15 views

I need to synchronize the charts with external data. I’m using RenderSurface.ActualWidth and RenderSurface.ActualHeight to do it. But initial values (after chart creation) are larger than real. It becomes correct only after the window resizing. This behaviour is demonstrated in the attached project and video files.

Is it possible to make it right from the start or make a force resize?

0 votes
24 views

Hi,

I’m trying to write an app which dynamically hides/shows (Visible/Gone) scichart surface without losing the data rendering. I’ve been trying to drive this via android visiblity and observable fields (MVVM design). An example of how our surfaces look is as follows:

<com.scichart.charting.visuals.SciChartSurface
android:id=”@+id/temperature_chart”
android:layout_width=”match_parent”
android:layout_height=”0dp”
android:layout_weight=”.99″
android:visibility=”@{graphViewModel.displayChartTemp ? View.VISIBLE : View.GONE}”
android:paddingTop=”@dimen/potrero_gap”
android:paddingBottom=”@dimen/potrero_gap”
scichart:verticalGroup=”@{graphViewModel.sharedVG}”
scichart:renderableSeries=”@{graphViewModel.tempRenderableSeries}”
scichart:xAxes=”@{graphViewModel.xTempAxes}”
scichart:yAxes=”@{graphViewModel.yTempAxes}”/>

and in the view model:

declaration:
var displayChartTemp = ObservableBoolean()

and to set the visibility….
displayChartTemp.set(true)
displayChartTemp.set(false)

I saw that historically, one solution was to
rsiChart.setRenderSurface(null);
rsiChart.setRenderSurface(new RenderSurfaceGL(getActivity()));

but I was wondering if there would be a good way to do this with MVVM architecture, and drive it similarly with observables?

Thanks,
-Andy

0 votes
20 views

Hi

I’m using SciChart to display digital signals, which by nature are 0 or 1.
I’m binding all data and axes from a viewmodel, following the example “WPF Chart Vertically Stacked YAxis” I tried to achive the same wiht a dynamic grid as AxesTemplate.

[...] RightAxesPanelTemplate="{DynamicResource BinaryYAxesTemplate}" [...]


    <ItemsPanelTemplate x:Key="BinaryYAxesTemplate">
        <Grid vmh:DynamicGridBuilder.RowCount="{Binding YAxesGridRows}" vmh:DynamicGridBuilder.StarRows="{Binding YAxesGridStarRows}" vmh:DynamicGridBuilder.ColumnCount="1" />
    </ItemsPanelTemplate>

Can you supply an example how stacked YAxes can be achieved?

Cheers

Martin

0 votes
0 answers
23 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
26 views

Hello there,

I’m trying to implement adding line annotation on touch, but this causes crash.

I’m watching example android app in fragment CreateAnnotationsDynamicallyFragment.

I guess, it should be very easy, but example uses data binding and part of code is hidden somewhere + source code is obfuscated, so it’s hard for me to understand what is wrong.

Can someone give a short example of how to add annotation on touch?

Thanks

Exception:

 Process: process_name, PID: 24978
java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.Comparable com.scichart.charting.visuals.axes.IAxis.getDataValue(float)' on a null object reference
    at com.scichart.charting.modifiers.AnnotationCreationModifier.a(SourceFile:203)
    at com.scichart.charting.modifiers.AnnotationCreationModifier.onTouchDown(SourceFile:155)
0 votes
30 views

I need to export a load of images from one graph. Export from the View is very long. So, I’ve implemented the export in memory like in this example:
https://support.scichart.com/index.php?/Knowledgebase/Article/View/17213/34/rendering-chart-to-bitmap-in-memory

Export is fast and flexible. One of my axes has a custom label provider, but I see a default axis labels after export. Export from View gives correct label values. Here is the code of the label provider:

public class MyCustomLabelProvider: NumericLabelProvider
{

    public override string FormatLabel(IComparable dataValue)
    {
        return string.Format("{0:" + this.ParentAxis.TextFormatting + "}", 1 / (double)dataValue);
    }

    public override string FormatCursorLabel(IComparable dataValue)
    {
        return string.Format("{0:" + this.ParentAxis.TextFormatting + "}", 1 / (double)dataValue);
    }
}

And a code of export:

    var sciChartSurface = new SciChartSurface();
    ThemeManager.SetTheme(sciChartSurface, "BrightSpark");
    sciChartSurface.YAxes = new AxisCollection()
    {
        new NumericAxis()
        {
            AxisAlignment = AxisAlignment.Left,
            VisibleRangeLimitMode = RangeClipMode.MinMax,
            LabelProvider = new MyCustomLabelProvider(),
            DrawMajorGridLines = false,
            DrawMinorGridLines = false,
            DrawMajorBands = false,
        }
    };
    sciChartSurface.XAxes = new AxisCollection()
    {
        new NumericAxis()
        {
            AxisAlignment = AxisAlignment.Bottom,
            LabelProvider = new CurvatureLabelProvider(),
            VisibleRangeLimitMode = RangeClipMode.MinMax,
            DrawMajorGridLines = false,
            DrawMinorGridLines = false,
            DrawMajorBands = false
        }
    };

    sciChartSurface.RenderableSeries = new ObservableCollection<IRenderableSeries>()
    {
        new FastLineRenderableSeries() { DataSeries = lineSeries, Stroke = Colors.Green }
    };

    ...

    sciChartSurface.XAxes.FirstOrDefault().VisibleRange = new DoubleRange(0, 100);
    sciChartSurface.ExportToFile(Path.Combine(folderPath, $"Object.png"), ExportType.Png, false, new Size(1500, 750));

Any suggestions?

0 votes
0 answers
25 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 days ago
  • last active 5 days ago
0 votes
0 answers
17 views

Hey again!

Is there kind of a delegate that notify me if the user uses the crosshair/SCIRolloverModifier?
I want to know which value he is inspecting to show him further information outside the chart for this datapoint.

Thanks and Greeting
Benedikt

0 votes
20 views

https://www.dropbox.com/s/6f20scl1nyug1t7/chart_3.png?dl=0

Please see the link image. Can we have multiple y axis and one x-axis on android Line charts.. any example link will be useful and ready to purchase if supports these type of charts in Android

  • soujanya asked 6 days ago
  • last active 5 days ago
0 votes
38 views

I need to update a lot of annotations. Not so much. Remove and add about 10-100 annotations per action. And it takes a lot of time. I’ve already tried all the recommendations with SusppendUpdates etc, but the result is the same.

I don’t need the flexibility of UIElements. I’m using it as markers only.

So, maybe it is possible to implement annotations as a series with a custom point marker. I need a vertical dashed line with text, like in screenshot. Is there a way to do it?

0 votes
28 views

I am trying to use date and time for X axis however

it doesn’t not work for me and I am not understanding what I did wrong

attaching the xaml and cs code:

cs:

public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();

    }

    private void sciChartSurface_Loaded(object sender, RoutedEventArgs e)
    {
        //var scatterData = new XyDataSeries<double, double>();
        var lineData = new XyDataSeries<DateTime, double>();
        //var lineData = new XyDataSeries<double, double>();

        DateTime dt = DateTime.Now;
        for (int i = 0; i < 10; i++)
        {
            dt.AddDays(1);
            lineData.Append(dt, i);



        }

        // Assign dataseries to RenderSeries
        LineSeries.DataSeries = lineData;
        lineData.SeriesName = "Barak";
        /*
         ScatterSeries.DataSeries = scatterData;
         scatterData.SeriesName = "Barak2";
         */

        //ScatterSeries.DataSeries = scatterData;
    }
}

xaml:

        <s:SciChartSurface.RenderableSeries>
            <s:FastMountainRenderableSeries x:Name="LineSeries" Stroke="#FF4083B7"/>
            <s:XyScatterRenderableSeries x:Name="ScatterSeries" >
                <s:XyScatterRenderableSeries.PointMarker>
                    <s:EllipsePointMarker Width="7" Height="7" Fill="#FFF" Stroke="SteelBlue"/>
                </s:XyScatterRenderableSeries.PointMarker>
            </s:XyScatterRenderableSeries>
        </s:SciChartSurface.RenderableSeries>

        <s:SciChartSurface.XAxes>
            <s:NumericAxis AxisTitle="Number of sampeles"></s:NumericAxis>
        </s:SciChartSurface.XAxes>

        <s:SciChartSurface.YAxis>
            <s:NumericAxis AxisTitle="Values"></s:NumericAxis>
        </s:SciChartSurface.YAxis>

        <s:SciChartSurface.Annotations>
            <s:TextAnnotation Text="Hello world!" X1="5.0" Y1="5.0"/>
        </s:SciChartSurface.Annotations>


        <s:SciChartSurface.ChartModifier>
            <s:ModifierGroup>
                <!-- Allow drag to zoom on Left mouse -->
                <s:RubberBandXyZoomModifier ExecuteOn="MouseLeftButton"
                                             RubberBandFill="#33FFFFFF" RubberBandStroke="#AAFFFFFF"
                                             RubberBandStrokeDashArray="2 2"/>
                <!-- Allow pan on Right mouse drag -->
                <s:ZoomPanModifier ExecuteOn="MouseRightButton" ClipModeX="None" />
                <!-- Allow Dragging YAxis to Scale -->
                <s:YAxisDragModifier DragMode="Scale"/>
                <!-- Allow Dragging XAxis to Pan -->
                <s:XAxisDragModifier DragMode="Pan"/>
                <!-- Allow Mousewheel Zoom -->
                <s:MouseWheelZoomModifier/>
                <!-- Allow Zoom to Extents on double click -->
                <s:ZoomExtentsModifier ExecuteOn="MouseDoubleClick" />
                <s:LegendModifier ShowLegend="True" Orientation="Horizontal"
                                   VerticalAlignment="Bottom"                                     
                                   HorizontalAlignment="Center"
                                   LegendPlacement="Inside" />
                <!-- Add a RolloverModifier to the chart (shows vertical line tooltips -->
                <s:RolloverModifier ExecuteOn="MouseMove" ShowTooltipOn="MouseHover"/>

            </s:ModifierGroup>


        </s:SciChartSurface.ChartModifier>

    </s:SciChartSurface>


</Grid>

0 votes
0 answers
38 views

Undo/Redo behavior is abnormal.
It didn’t go back to the previous step.

0 votes
55 views

Hi all,

I’m trying to use the metal support in a little test project.
I have following lines to enable metal:

if SCIChartSurface.isMetalSupported {
      sciChartSurface.renderSurface = SCIMetalRenderSurface(frame: sciChartSurface.bounds)
 } else {
       sciChartSurface.renderSurface = SCIOpenGLRenderSurface(frame: sciChartSurface.bounds)
 }

the surface keeps empty until I remove the

sciChartSurface.renderSurface = SCIMetalRenderSurface(frame: sciChartSurface.bounds)

line – or in other words I use OpenGL.
Then the chart will render properly. I am using an iPhoneX (not simulator).

Thank you for your support!

Wall of Code:

import UIKit
import SciChart
import SnapKit

class ViewController: UIViewController {

    // MARK: - UIElements
    private var sciChartSurface: SCIChartSurface!

    // MARK: - Vars
    private var series: SCIXyDataSeries?

    // MARK: - Lifecycle
    override func viewDidLoad() {
        super.viewDidLoad()
        setupSurface()
        setupData()
        renderData()
    }

       // MARK: - Chart
     private func setupSurface() {
        // Create a SCIChartSurface. This is a UIView so can be added directly to the UI
        sciChartSurface = SCIChartSurface.init(frame: view.bounds)
        sciChartSurface.debugWhySciChartDoesntRender = true
        view.addSubview(sciChartSurface)

        // Detect metal with this static property
        if SCIChartSurface.isMetalSupported {
            sciChartSurface.renderSurface = SCIMetalRenderSurface(frame: sciChartSurface.bounds)
        } else {
            sciChartSurface.renderSurface = SCIOpenGLRenderSurface(frame: sciChartSurface.bounds)
        }
        sciChartSurface.snp.makeConstraints { (make) in
            make.edges.equalToSuperview()
        }

        sciChartSurface.translatesAutoresizingMaskIntoConstraints = true
        sciChartSurface.backgroundColor = .gray
        // Create an XAxis and YAxis. This step is mandatory before creating series
        let xAxis = SCICategoryNumericAxis()
        setup(axis: xAxis)
        sciChartSurface.xAxes.add(xAxis)
        let yAxis = SCINumericAxis()
        setup(axis: yAxis)
        sciChartSurface.yAxes.add(yAxis)
    }

    private func setup(axis: SCIAxisBase) {
        let axisStyle = SCIAxisStyle()

        let majorPen = SCISolidPenStyle(colorCode: 0xFF393532, withThickness: 0.5)
        let minorPen = SCISolidPenStyle(colorCode: 0xFF262423, withThickness: 0.5)

        let textFormat = SCITextFormattingStyle()
        textFormat.fontSize = 16

        axisStyle.majorTickBrush = majorPen
        axisStyle.majorGridLineBrush = majorPen
        axisStyle.gridBandBrush = SCISolidBrushStyle(colorCode: 0xE1232120)
        axisStyle.minorTickBrush = minorPen
        axisStyle.minorGridLineBrush = minorPen
        axisStyle.labelStyle = textFormat
        axisStyle.drawMinorGridLines = true
        axisStyle.drawMajorBands = true
        axis.style = axisStyle
    }

    private func setupData() {
        series = SCIXyDataSeries(xType: .int16, yType: .int16)
        TestData.testData.forEach { (testData) in
            let xGeneric = SCIGenericType(type: .int16, .init(int32Data: testData.x))
            let yGeneric = SCIGenericType(type: .int16, .init(int32Data: testData.y))
            series?.appendX(xGeneric, y: yGeneric)
        }
    }

    private func renderData() {
        let renderSeries = SCIFastColumnRenderableSeries()
        renderSeries.dataSeries = series
        sciChartSurface.renderableSeries.add(renderSeries)
    }
}



struct TestData {
    var x: Int32
    var y: Int32

    static let testData = [TestData(x: 2017, y: 5),
                           TestData(x: 2018, y: 8),
                           TestData(x: 2019, y: 2),
                           TestData(x: 2020, y: 9)]
}
0 votes
0 answers
51 views

Hi All,

I tried to do android oscilloscope example. But I cannot the line series data. I could see the data xValues, related yValues. and I cannot find any cause. Could you me know what the problem is?

0 votes
57 views

EDIT 3:

I figured out the problem. The reason why I did not see them was two-fold. The annotation view for some reason cannot infere the height of the parent (the chart) so setting match_parent as height doesn’t work and the view doesn’t have height. Second problem was that I have set .withPosition() with Y value as 0, and that would draw the view under the visible area of the chart.

So let me now ask new questions

1 Is there a possibility to move the annotation just by grabbing it, without first selecting it?
2 How can I change the red border when selecting the annotation?
3 How to set the annotation to return X value of it’s position from the center of its view and not from the start of its view
4 How do I restrict movement of the annotation to only X axis?

/// original question
Hello.

I have a problem with annotations. What I need to achieve, is to draw custom view (it’s fairly simple) on my chart, and this view should have always the height of the chart.

I can’t make it work, I am adding the annotation in exact same way as in example android project, and I even copied annotation code from your example project to mine, but for some reason it doesn’t work in my project.

this is the drawable:

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="40dp">
<color android:color="@color/secondary_18"/>
</item>
<item android:gravity="center_horizontal" android:width="4dp">
<color android:color="@color/secondary"/>
</item>
</layer-list>

EDIT: There is no < br > in this code ^

what I already tried:
1. Wrapping the drawable into layout consisting of <ImageView> with src= set to drawable
2. Creating a class extending View() class and then setting the imageResource there
3. inflating my layout first and then putting it inside .withContent()
4. using .withContent() directly with R.layout.some_layout_view
5. using it with .withBackgroundDrawableId()
6. various combinations with setting different widths and heights and .withPosition() and whatever you can think of

I managed to display the CustomAnnotation once (don’t remember with which combination of settings) but it wouldn’t move anyway despite the .withIsEditable(true) and despite it was “selected” (red border around it appeared on click)

my axes:

        val xAxis = sciChartBuilder.newNumericAxis()
        .withAxisId(X_AXIS_ID)
        .withDrawMajorBands(false)
        .withDrawMajorGridLines(false)
        .withDrawLabels(false)
        .withIsCenterAxis(true)
        .withDrawMinorTicks(false)
        .withDrawMinorGridLines(false)
        .withDrawMajorTicks(false)
        .build()

    val yAxis = sciChartBuilder.newNumericAxis()
        .withAutoRangeMode(AutoRange.Always)
        .withAxisId(Y_AXIS_ID)
        .withDrawMajorBands(false)
        .withDrawMajorGridLines(false)
        .withDrawMinorGridLines(false)
        .withDrawLabels(false)
        .withIsCenterAxis(true)
        .withDrawMajorTicks(false)
        .withDrawMinorTicks(false)
        .build()

    chartSurface.xAxes.add(xAxis)
    chartSurface.yAxes.add(yAxis)

my series:

 chartSurface.renderableSeriesAreaFillStyle = SolidBrushStyle(chartBackgroundColor)
    chartSurface.renderableSeriesAreaBorderStyle = SolidPenStyle(0x0, false, 0f, null)

    val mountainSeries = sciChartBuilder.newMountainSeries()
        .withDataSeries(dataSeries)
        .withStrokeStyle(SolidPenStyle(-0x1, true, 0f, null))
        .withAreaFillLinearGradientColors(-0x1, -0xed7422)
        .withXAxisId(X_AXIS_ID)
        .withYAxisId(Y_AXIS_ID)
        .build()

    chartSurface.renderableSeries.add(mountainSeries)

my control modifiers:

   val chartModifiers = sciChartBuilder.newModifierGroup()
        .withPinchZoomModifier()
        .withXyDirection(Direction2D.XDirection)
        .withReceiveHandledEvents(true)
        .withScaleFactor(0.8f)
        .build()
        .withZoomPanModifier()
        .withXyDirection(Direction2D.XDirection)
        .withClipModeX(ClipMode.ClipAtExtents)
        .withZoomExtentsY(true)
        .withReceiveHandledEvents(true)
        .build()
        .withZoomExtentsModifier()
        .withReceiveHandledEvents(true)
        .withXyDirection(Direction2D.XyDirection)
        .build()
        .build()

    chartSurface.chartModifiers.add(chartModifiers)

one example of many of how I tried to add the annotations:

        chartSurface.annotations.add(
        sciChartBuilder.newBoxAnnotation()
            .withContent(CustomView(context))
            .withXAxisId(X_AXIS_ID)
            .withYAxisId(Y_AXIS_ID)
            .withIsEditable(true)
            .build()
    )

ofc I also tried the same with CustomAnnotation and like I said with various other settings I could think of like .withPosition() and withResizingGrip. Curious thing is that VerticalLineAnnotation works with no problems really.

EDIT2:

Alternatively I could go with two VerticalLineAnnotations on top of each other moving together but I would have to be able to move them instantly, without selecting them first, because those circular handles look really bad and I have to disable them.

But later on I need to have box annotation working anyway, there will be X values selecting feature

0 votes
46 views

Hello

is there a way to set the padding (aka reduce the gap) between bars in a SCIFastColumnRenderableSeries?

I attach a screenshot of my current situation: I would like to have zero margin between columns.

I tried searching in the knowledge base but all the answers I found seem to refer to APIs not available in the iOS SDK

.

There is not such class method in the iOS SDK called SciChartSurface.Padding

Thanks for your help

0 votes
55 views

I have a “live” color map control. Range of Z-values always comprehends zero, but is not symmetrical about zero. I would like to show only the tick at zero (and no others), and only the label ‘0’ (no formatting) at that tick. Is there a simple solution?

0 votes
72 views

In WPF, I am trying to allow user to resize a box annotation by holding the mouse on its side edges and dragging the mouse to left or right. By default, the box annotation allows to resize only by its round shaped holders appearing on top corners. Is there any way to allow such functionality?

So far, I have thought of placing two vertical annotations inside the box annotation template exactly on its edges and then sync their X coordinates with that of the box by two way binding. However, it is not an easy way to do it and also it does not work when used together as a single custom annotation or composite annotation.

Please suggest if any property can be tweaked for box annotation to achieve this?

  • Anil Soman asked 3 weeks ago
  • last active 3 weeks ago
0 votes
68 views

Hello
I have animated line renderable series – when new point added, whole x-axes moves to the right a little.

Everything is smooth until pinch zoom appears.
I think it’s conflict with animated viewport move and zooming.

Is there a way to know, when zooming appears?

E.g. if i know, when zoom started and finished – i can solve this.
Thanks

0 votes
70 views

Hello,

i’ve created the following sample application were i tried to use CategoryDateTimeAxisViewModel as x axis:

class MainViewModel : INotifyPropertyChanged
{
    private IAxisViewModel _xAxis;
    private IAxisViewModel _yAxis;

    public event PropertyChangedEventHandler PropertyChanged;

    public IAxisViewModel XAxis
    {
        get { return _xAxis; }
        set
        {
            if (_xAxis != value)
            {
                _xAxis = value;
                OnPropertyChanged();
            }
        }
    }

    public IAxisViewModel YAxis
    {
        get { return _yAxis; }
        set
        {
            if (_yAxis != value)
            {
                _yAxis = value;
                OnPropertyChanged();
            }
        }
    }

    public MainViewModel()
    {
        XAxis = new CategoryDateTimeAxisViewModel
        {
            AxisTitle = "X-Achse",
            Id = "DefaultAxisId",
            AxisAlignment = AxisAlignment.Bottom,
            AutoRange = AutoRange.Always,
            TickProvider = new DateTimeTickProvider()
        };
        YAxis = new NumericAxisViewModel
        {
            AxisTitle = "Y-Achse",
            Id = "DefaultAxisId",
            AxisAlignment = AxisAlignment.Left,
            AutoRange = AutoRange.Always,
            TickProvider = new NumericTickProvider()
        };
    }

    [NotifyPropertyChangedInvocator]
    protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
    {
        PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
    }
}

<Window x:Class="WpfApp1.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:local="clr-namespace:WpfApp1"
    xmlns:s="http://schemas.abtsoftware.co.uk/scichart"
    mc:Ignorable="d"
    Title="MainWindow" Height="450" Width="800">
<Window.DataContext>
    <local:MainViewModel/>
</Window.DataContext>
<DockPanel>
    <s:SciChartSurface DockPanel.Dock="Top"
                       ChartTitle="Testdiagramm"
                       XAxis="{s:AxesBinding XAxis}"
                       YAxis="{s:AxesBinding YAxis}">
    </s:SciChartSurface>
</DockPanel>

When i run the application i can see only the axis titles but no axes, gridlines etc. However when i replace CategoryDateTimeAxisViewModel with DateTimeAxisViewModel everything works fine and looks like expected. What am i doing wrong?

Best regards
Alexander

0 votes
66 views

I have 2 series displayed on my chart. I have placed a VerticalLineAnnotation in VerticalSliceModifie to display rollover marker on a series. By default it gets displayed for each series plotted. How can I set it to be displayed only for one of the series?

I tried to set SeriesData Binding Path to specific series, but it did not work.

<visuals:VerticalSliceModifier Name="SliceModifier" ShowAxisLabels="False"  ShowTooltipOn="Never" SeriesData="{Binding Path=Series[1]}">
       <visuals:VerticalSliceModifier.VerticalLines>
                <visuals:VerticalLineAnnotation X1="45" 
                Y1="80" 
                Stroke="Red"
                StrokeThickness="1"
                IsEditable="True" 
                x:Name="LRed"
                ResizeDirections="XDirection" 
                DragDirections="XDirection"  
                VerticalAlignment="Bottom">
     </visuals:VerticalLineAnnotation>
</visuals:VerticalSliceModifier.VerticalLines>
</visuals:VerticalSliceModifier>
  • Anil Soman asked 3 weeks ago
  • last active 3 weeks ago
0 votes
62 views

We are working on line charts in Xamarin forms. We have a requirement to zoom in only one direction at one time. Once the user is done with zooming in one direction (say horizontal) and he reaches that place through scrolling, he should be able to zoom in another direction(vertical). Can you please assist this for the same

  • george asked 3 weeks ago
  • last active 3 weeks ago
0 votes
55 views

Hello,

I’m tying out some of the SciStockChart WPF features on the trial version and having trouble with limiting the chart area to the assigned data.

You can easily reproduce my problem on the demo app:
1. Open Featured Apps>>Financial Charts>>SciChart Trader Demo app
2. Move the mouse cursor in the middle of the chart
3. Mouse wheel to zoom in really close
4. Zoom Back out you can see the empty space on the right size became larger
5. You can do 3-4 steps again and with every iteration you get more open space.
6.Plus it gets out of sync with the scroll pane below.

How do we limit the view to the assigned data?

BTW, I can get it work by directly using SciChartSurface (I created that test app based on other demo apps).

Would love to learn how to get it working with SciStockChart.

Thanks in advance!

0 votes
62 views

Hello,

How to add buy sell annotation to real time chart(Performance demo chart in examples)

0 votes
93 views

I am Using ECG Chart In Android. How To Make The ECG Moves Automatically in Horizontal.

0 votes
81 views

Hello,

How to add the color picker for the annotations.

Ex: I will need to create the box annotation with specific colour..

1 vote
104 views

Can SciChart be used in UITableviewCell? Is it possible to use Software rendering on iOS?

The OpenGL/Metal charts are great, but I suspect Software rendering would be a better for displaying data in UITableViewCells. There are many mobile apps out there that use charts in tableviews and I’d love to be able to use SciChart here too.

0 votes
100 views

Hi!

I’ve created my own modifier to do this and it was working perfectly in a previous version. It allowed dragging annotations and without events. Now it doesn’t catch events from the pan actions, but caches events from annotation editing.

class CustomPointSelectionModifier : SeriesSelectionModifier
{
    /// <inheritdoc />
    public override void OnModifierMouseUp(ModifierMouseArgs e)
    {
        base.OnModifierMouseUp(e);
        var xcalc = ParentSurface.XAxes.First().GetCurrentCoordinateCalculator();
        var ycalc = ParentSurface.YAxes.First().GetCurrentCoordinateCalculator();

        var poistionPoint = ParentSurface.RootGrid.TranslatePoint(Mouse.GetPosition((IInputElement)ParentSurface), ModifierSurface);
        var point = new Point()
        {
            X = xcalc.GetDataValue(poistionPoint.X),
            Y = ycalc.GetDataValue(poistionPoint.Y),
        };

        ((PlotBaseDescription)DataContext).OnMouseUp(e, point);
    }
}   

It is demonstrated in the attached example

Hot to achive it now?

Thanks.

0 votes
95 views

I have a need to display a group of data sets in one chart, but because the duration of the data sets vary quite a bit I’d like to have a logarithmic time axis. Has anyone done this before? Thanks in advance!

0 votes
116 views

Hello,

i would like to configure my chart that it looks like a oscilloscope. That means that the gridlines are fixed on the display and not running from right to left. The visible range of the chart should also be fixed and should display a predefined range (e.g. 60 Seconds). Only the data should be displayed as usual. How can i achieve this?

I would be very thankful for a short example.

Best regards
Alexander

0 votes
118 views

Hello. How to draw a plane through 3 points on WPF 3D Point Cloud Chart?

0 votes
104 views

Hello,

I’m trying to get a scatter series chart to work but it doesn’t render. For Bar, Impulse, and Line I can use the same code only switching the series type, but when I attempt to do the same with Scatter series (both XyScatter and ExtremeScatter) the points don’t render.

Here is my scatter series code:

// ... 
        for (int i = 0; i < dimensions; i++)
        {
            var scatterSeries = new ExtremeScatterRenderableSeries()
            {
                PointMarker = new EllipsePointMarker() { Width = 7, Height = 7}
            };

            scatterSeries.PaletteProvider = new ExtremeScatterPaletteProvider(colors);

            Binding DataSeriesBinding = new Binding("Data");
            DataSeriesBinding.Source = (_cvm as ChartViewModelXY).ndData.ElementAt(i);
            scatterSeries.SetBinding(BaseRenderableSeries.DataSeriesProperty, DataSeriesBinding);

            Chart.RenderableSeries.Add(scatterSeries);

            permanentLineSeries++;
        }
// ...
public class ExtremeScatterPaletteProvider : IExtremePointMarkerPaletteProvider
{
    private readonly List<Color> _dataPointColors;
    private readonly Values<Color> _colors = new Values<Color>();
    public ExtremeScatterPaletteProvider(List<Color> dataPointColors)
    {
        _dataPointColors = dataPointColors;
    }
    // Fill Colors for each data-point index
    public Values<Color> Colors { get { return _colors; } }
    public void OnBeginSeriesDraw(IRenderableSeries rSeries)
    {
        var indexes = rSeries.CurrentRenderPassData.PointSeries.Indexes;
        var count = indexes.Count;
        _colors.Count = count;
        // copy required colors from list using data point indices
        for (int i = 0; i < count; i++)
        {
            var dataPointIndex = indexes[i];
            _colors[i] = _dataPointColors[dataPointIndex];
        }
    }
}

The same code works with 3 other XY charts, so I’m fairly certain the issue is with how I am creating the ExtremeScatter. Any help or insight would be greatly appreciated!

Edit: For anyone curious / googling a fully instantiated XyScatterRenderableSeries in code looks like this:

   // Render a scatter series
    var scatterSeries = new XyScatterRenderableSeries()
     {
            PointMarker = new EllipsePointMarker() { Width = 7, Height = 7, Stroke = colors[i], Fill = colors[i]}
     };  

That will render the series with the same color for both the border and interior.

  • Joe asked 1 month ago
  • last active 1 month ago
0 votes
106 views

Good morning,

I would like to ask you about the solution contained in the title. Is it possible to create realtime charts (for example 7-10) in a list (RecyclerView)? I have studied your example but there were none with a list.

The fragment in the example called createMultiPaneStockChartsFragment contains 4 charts. But unfortunately, it is not a list.
I made a simple activity with 5 charts in a RecyclerView, but charts are stucking a bit.
I do not call notify methods. There is only update LineData method:

oneChartClass.getLineData().append(oneChartClass.getLineData().getCount(), trendPoint.getValue());

Thanking you in advance…
Hubert

0 votes
157 views

I have tried, numerous times, to understand your example “Series with Metadata,” but to my untrained eye it seems to be doing a lot of things at once, which makes it hard to understand. I am fairly inexperienced with WPF and prefer not to use MVVM. I have figured out most of what I need. But I haven’t figured out how to add metadata to existing data and display the metadata on a chart.

Do you have a simple example of adding metadata to an existing OhlcDataSeries and then displaying the metadata using a cursor tool tip?

Your help would be greatly appreciated,
Steven

  • Steven M asked 1 month ago
  • last active 1 month ago
0 votes
153 views

Hi there,

I recently realized that since upgrading to scichart version 5 my custom label provider has stopped working. With version 4 it has always been working fine.

The interesting thing is that the custom label provider works fine when making use of a “standard” NumericAxisViewModel:

IAxisViewModel newAxis = new NumericAxisViewModel ();
newAxis.TickProvider = new CustomTickProvider();
newAxis.LabelProvider = new CustomLabelProvider();

When applying the same logic to a LogarithmicNumericAxisViewModel however, the label providers “FormatLabel” is never called and so no custom labels are shown:

IAxisViewModel newAxis = new LogarithmicNumericAxisViewModel();
newAxis.TickProvider = new CustomTickProvider();
newAxis.LabelProvider = new CustomLabelProvider();

After doing some research I found out that the labelprovider is never attachd to the IAxisCore as the Init function of the labelprovider is never called when its set as the labelprovider of LogarithmicNumericAxisViewModel. (When its attached to a NumericAxisViewModel it is properly called). I suspect there’s bug somewhere in the LogarithmicNumericAxisViewModel that causes this unexpected behavior.

Any help would be appreciated.

Thanks in advance,

Mathieu.

0 votes
163 views

Hi there:

I am developing an application where the main chart is a heat map type one. I would like to have a custom cursor modifier to show some values of the x, y and z axes with limit digits. The problem is that so far I get these result:

Capture
EDIT: PLEASE INSERT AN IMAGE HERE

I would like to show only 1 decimal in the Z axis and 0 decimals en the X and Y axis. I have checked your modifiers demo but it seems to be not working for my heatmap chart. Any kind of advice about this issue would help me to have the application I am looking for.

The XAML of my chart is like this:

 <s:SciChartSurface x:Name="sciChart" Grid.Column="1" Grid.Row="3" Padding="0" BorderThickness="0" MouseDown="SciChart_MouseDown" Margin="0">
            <s:SciChartSurface.RenderableSeries>
                <s:FastUniformHeatmapRenderableSeries x:Name="heatmapSeries" 
                                                      Opacity="0.9"/>
            </s:SciChartSurface.RenderableSeries>

            <s:SciChartSurface.XAxis>
                <s:NumericAxis DrawMajorBands="True"  
                               DrawLabels="False"
                               TextFormatting="0N"
                               GrowBy="0, 1"
                               s:RolloverModifier.AxisLabelContainerStyle="{StaticResource AxisLabelStyle}" 
                               s:RolloverModifier.AxisLabelTemplate="{StaticResource AxisLabelTemplate}" 
                               s:CursorModifier.AxisLabelContainerStyle="{StaticResource CursorAxisLabelStyle}"/>
            </s:SciChartSurface.XAxis>

            <s:SciChartSurface.YAxis>
                <s:NumericAxis DrawMajorBands="True" 
                               GrowBy="0, 1"
                               DrawLabels="False" 
                               VisibleRange="0,249"  
                               TextFormatting="0"/>
            </s:SciChartSurface.YAxis>

            <s:SciChartSurface.ChartModifier>
                <s:ModifierGroup>
                    <s:RolloverModifier x:Name="RolloverModifier"
                                    IsEnabled="True"
                                    ShowTooltipOn="Always" />
                    <!--<s:CursorModifier IsEnabled="True" ShowTooltip="True" ShowTooltipOn="MouseOver"
                        ShowAxisLabels="true" SourceMode="AllSeries"/>-->
                    <s:CursorModifier x:Name="CursorModifier"
                                  IsEnabled="False"
                                  UseInterpolation="False"
                                  ShowAxisLabels="False"
                                  ShowTooltip="True"
                                  ShowTooltipOn="MouseOver"/>
                    <!--<s:VerticalSliceModifier IsEnabled="True">
                        <s:VerticalSliceModifier.VerticalLines>
                            <s:VerticalLineAnnotation IsEditable="false"
                                                  LabelPlacement="Axis"
                                                  ShowLabel="true"
                                                  LabelTextFormatting="0"/>
                        </s:VerticalSliceModifier.VerticalLines>
                    </s:VerticalSliceModifier>-->
                </s:ModifierGroup>

            </s:SciChartSurface.ChartModifier>
        </s:SciChartSurface>

Thanks in advanced.

0 votes
176 views

I use SciChart mostly for stock charts. My understanding is that the line color of a candlestick sets both the body outline and the wicks. Is there any way to set the opacity and line color of the wicks differently than the body outline?

In a stock chart with many points, the color of the wicks becomes the dominant color, and therefore when looking at a chart the curve of the wicks becomes the dominant curve. I would like to reduce the opacity of the wicks so that the curve of the candlestick bodies is the dominant curve when looking at the chart.

Thanks,
Steven

  • Steven M asked 1 month ago
  • last active 1 month ago
0 votes
190 views

How can I shift my X Axis position upwards? I need to shift X Axis so that I can place some labels below it.

  • Anil Soman asked 1 month ago
  • last active 1 month ago
0 votes
177 views

Hello there,

I’m currently working for a customer that is interested in buying SciChart WPF.

But first we have a question regarding the real time charts. It’s not a question that I can state easily but I will give it a try.

So the question goes like this:

Is it possible to have a static curve onto the same chart where the real time data points will be plotted n real time?

For e.g. the customer wants to load a theoretical reference curve on the chart before feeding real time data on the chart so that a real time comparison can be done and based on this comparison some hardware tools that generate the real time data will be stopped or let continue depending on how big the divergence gets between that reference curve and what comes in real time from the hardware tools running in background.

Thanks!

0 votes
0 answers
160 views

I have a simple app where the main activity has a FrameLayout that I use to load fragments in to. All fragments all loaded at the same time and I use hide/show to select what fragment to view.

However, when I add a chart to one of the fragments, then it loads fine initially, but if I hide it and then show it again, the app just stops. There isn’t any errors, it just stops responding.

If I remove the graph, everything works fine. Any ideas?

private void addAllFragments()
{
    getSupportFragmentManager().beginTransaction()
            .add(R.id.mainView, mainScreen, "MainScreen")
            .add(R.id.mainView, alarmScreen, "AlarmsScreen")
            .hide(alarmScreen)
            .commit();
}

private void loadFragment(String id)
{
    FragmentTransaction ft = getSupportFragmentManager().beginTransaction();

    for(Fragment f : getSupportFragmentManager().getFragments())
    {
        if(f.getTag() != id)
        {
            ft.hide(f);
        }
        else
        {
            ft.show(f);
        }
    }

    ft.commit();
}

private void loadMainScreen() {
    loadFragment("MainScreen");
}

private void loadAlarmsScreen() {
    loadFragment("AlarmsScreen");
}
0 votes
188 views

Hello,

I’m trying to display a vertical line annotation on a chart using MVVM.

In order to make it work I’ve (All the INotifyPropertyChanged are managed via the BaseViewModel)

public class GraphSurfaceBaseViewModel : BaseViewModel
{
    /// <summary>
    /// A list of annotations
    /// </summary>
    public ObservableCollection<IAnnotationViewModel> Annotations { get; private set; }

 ...
}

I create annotation that way

Graph.Annotations.Add(new VerticalLineAnnotationViewModel()
            {
                X1 = TimeOfComment,
                ShowLabel = true,
                StrokeThickness = 2,
                XAxisId = "Xaxis",
                YAxisId = "Yaxis1",
                AnnotationLabels = new ObservableCollection<AnnotationLabel>() { new AnnotationLabel() {Text = "mon test", LabelPlacement = LabelPlacement.TopRight } }

            });

And the binding to the scichartsurface is :

<s:SciChartSurface   
...         
Annotations="{s:AnnotationsBinding Annotations}"            
</s:SciChartSurface>

I’ve double check that my x axis and y axis have the same ID as the annotation.
The problem is I want to display several annotation labels but they are not appearing. I suspect a problem via the AnnotationsBinding which is not taking the AnnotationLabels from the VerticalLineAnnotationViewModel.

What I got :
enter image description here

What I want (paint skill here):
enter image description here

For the what I want, I can draw a simple vertical bar by settings showLabel = false but I suppose that all the label I previously added to the
AnnotationLabels will not be shown, that’s why I let it.

Thank you for any help.

Renaud

0 votes
162 views

Hi,

It is possible to have different point markers on the same dataseries? Maybe some of the points should use for example the Cross point marker, maybe other points should use the Ellipse point marker and so on. Is there any solution for this?
Thank you,
Brigitta.

0 votes
217 views

chart screenshot

So I am trying to set paddings on the chart, so that the data series do not touch chart edges

I can’t do it with View’s method setPadding because then the black background is present (screenshot shows padding on all sides but I need just left and right)

Also, I managed to achieve no labels, axes, grids etc. but in totally hacky way; I set .withIsCenterAxis and then all other things to false

 .withAxisId(Y_AXIS_ID)
        .withDrawMajorBands(false)
        .withDrawMajorGridLines(false)
        .withDrawMinorGridLines(false)
        .withDrawLabels(false)
        .withIsCenterAxis(true)
        .withDrawMajorTicks(false)
        .withDrawMinorTicks(false)

Is there a normal way of doing this?

thanks

0 votes
202 views

Hi,

I’m attempting to attach a generic/abstract DataSeries to an INotifyPropertyChanged object. However, the TX, TY generics seem to block me from using it as expected. Can anyone help me out?

internal class DataSeriesAbstract : INotifyPropertyChanged
{
    public string dataName;
    public double lastAppendedTimestamp = 0.0f;

    public List<AbstractChartViewModel> subscribers;

    // gives an error that TX and TY cannot be found
    public DataSeries<TX, TY> realData;
    public DataSeries<TX, TY> Data
    {
        get { return realData; }
        set
        {
            realData = value;
            OnPropertyChanged(dataName);
        }
    }
...
}

Thank you

  • Joe asked 2 months ago
  • last active 2 months ago
Showing 1 - 50 of 3k results