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

0 votes
17 views

Hi
I have to plot a column graph represents working time of tasks
The column width is between 0-1.
Is there any way to change the column width in order to specify the working time of the tasks
Open Attach file
Task 1(Yellow) : Working from 1-3, 10-15
Task 2 (Red): Working from 4-8 , 17-18

0 votes
22 views

Hi guys,

I am having difficulties setting the background of my bar chart with SCICategoryDateTime X axis since I switched to 2.0.

As far as I understand, just setting the background property of the SCIChartSurface should suffice.
These are all of the things I’ve tried:

1. [self.barSurface setBackgroundColor:[UIColor clearColor]];
2. [self.barSurfaceView setBackgroundColor:[UIColor clearColor]]; 
3. self.barSurface.renderableSeriesAreaFill = [[SCISolidBrushStyle alloc] initWithColor:[UIColor clearColor]];
4. [self.barSurface.renderSurface setIsTransparent:YES];

I didn’t find any other way of setting it, but it still remains black. Any thought on what might cause it?

EDIT: I just found out about this color setting:

[axisStyle setGridBandBrush:[[SCISolidBrushStyle alloc] initWithColor:[UIColor whiteColor]]];

The result I got was a black and white chess board, as shown on the attached picture. I really don’t understand this behaviour. If I set this gridBandBrush to nil, columns are coloured with random colours, so the chart looks like a rainbow. I understand why is this happening but shouldn’t there be a default colour in case brush is nil?

EDIT 2: While debugging using “Capture view hierarchy” in XCode I discovered that render surface is actually white inside debugger. Perhaps it will give more insight to you, it doesn’t mean much to me – I guess it’s because rendering is done on GPU and the context is not available to the debugger.

Best,
Igor

  • Igor Peric asked 1 day ago
  • last active 22 hours ago
0 votes
28 views

Hey guys,

Starting from 2.0 we can have dashed lines in renderable series. I was wondering can we have dashed line annotations as well?

I tried this:

verticalLineAnnotation.style.linePen = [[SCIPenDashed alloc] initWithColor:[UIColor redColor] width:2 withStrokeDashArray:@[@(10.f),@(3.f)]];

and got this build error:

Assigning to 'SCIPenStyle *' from incompatible type 'SCIPenDashed *'

Isn’t SCIPenDashed a SCIPenStyle?

Best,
Igor

  • Igor Peric asked 1 day ago
  • last active 18 hours ago
0 votes
29 views

Hi
How can i add a regular menu : File (open, save , save as….), Edit …
the motivation is the draw a graphs by choosing the File->open from the menu

0 votes
0 answers
29 views

Is there a way to extend the trial version license?

0 votes
0 answers
28 views

Hi,

How can I change the fontsize of a LegendModifier programmatically? By trying the code below changes the backgound color but not the font size:

var style = new Style(typeof(LegendModifier));
style.Setters.Add(new Setter(Control.BackgroundProperty, Brushes.DarkSlateGray));
style.Setters.Add(new Setter(Control.FontSizeProperty, 34d));
MainChart = new SciChartSurface
{
    HorizontalAlignment = HorizontalAlignment.Stretch,
    VerticalAlignment = VerticalAlignment.Stretch,
    Padding = new Thickness(30,20,16,0),
    Background = new SolidColorBrush(Color.FromRgb(32,32,33)),
    YAxis = new NumericAxis(),
    ChartModifier = new ModifierGroup
    {
        ChildModifiers = new ObservableCollection<IChartModifier>
        {
            new LegendModifier
            {
                Margin = new Thickness(10),
                VerticalAlignment = VerticalAlignment.Top,
                GetLegendDataFor = SourceMode.AllSeries,
                LegendPlacement = LegendPlacement.Inside,
                ShowLegend = true,
                ShowVisibilityCheckboxes = true,
                Style = style,
            }
        }
    }
};
0 votes
0 answers
36 views

Hi, guys

I have some data series like:

[[SCIXyDataSeries alloc] initWithXType:SCIDataType_DateTime
                                 YType:SCIDataType_Double
                             SeriesType:SCITypeOfDataSeries_XCategory];

Also my Y axis is kind of class SCINumericAxis

So my question is

if i’m trying add value to the series

[volumeSerie appendX:SCIGeneric(bar.time) Y:SCIGeneric([bar.volume doubleValue])];

and my bar.volume is bigger than 2 147 483 648 (float limit as i’m know). It’s leads to a axis range crash. Like on the attached image.

So what should i use to handle huge values?
Like a billions and more

Best regards,
Sushynski Andrei

0 votes
42 views

Dear All,

I would like to ask are there any method to draw a line (or annotation) by user touch event ?

For example user touch the chart to set the starting point of the line and then touch/drag to another point to draw the line.

Thanks.

  • Ray Hung asked 6 days ago
  • last active 5 days ago
0 votes
40 views

I’m trying to switch RolloverMarker template at runtime from code behind, with no luck.
I have ControlTemplate definitions in XAML.
I create FastLineRenderableSeries objects and assign RolloverTemplates to them dymanically in code behind.
I add the series into sciChartSurface.RenderableSeries.
All this works.

When user clicks a series, a selectionChanged eventHandler method tries to switch the RolloverMarkerTemplate of the selected series

ControlTemplate ylbl = (ControlTemplate)Application.Current.Resources["RolloverLabelTopTemplate"];
 flrseries.RolloverMarkerTemplate = ylbl;

The template object is created from Resources and assigned to the series, but the visible presentation is not changed.

Is there a better ( = working) way to do this or is it even possible ?

0 votes
39 views

Hi,

According to the documentation, in FastCandlestickRenderableSeries

StrokeUp and FillUp styles are applied to bars with Close > Open, and StrokeDown and FillDown to those that have Open <= Close respectively.

I would like to ask is there any method to achieve the following:

The candlestick are green in color when Today Close >= Previous Close and red in color when Today Close < Previous Close

Thanks.

  • Ray Hung asked 7 days ago
  • last active 7 days ago
0 votes
39 views

I would like to be able to resize the TextAnnotation but couldn’t. The only thing I can do is move by clicking on the small circle at the top left corner of the Text annotation.

How can I resize text annotation manually with mouse like how I do a BoxAnnotation?

0 votes
0 answers
43 views

is it possible that chaging 3D Mesh’s X, Y Coordinate. (It’s just allow the grid coordinate)
and Line that point to point is straight, is it possible straight line changes the Curve line?

0 votes
39 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
44 views

I have modified the single ended ray as found in another answer to be an infinite ray that extends both ends of the line until the touch the sides of the plot.

I would like to implement a label similar to in VerticalLineAnnotation but am unsure how I go about adding additional elements to the annotation’s template.

I have included my modified version of the rayannotation below.

/// <summary>
/// Defines a read-only or editable Line annotation, which draws a Ray to the edges of the chart viewport, depending on two X,Y coordinates
/// e.g. if X Y coordinates are placed inside the chart, then the line extends until it hits the edge or the chart viewport
/// </summary>
public class RayAnnotation : LineAnnotation
{
    private Line _line;
    private Line _ghostLine;

    /// <summary>
    /// Initializes a new instance of the <see cref="RayAnnotation" /> class.
    /// </summary>
    public RayAnnotation()
    {
        // Reuse LineAnnotation control template from SciChart
        DefaultStyleKey = typeof(LineAnnotation);

    }

    /// <summary>
    /// When overridden in a derived class, is invoked whenever application code or internal processes call <see cref="M:System.Windows.FrameworkElement.ApplyTemplate" />.
    /// </summary>
    public override void OnApplyTemplate()
    {
        base.OnApplyTemplate();

        AnnotationRoot = GetAndAssertTemplateChild<Grid>("PART_LineAnnotationRoot");
        _line = GetAndAssertTemplateChild<Line>("PART_Line");
        _ghostLine = GetAndAssertTemplateChild<Line>("PART_GhostLine");
    }

    /// <summary>
    /// Override in derived classes to handle specific placement of the annotation at the given <see cref="AnnotationCoordinates" />
    /// </summary>
    /// <param name="coordinates">The normalised <see cref="AnnotationCoordinates" /></param>
    protected override void PlaceAnnotation(AnnotationCoordinates coordinates)
    {

        // Calculate gradient of line
        double m = (coordinates.Y1Coord - coordinates.Y2Coord) / (coordinates.X1Coord - coordinates.X2Coord);
        double b = coordinates.Y1Coord - m * coordinates.X1Coord;

        if (double.IsNaN(m) || double.IsInfinity(m))
        {
            // Possible divide by zero above, just draw a single point for now
            _line.X1 = coordinates.X1Coord;
            _line.Y1 = 0;
            _line.X2 = coordinates.X1Coord;
            _line.Y2 = base.ParentSurface.ModifierSurface.ActualHeight;
            _ghostLine.X1 = coordinates.X1Coord;
            _ghostLine.Y1 = 0;
            _ghostLine.X2 = coordinates.X1Coord;
            _ghostLine.Y2 = base.ParentSurface.ModifierSurface.ActualHeight;
            return;
        }

        // Calulate projected X,Y point that touches the right/top edge, or left/bottom edge of the viewport
        double projectedX1 = 0;
        double projectedX2 = base.ParentSurface.ModifierSurface.ActualWidth;
        double projectedY1 = m * projectedX1 + b;
        double projectedY2 = m * projectedX2 + b;

        if (projectedY1 < 0 || projectedY1 > base.ParentSurface.ModifierSurface.ActualHeight)
        {
            bool isDown = projectedY1 < 0;
            projectedY1 = isDown ? 0 : base.ParentSurface.ModifierSurface.ActualHeight;
            projectedX1 = (projectedY1-b) / m;
        }

        if (projectedY2 < 0 || projectedY2 > base.ParentSurface.ModifierSurface.ActualHeight)
        {
            bool isDown = projectedY2 < 0;
            projectedY2 = isDown ? 0 : base.ParentSurface.ModifierSurface.ActualHeight;
            projectedX2 = (projectedY2-b) / m;
        }

        //Console.WriteLine("Projected x{0:0.00},y{1:0.00},x{2:0.00},y{3:0.00}", projectedX1, projectedY1, projectedX2, projectedY2);

        // Apply Calculated Line
        _line.X1 = projectedX1;
        _line.Y1 = projectedY1;
        _line.X2 = projectedX2;
        _line.Y2 = projectedY2;
        _ghostLine.X1 = projectedX1;
        _ghostLine.Y1 = projectedY1;
        _ghostLine.X2 = projectedX2;
        _ghostLine.Y2 = projectedY2;
    }
}
  • Hugoagogo asked 1 week ago
  • last active 6 days ago
0 votes
52 views
  1. Is it possible to display the peak value instead of X and Y values at touch point using a modifier ? If so, how can I achieve this ? (Both Rollover and Cursor modifier only shows the X and Y values)

  2. In real time chart, since the values are updating continuously, the cursor modifier is constantly disappearing and appearing and is not stationary. How can I keep the cursor modifier always visible ?

  • Chui asked 2 weeks ago
  • last active 2 weeks ago
0 votes
65 views

Hi, guys

My x axis is SCICategoryDateTimeAxis class type. And it’s limited by VisiableRangeLimit like:

[xAxis setVisibleRangeLimit:[[SCIDoubleRange alloc] initWithMin:SCIGeneric(firstItem – (lastItem – priorItem))
Max:SCIGeneric(lastItem + (lastItem – priorItem))]];

Also for scrolling my content inside chart:

SCIZoomPanModifier * zpm = [[SCIZoomPanModifier alloc] init];
[zpm setModifierName:@"PanZoom Modifier"];
[zpm setClipModeX:SCIZoomPanClipMode_ClipAtExtents];

Like a description SCIZoomPanClipMode_ClipAtExtents says:
“forces the panning operation to stop suddenly at the extents of the data” – but it’s not working constantly.
Sometimes it’s allow to scroll outside the range. Like on the attached image.

So my question is how to limit scrolling by min and max value?

Best regards,
Sushynski Andrei

0 votes
62 views

On VS2017, in LineChartFragment.cs, I am trying to use VerticalSliceModifier, but it is not found.

var verticalSliceModifier = new VerticalSliceModifier();

Thank for your help.

0 votes
55 views

I am have a vertical stacked chart setup which shares the same x- axis ranges. I am trying to find a way to add vertical lines in both the charts at once and further I need the vertical lines to be dragged in sync. When one vertical line annotation is dragged, I need the same movement to happen in the other chart as well. I can share a prototype if you want. Please suggest a solution.

0 votes
50 views

I’ve seen the example PointMarkers Selection, and that it uses FastLineRenderableSeries. In my case I want to use DataPointSelectionModifier with XyScatterRenderableSeries. When I select a few points, SelectedPointMarkers seems to either have all the points in all the series, or none. Is there a trick to it that I’m missing?

0 votes
71 views

hi,
does SciChart provides any mechanism to serialize a chart along with the data plotted?
My requirement is that I should be able to save the chart as a file and restore it back.

Please advise.

Thanks,
Vibin

0 votes
58 views

Hi,
I am trying to implement pan and zoom functionalities for real time charts present in Sci chart demo application
Can any one please suggest me on how to implement the same

Thanks in advance

0 votes
62 views

Hello,

Are there any plans to add a percentage X Axis?

For example:

Comparative Percent Performance Chart

The chart plots the percent change for each series starting at the beginning of the view window.

Thanks.

  • Paul R asked 2 weeks ago
  • last active 2 days ago
0 votes
0 answers
57 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
78 views

hi,
I have one XAxis and 2 YAxes.
Is it possible to zoom on the Y Axes so that the series in 2 Y axes does not overlap?
Please see attached image.

0 votes
80 views

Hi,

I have a question concerning multithreaded access to the DataSeries:

We implemented an overview for our chart as described here. This works fine when we load data, add it to the series and then display it.

Now, for a certain use case we need to display live data. We implemented this in a background thread. We noticed that after some time the application freezes when the update frequency rises. In the documentation I found this:

NOTE: Considerations when a DataSeries is shared across multiple chart surfaces. Currently only a single parent chart is tracked, so DataSeries.SuspendUpdates() where the DataSeries is shared may have unexpected results.

I guess this is what is happening here…so what is the recommended approach to achieve something like this? Do we have to add the data on the UI thread if we want to have the Overview? Here it says:

When appending Data in a background thread, you cannot share a DataSeries between more than one SciChartSurface. You can still share a DataSeries between more than one RenderableSeries.

Does that mean we should create more different RenderableSeries for the main chart surface and the overview surface that are based on the same DataSeries? Any help would be appreciated!

0 votes
95 views

Hi!

I tried implementing pinch zooming for real time chart in the demo project(FIFO Performance Demo and ECG Monitor Demo) and found that it’s not possible.

I used the following code:

self.surface = [[SCIChartSurface alloc] initWithView: self.sciChartSurfaceView];
SCIPinchZoomModifier * pzm = [[SCIPinchZoomModifier alloc] init];
[pzm setModifierName:@”PinchZoom Modifier”];
self.surface.chartModifier = pzm;

If it is so, then how can I achieve it ?

  • Chui asked 3 weeks ago
  • last active 2 weeks ago
0 votes
74 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 3 weeks ago
  • last active 2 weeks ago
0 votes
86 views

Hello everyone,

I would like to create a real time graph like shown in the attached image. I have a X value and a Y value that change over time.
Let’s say I want to show Volt (V) on the X-axis, Current (I) on the Y-axis and use the Z-axis for the time (t). It is not important to show the time on the graph.

How could I realize such a graph?
Thanks for any help!

  • Stefan Ott asked 3 weeks ago
  • last active 6 days ago
0 votes
81 views

Hello,
I currently have a heatmap with float values on the Y axis and timestamps on the X axis, which renders fine. My timestamps are not equally spaced, so I changed it to a CategoryDateTime axis thinking that it would present all the columns with equal spacing. Instead, no heatmap gets rendered. The X and Y labels do show up, however. I’m not getting an error and don’t see anything that stands out in my output window. Is it just a matter of the categorical axis not supported by the heatmap, or can there be an error getting thrown silently somewhere?

  • Karl Ku asked 3 weeks ago
  • last active 3 weeks ago
0 votes
83 views

Are there any SciChart WPF 3.6 tutorials available? I looked on GitHub and only saw v4 and v5 tutorials and examples. I just started a new job with a company that only has v3.6 licensed.

0 votes
78 views

Hi,

When rendering a FastLineRenderableSeries, there are line segments missing both before and after a double.NaN Y value. This makes sense for a regular line series, but for a step line series (where IsDigitalLine=True), why isn’t the line segment preceding the NaN being drawn? When plotting (for example) financial prices over time, the missing line before the NaN gives the impression that a price didn’t exist for that period, which is incorrect.

I’m looking at the IterateLines method in FastLinesHelper. Even though the method has an isDigitalLine parameter, it isn’t checked during the handling of a NaN value. Is this an oversight?

Thanks very much,

Graham.

0 votes
83 views

Hi,

I am trying to get the index of a specific date in CategoryDateTime X axis. I was trying to use this approach:

int idxOfMaxAvgScoreDate = [[self.dataSeriesAvg xValues] indexOf:SCIGeneric(dateOfMaxAvgScore) IsSorted:YES SearchMode:SCIArraySearchMode_Exact];

but it was returning -1. My guess is that comparison operator for the DateTime type is “too precise”, so some kind of range check needs to be done, similarly to common practice when comparing two floats:

if (abs(float1-float2) < epsilon)

instead of

if (float1 == float2)

I tried using SCIArraySearchMode_Nearest, but without success – most of the times I get a column right after the one I need (desiredIndex+1).

While trying to implement index lookup myself by iterating through the dataSeries.xValues I noticed that DateTime type decoder is not there for individual elements of SCIArrayControllerProtocol. Autocompletion for line below

[[self.dataSeries xValues] valueAt:i].

offers all typed of data decoding (int16, int32, char…) except dateTime. Is this the way it is supposed to be?

I tried solving it this way:

SCIGenericDate([[self.dataSeries xValues] valueAt:i])

but the date I am getting is always 01-01-1970. This indicates that entries in the X axis are not DateTime elements, which is not true, since this is my X axis:

id<SCIAxis2D> xAxis = [[SCICategoryDateTimeAxis alloc] init];

Any help, or even just thoughts and comments, would be highly appreciated.

Thanks,
Igor

  • Igor Peric asked 3 weeks ago
  • last active 3 weeks ago
0 votes
72 views

I need to get Yaxis value of mouse with using OnClick Event. If I use CursorModifier I can get only one value of “primary” or first declared axis. So even this axis’s Visibility Property set as Collapsed I get is’s Y Value, and if displayed axes and “primary” have a different scale (and they have), I get a very wrong value. How can I get Y value of displayed axes or of all axes?

0 votes
79 views

Hello again! 🙂

This time I am trying to draw marker for a maximum numeric data value in chart with CategoryDateTime X axis.

I have my X axis defined like this:

id<SCIAxis2D> xAxis = [[SCICategoryDateTimeAxis alloc] init];

and I am trying to draw a marker in draw() method of a custom modifier using this code:

 id<SCIRenderPassData> data = [_rSeries currentRenderPassData];
 id<SCICoordinateCalculator> xCalc = [data xCoordinateCalculator];
 id<SCICoordinateCalculator> yCalc = [data yCoordinateCalculator];
 NSLog(@"Is category calc: %d", [xCalc isCategoryAxisCalculator]);
 double xCoord = [xCalc getCoordinateFromDate:_xValue];
 double yCoord = [yCalc getCoordinateFrom:_yValue];
 [_marker drawToContext:context AtX:xCoord Y:yCoord];

My _xValue is computed and set from outside and is for sure is a valid date on X axis for which I need to draw the marker on.

My problem is that:

  1. xCoord is always 0.
  2. NSLog line prints 0 to debug console, meaning that xCalc is not CategoryAxisCalculator. I suspect this is why xCoord is always 0.

My questions are:

  1. Am I trying to compute xCoord the right way? I need it for drawing the marker and I have a date for which I want marker to be placed on.
  2. Why [data xCoordinateCalculator] returns something that is not CategoryAxisCalculator even though my axis is a category axis? Is this expected behaviour?

Looking forward to your always useful reply. 🙂

  • Igor Peric asked 4 weeks ago
  • last active 4 weeks ago
0 votes
82 views

I’m trying to implement custom annotations using the MVVM pattern. I’ve been using your tutorial as an example (https://www.scichart.com/databinding-annotations-with-mvvm/). Everything works as expected if I manually load some example data to the annotations collection. When I actually try to load the data from our database using async method, the annotations are no longer drawn.

Is this by design or am I doing something wrong? Do you have any suggestions how to load annotations when using async code and MVVM patterns? I haven’t had any problems loading the actual time series on the chart using the same pattern.

I also tried binding the SciChartSurface’s Annotations property to AnnotationCollection and then calling ChartAnnotations.ParentSurface.InvalidateElement(), but the issue still persists.

You can easily reproduce this behavior by adding an async call to the examples’s source code:

private async Task Initialize()
{
    var ds0 = new XyDataSeries<double, double>();
    var someData = new RandomWalkGenerator().GetRandomWalkSeries(200); // RandomWalkGenerator is found in the examples source code

    ds0.Append(someData.XData, someData.YData);

    _chartSeries = new ObservableCollection<IChartSeriesViewModel>();
    _chartSeries.Add(new ChartSeriesViewModel(ds0, new FastLineRenderableSeries()));

    // Now create the labels
    _chartLabels = new List<LabelViewModel>
                       {
                           new LabelViewModel(5, -2.5, "Label0", "Label0 Tooltip!"),
                           new LabelViewModel(20, -2, "Label1", "Label1 Tooltip!"),
                           new LabelViewModel(35, 3, "Label2", "Label2 Tooltip!"),
                           new LabelViewModel(50, 1.5, "Label3", "Label3 Tooltip!"),
                       };

    await Test();

    _chartLabels.Add(new LabelViewModel(65, -0.5, "AFTER ASYNC", "Label4 Tooltip!"));
}

private async Task Test()
{
    await Task.Delay(5000);
}
  • Juho asked 4 weeks ago
  • last active 3 weeks ago
1 vote
95 views

Hey folks,

I have an Android device (CAT S40) running 5.1 on it. I am encountering an issue when pressing the home button or lock button. It seems that sometimes when the app is in pause or sleep my chart surfaces are destroyed and turn black. I have only seen this problem on this device. The only way to restore them is to restart the app. I researched this issue an found information on OpenGL context getting destroyed on pause. There is a setting in GLSurfaceView called setPreserveEGLContextOnPause. I am not sure if it is possible to access this setting from the SciChartSurface or not.

After seeing this, I tested the SciChart example app to see if the problem was isolated to my app, but it happened in the example app as well.
Again this is the only device I have seen this happen on and I’ve tested multiple devices.

Thanks for your help

0 votes
100 views

Hi all,

I would like to ask how to modify the label of the OHLC Chart in Android.
For example, in the attached screenshot, how to change the label “Highest” to “High” ? Thanks.

  • Ray Hung asked 4 weeks ago
  • last active 4 weeks ago
0 votes
90 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
95 views

Hi,
I have the necessity to allow the user to draw one or several polygons upon a heatmap chart to let him select the region he is interested in. See attached image.

I don’t want to selected the markers inside the drawn polygon, only to know the coordinates (in data coordinates, not screen) of the various point that define the polygon.
I saw that the way to do this is to use Annotations however it’s not clear to me if is it possible to have the same behaviour of the BoxAnnotation but with a polygon (without any side number limit)?

Thank you,

Raphael

0 votes
84 views

Hi,
Since sometimes the rollover cursor and the points tooltips are going below the legend panel, I would like to know if there is a way to change the drawing order of the legend panel (ZIndex?).

After some tries I just managed to change the ZIndex of the LegendPlaceholder, but in this way (putting -1 as ZIndex) the legend panel will also go below the axis bands and grid lines (see attached image)

  • Luca Berti asked 1 month ago
  • last active 1 month ago
0 votes
86 views

Hello. I would like to load data as needed when the user pans or zooms. I’ve looked at the examples but don’t see an example of a method being called when a pan/zoom occurs. I’ve tried adding MouseUp=”chart2D_panZoomEvent” MouseWheel=”chart2D_panZoomEvent” to my chart definition but the methods don’t appear to be called.

Thanks,
Daryl.

0 votes
102 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 1 month ago
  • last active 4 weeks ago
0 votes
99 views

I am trying to call the ZoomBy() method of SciChart control from ViewModel. The ZoomBy() is easily available in the xaml.cs file like below:

// TODO: Need to implement zoom using MVVM
    private void BtnZoomIn_Click(object sender, RoutedEventArgs e)
    {
        TemperatureGraph.ChartModifier.XAxis.ZoomBy(-0.1, -0.1);
    }

The same functionality I need to implement using the ViewModel pattern.

However the ZoomExtents method is easily being called using ViewportManager of SciChart control. E.g. below: XAML file

<RocheButton Name="BtnZoomOut" DockPanel.Dock="Top" Icon="{IconResource Icon=ZoomOut}" HorizontalAlignment="Right" Command="{Binding ZoomOutCommand}" />    
<s:SciChartSurface x:Name="TemperatureGraph" Grid.Column="0" s:ThemeManager.Theme="BrightSpark"  
                           RenderableSeries="{s:SeriesBinding TemperatureGraphViewModel}" DockPanel.Dock="Bottom"
                           ViewportManager="{Binding ViewportManager}">

And the ViewModel Code:

public class TemperatureSummaryGraphViewModel : ViewModelBase
    {
        #region Private Members

        private IXyDataSeries<TimeSpan, double> TemperatureDataSeries = new XyDataSeries<TimeSpan, double>();
        private IXyDataSeries<TimeSpan, double> AcquisitionPointDataSeries = new XyDataSeries<TimeSpan, double>();
        private DefaultViewportManager _viewportManager = new DefaultViewportManager();
        private ICommand _zoomOutCommand;

        #endregion

        #region Constructor

        public TemperatureSummaryGraphViewModel()
        {
            ZoomOutCommand = new DelegateCommand(() => ZoomOutTemperatureGrpah());
            GenerateDummySeries();

            TemperatureGraphViewModel.Add(new LineRenderableSeriesViewModel()
            {
                DataSeries = TemperatureDataSeries,
                StyleKey = "LineSeriesStyle0"
            });

            TemperatureGraphViewModel.Add(new XyScatterRenderableSeriesViewModel()
            {
                DataSeries = AcquisitionPointDataSeries,
                StyleKey = "ScatterSeriesStyle0"
            });
        }

        #endregion

        #region Public Properties

        public ObservableCollection<IRenderableSeriesViewModel> TemperatureGraphViewModel { get; } = new ObservableCollection<IRenderableSeriesViewModel>();

        public IViewportManager ViewportManager
        {
            get
            {
                return _viewportManager;
            }

            set
            {
                if (ReferenceEquals(value, _viewportManager))
                {
                    return;
                }

                _viewportManager = (DefaultViewportManager)value;
                OnPropertyChanged("ViewportManager");
            }
        }

        public ICommand ZoomOutCommand
        {
            get
            {
                return _zoomOutCommand;
            }

            set
            {
                if (ReferenceEquals(value, _zoomOutCommand))
                {
                    return;
                }

                _zoomOutCommand = value;
                OnPropertyChanged(nameof(ZoomOutCommand));
            }
        }

        #endregion

        #region Public Methods

        /// <summary>
        /// To generate dummy data
        /// // TODO: Need to integrate it with RunEditor with the actual data
        /// </summary>
        public void GenerateDummySeries()
        {
            double y = 80.5, yVar = 30.0;

            TemperatureDataSeries.Append(TimeSpan.FromMinutes(1), 40.0);
            TemperatureDataSeries.Append(TimeSpan.FromMinutes(2), 80.5);
            for (int x = 2; x < 50; x++)
            {
                TemperatureDataSeries.Append(TimeSpan.FromMinutes(x), y);

                yVar *= -1;
                y += yVar;
            }

            for (var i = 5.4; i < 50; i += 2)
            {
                AcquisitionPointDataSeries.Append(TimeSpan.FromMinutes(i), 60.0);
            }
        }

        public void ZoomOutTemperatureGrpah()
        {
            _viewportManager.ZoomExtents();
        }

        #endregion
    }
}

This code is working fine and zooming out the scichart control to 100%.

I want to implement the same using the ZoomBy().

Please help!

0 votes
84 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
94 views

Hello. I’d like to point the Camera3D to a particular marker at x,y,z on my chart. I thought the ‘target’ property would do that, but changing it in the ‘Modify Camera Properties’ example doesn’t seem to change where the camera is pointing. What am I missing?

Thanks,
Daryl.

0 votes
101 views

Hi,

I have understood that you will start supporting macOS in the near future. Are we talking Q3, Q4 or 2018?

Any hint, even one with lots of caveats will be greatly appreciated…

Thanks
/Peter

0 votes
112 views

I’m trying to render Histograms at runtime where the bins’ information like upper and lower bounds and width are known. However when I set the DataPointWidth to 0.2 for example, the bin spacing is different. Here is my code and XAML:

        // We can create a histogram with evenly spaced bins 
        // by specifying the lower bound, the upper bound, 
        // and the number of bins:
        var histogram = Histogram.CreateEmpty(values.Min(), values.Max(), numberOfBins);
        double width = (values.Max() - values.Min()) / numberOfBins;
        histogram.Tabulate(values);

        foreach (var bin in histogram.BinsAndValues)
        {
            XyDataSeries<double, double> dataSeries = new XyDataSeries<double, double>();
            dataSeries.Append(bin.Key.LowerBound, bin.Value);
            pointList.Add(new ColumnRenderableSeriesViewModel() { DataSeries = dataSeries, StrokeThickness = 2, Stroke = Colors.Gray, Fill = Brushes.CornflowerBlue, DataPointWidth = 0.2 });
        }

        ChartData = new ObservableCollection<IRenderableSeriesViewModel>(pointList);

        <Style x:Key="BaseColumnStyle" TargetType="s:FastColumnRenderableSeries">
        <Setter Property="Opacity" Value="0.3"/>
        <Setter Property="StrokeThickness" Value="2"/>
    </Style>

    <Style x:Key="BlueColumnStyle" BasedOn="{StaticResource BaseColumnStyle}" TargetType="s:FastColumnRenderableSeries">
        <Setter Property="Fill" Value="CornflowerBlue"/>
    </Style>
    <!--  Define styles for the SciChartSurface  -->
    <Style x:Key="SciChartSurfaceStyle" TargetType="s:SciChartSurface">
        <Setter Property="Background" Value="White"/>
        <Setter Property="Padding" Value="20"/>
        <Setter Property="Foreground" Value="Black"/>
        <Setter Property="FontSize" Value="20"/>
        <Setter Property="FontFamily" Value="Arial Black"/>
        <Setter Property="FontWeight" Value="Bold"/>
    </Style>

    <!--  Define styles for the GridLinesPanel  -->
    <Style x:Key="GridLinesPanelStyle" TargetType="s:GridLinesPanel">
        <Setter Property="Background" Value="White"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="BorderBrush" Value="Black"/>
    </Style>

    <!--  Using the LayoutTransform is much more apropriate in this point  -->
    <!--  the RenderTransform is used for demonstration purposes only,  -->
    <!--  for the compatibility with Silverlight reasons  -->
    <Style x:Key="AxisLabelStyle" TargetType="s:DefaultTickLabel">
        <!--<Setter Property="RenderTransform">
            <Setter.Value>
                <RotateTransform Angle="-15"/>
            </Setter.Value>
        </Setter>-->
        <Setter Property="Margin" Value="0"/>
    </Style>

    <!--  Define styles for the X and Y Axes  -->
    <Style x:Key="AxisStyle" TargetType="s:AxisBase">
        <Setter Property="FontSize" Value="18"/>
        <Setter Property="FontWeight" Value="Normal"/>
        <Setter Property="FontFamily" Value="Arial"/>
        <Setter Property="TitleFontSize" Value="12"/>
        <Setter Property="TitleFontWeight" Value="Bold"/>
        <Setter Property="TickTextBrush" Value="Black"/>
        <Setter Property="DrawMajorBands" Value="False"/>
        <Setter Property="DrawMinorGridLines" Value="False"/>
        <Setter Property="DrawMinorTicks" Value="False" />
        <Setter Property="DrawMajorTicks" Value="False"/>
        <Setter Property="TickLabelStyle" Value="{StaticResource AxisLabelStyle}"/>
        <Setter Property="MajorGridLineStyle">
            <Setter.Value>
                <Style TargetType="Line">
                    <Setter Property="Stroke" Value="LightGray"/>
                    <Setter Property="StrokeThickness" Value="1"/>
                </Style>
            </Setter.Value>
        </Setter>
    </Style>
</UserControl.Resources>
<Grid>
    <s:SciChartSurface x:Name="histogram" ChartTitle="{Binding ChartTitle}" RenderableSeries="{s:SeriesBinding ChartData}"
                       Style="{StaticResource SciChartSurfaceStyle}" GridLinesPanelStyle="{StaticResource GridLinesPanelStyle}">
        <s:SciChartSurface.XAxis>
            <s:NumericAxis AxisTitle="{Binding XAxisTitle}" Style="{StaticResource AxisStyle}" AutoRange="Always"/>
        </s:SciChartSurface.XAxis>
        <s:SciChartSurface.YAxis>
            <s:NumericAxis AxisTitle="{Binding YAxisTitle}" AxisAlignment="Left" Style="{StaticResource AxisStyle}"/>
        </s:SciChartSurface.YAxis>
    </s:SciChartSurface>
</Grid>

How can I make the bin spacing the same independent of bin width? See my attachment of two different histograms with the DataPointWidth for each.

0 votes
108 views

hi,
I see that my tooltips are cutoff when it is outside chart.
Please see attachment.
I use following teplate for tooltips.

Can you give me some pointers?

 <DataTemplate DataType="s:SeriesInfo">
        <StackPanel>
            <StackPanel.Resources>
                <Style TargetType="TextBlock">
                    <Setter Property="Foreground" Value="LightGray" />
                    <Setter Property="FontSize" Value="12" />
                </Style>
            </StackPanel.Resources>
            <TextBlock Text="{Binding SeriesName}" />
            <StackPanel Orientation="Horizontal">
                             <TextBlock Text="{Binding Angle}" />
            </StackPanel>
            <StackPanel Orientation="Horizontal">              
                <TextBlock Text="{Binding FormattedYValue}" />
            </StackPanel>
        </StackPanel>
    </DataTemplate>
0 votes
109 views

Dear Sir,

Warm Greetings!
Sir, could you give some tips how we can draw circle or ellipse in the SciChart?

Your swift reply will be deeply appreciated.

Thank you and kind regards,

Team Solmitech

1 vote
119 views

I am using the 2D Heatmap with text as my working prototype. I wish to have a secondary Axis on the opposite side of my man Axis that displays a count for that row or column. To display this information is simple enough through using the LabelProvider (although two lines maybe a bit tricky), and I can do some stuff with the TickProvider when it gets a bit too busy.

My question is on how I can position these TickLabels to be in the center of a row/column?

My first thought was I could be cheeky and set the margin value to offset it in its style but it seems it only works so far with the TickLabel just displayed below the tick.

        <Style x:Key="LeftAxisLabelStyle" TargetType="s:NumericTickLabel">
                   <Setter Property="Margin" Value="0,0,0,-30"/>
        </Style>

enter image description here

What I am trying to achieve seems to be the default positioning for column charts, and histograms. I was wondering if there is a behind the scenes option or an override I’ve missed to set this?

Alternatively annotations maybe the way to go but I get the impression that this is more for on chart labels rather than for Axis?

p.s. I think when dealing with multiple Axes, you should give an warning/error if an “Id” is not given to secondary Axis as the graph will just show blank.

Showing 1 - 50 of 2k results
STAY UPDATED
Signup now and we’ll keep you updated with product developments and you will be notified the moment SciChart iOS Charts is released and available.
STAY UPDATED
Signup now and we’ll keep you updated with product developments and you will be notified the moment SciChart Android Charts is released and available.
THANK YOU
Your details have been received.
We like to make sure we only send information to clients who want to hear from us, so if you check your email now, you will find a confirmation email from us. Please click the confirm link and you'll will be added to our updates.