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

0 votes
41 views

Can I use the 30 day trial version to run a newly built exe file from the “exported” Visual Studio solution files which then runs into the “Sorry! You need to have a license to use SciChart.” run-time error? How can I find and activate the 30 day license to avoid this run-time error?

0 votes
116 views

I have a method that adds a marker line to my chart. The issue I have it that calling this method results in a non-blocking async call but in other code where I call this, I want to access the markers immediately after adding the marker. Is there a way to call Annotations.Add synchronously?

public void CreateNewMarker(DateTime markerDate, Color color)
{
try
{
MainChart.Annotations.Add(new VerticalLineAnnotation()
{
Stroke = new SolidColorBrush(color),
StrokeThickness = 1,
X1 = markerDate,
StrokeDashArray = new DoubleCollection(new List { 6, 3 }),
IsEditable = false
});
}
catch (Exception ex)
{
Tracing.TraceError(piuModule, className + “.CreateNewMarker()”, “Error during the CreateNewMarker() method”, ex);
}
}

Other Method
{
calls CreateNewMarker(0
Access new marker Annotations by index, MainChart.Annotations[markerIndex].X1

}

0 votes
125 views

I have a 3D chart where we are loading .obj files. If I set the opacity on the element in Xaml it works. However, we want to be able to adjust the opacity with a slider. When we bind the opacity to the value of the slider the opacity does not change. Is there something else we need to do to get the opacity to change when the slider value changes? The slider has a minimum of 0 and a maximum of 1.

<s3D:SciChart3DSurface x:Name="ThreeDChart"
                           IsAxisCubeVisible="False"
                           IsFpsCounterVisible="False"
                           IsXyzGizmoVisible="True"
                           ShowLicensingWarnings="False">
<s3D:SciChart3DSurface.XAxis>
    <s3D:NumericAxis3D />
</s3D:SciChart3DSurface.XAxis>
<s3D:SciChart3DSurface.YAxis>
    <s3D:NumericAxis3D />
</s3D:SciChart3DSurface.YAxis>
<s3D:SciChart3DSurface.ZAxis>
    <s3D:NumericAxis3D />
</s3D:SciChart3DSurface.ZAxis>
<s3D:SciChart3DSurface.SceneObjects>
    <object:ObjectModel3D x:Name="BrainMesh"
                          CoordinateMode="Relative"
                          Opacity="{Binding BrainOpacity}"
                          Position="0.5, 0.5, 0.5"
                          Scale="5, 5, 5"
                          Source="{StaticResource Brain}" />
</s3D:SciChart3DSurface.SceneObjects>
<s3D:SciChart3DSurface.ChartModifier>
    <s3D:ModifierGroup3D>
        <s3D:OrbitModifier3D />
        <s3D:ZoomExtentsModifier3D />
    </s3D:ModifierGroup3D>
</s3D:SciChart3DSurface.ChartModifier>

Thank you!

0 votes
0 answers
100 views

I want to apply a Style that has removed the horizontal lines of the CursorModifier.

private void ExecuteLoadedCommand(StackGraphViewer parameter)
    {
        if (root == null) root = parameter;

        root.sciChart.ViewportManager = _scrollManager;

        // Remove CrosshairsHorizLine
        root.sciChart.MouseMove += RemoveCrosshairsHorizLine;
    }

    private void RemoveCrosshairsHorizLine(object sender, MouseEventArgs e)
    {
        Line crosshairsHorizLine = root.sciChart.ModifierSurface.Children.OfType<Line>().FirstOrDefault(line => line.X1.CompareTo(0d) == 0);
        if (root.sciChart.ModifierSurface.Children.Contains(crosshairsHorizLine))
        {
            root.sciChart.ModifierSurface.Children.Remove(crosshairsHorizLine);
            root.sciChart.MouseMove -= RemoveCrosshairsHorizLine;
        }
    }

I want to solve it in View XAML, not ViewModel Code.

What should I do?

0 votes
0 answers
96 views

I want to express a different graph according to the state of the button.

<s:SciChartSurface.Style>
            <Style TargetType="s:SciChartSurface">
                <Style.Triggers>
                    <DataTrigger Binding="{Binding Path=IsEnabled, ElementName=swStack}" Value="True">
                        <Setter Property="YAxes" Value="{Binding StackYAxisList}"/>
                        <Setter Property="RenderableSeries" Value="{s:SeriesBinding StackRenderableSeriesList}"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding Path=IsEnabled, ElementName=swStack}" Value="False">
                        <Setter Property="YAxes" Value="{Binding TotalYAxisList}"/>
                        <Setter Property="RenderableSeries" Value="{s:SeriesBinding TotalRenderableSeriesList}"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>
        </s:SciChartSurface.Style>

I get an error saying that s:SeriesBinding is not supported.

What should I do?

0 votes
0 answers
158 views

I am using an old version of Scichart 4.1.1.8645.

Mainly I have no issue but I need an advice .

I am rendering scatter series and heatmap series and I don’t want to face performance issues. So as far as I knew I am able to render unsorted data , but internally does the Scichart do any sorting algorithm for this data ? by mean does Scichart order the data internally in anyway?

Since I am afraid to lose time when having millions of records to be rendered in realtime.
And do you suggest to sort the data before sending it to Scichart and how may this help us? because I am rendering single point and I don’t get it why do I need to sort the data for better performance ?

in addition , if you are sorting inside your library is there anyway to skip these sorting algorithms?
I appreciate if you can explain !

Thank you in advance

0 votes
0 answers
109 views

Hi

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

Example.

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

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

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

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

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

    </s:SciChartSurface>

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

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

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

    </s:SciChartSurface>

</Grid>

enter image description here

0 votes
196 views

.Net 6 MAUI preview has been released, so may i know scichart support MAUI ?
Can we use Xmarin charts directly to MAUI app ?

Can you provide some examples for MAUI ?

  • Abhilash R asked 3 weeks ago
  • last active 2 weeks ago
0 votes
146 views

I have added a real time value legend to my chart. This is working well, based upon examples I have found here at the forum and in the SciChart documentation.

My question is this:
How can I position this new legend (includes series color, series name and series YValue ) so that it is in relation to a single or multiple Y axis’s displayed. In other words I like it to positions itself in relation to the YAxis so it does not overwrite it, and stays on the plotting area.

Appreciate the help
Thank you
Anders

0 votes
144 views

We’re developing an extra web based front end for what was until now a monolithic WPF .Net 4.72 application and want to add a small service that we can host a REST API, that when given a GUID, can render the data into a scichart exported bitmap.

My plan was to use ASP.NET core to do this as the rest of web application will be done using this, but although I can install the scichart package, I can’t find a way to reference the Presentation Core dlls (needed for amongst other things the colors and content control stuff).

The project sdk is Microsoft.NET.Sdk.Web, but I can’t figure out how to do this.

1 vote
184 views

SciChart is creating too much garbage objects/events* instead of reusing through pools (Analysis through dotMemory shows this). In complex applications this additional gc-pressure causes frequent lockups. (GC Pauses in 50-250ms+ range).

Top backtraces for GC-Problem:
– WeakEventTable.Purge
– Tick Rendering (TimeSpan, Strings)
– ProperyChangedEventManager.Purge

Top Types:
– WeakEventTable+EventKey
– HybridDictionary
– Double, String, TimeSpan
– Action

All of these top types/backtraces result directly from SciChart as we cross-verified with your 2D-Chart-Realtime-Series demo and by omitting the SciChart controls from our application. ( 2/3 of the total memory pressure comes from SciChart with even just 2 charts being present in our application, we see 5MB garbage memory traffic per 2 second, resulting in very frequent GC collections sporadically spiking into a high duration)

We currently use SciChart WPF V5, it seems SciChart WPF V6 Demo didnt fix this instead just using the LowLatency GC mode causing more frequent GC-collections causing worse overall performance in complex applications. (as we verfied in our application)

Is there plans to increase memory/object reuse/pooling and reduce events/actions? (70k allocations of events/actions for short time spans arent really understandable). What are those 70k events for simply rendering a chart with not much changing, see the attached image.

What settings/methods do you recommend to lower the Memory Pressure/WeakEvents resulting from SciChart usage?

What is the best rendering method to minimize GC pressure, we only require updates if new data becomes available through our application. Would it be manual?

Please comment

Thank you

0 votes
139 views

Hello,
I want to create a heatmap sync with a CandlestickRenderableSeries which using DiscontinuousDateTimeAxis, is it possible to make heatmap column align with ohlc point?

  • ZHOU HANG asked 4 weeks ago
  • last active 4 weeks ago
0 votes
196 views

Good day. I’m trying to add a panning functionality in a 3D plot using WPF. How can I achieve this?

0 votes
146 views

Hello,

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

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

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

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

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

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

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

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

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

    return scrollerYAxis1;
}

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

Thanks for your help!

0 votes
0 answers
167 views

I’m able to style the AxisLabelContainerStyle and AxisLabelTemplate for my TimeSpanAxis but it doesn’t seem to be working for my NumericAxes/NumericAxisViewModels. Attached is a photo showing the styled TimeSpanAxis (cyan) and the default NumericAxis (green).

Here are the templates:

<Style TargetType="{x:Type sci:AxisLabelControl}" x:Key="CursorAxisLabelStyle">
        <Setter Property="Background" Value="Black" />
    </Style>
    <DataTemplate DataType="{x:Type sci:AxisInfo}" x:Key="CursorNumericAxisLabelTemplate">
        <Border BorderBrush="DarkCyan" BorderThickness="1">
            <TextBlock Foreground="Cyan" Margin="2" Text="{Binding DataValue, StringFormat={}{0:0.0}}" />
        </Border>
    </DataTemplate>
    <DataTemplate DataType="{x:Type sci:AxisInfo}" x:Key="CursorTimeSpanAxisLabelTemplate">
        <Border BorderBrush="DarkCyan" BorderThickness="1">
            <TextBlock Foreground="Cyan" Margin="2" Text="{Binding DataValue, StringFormat={}{0:hh}:{0:mm}:{0:ss}}" />
        </Border>
    </DataTemplate>

Here are the styles for the axes:

<Style TargetType="{x:Type sci:NumericAxis}">
        <Setter Property="sci:CursorModifier.AxisLabelContainerStyle" Value="{StaticResource ResourceKey=CursorAxisLabelStyle}" />
        <Setter Property="sci:CursorModifier.AxisLabelTemplate" Value="{StaticResource ResourceKey=CursorNumericAxisLabelTemplate}" />
    </Style>
    <Style TargetType="{x:Type sci:TimeSpanAxis}">
        <Setter Property="sci:CursorModifier.AxisLabelContainerStyle" Value="{StaticResource ResourceKey=CursorAxisLabelStyle}" />
        <Setter Property="sci:CursorModifier.AxisLabelTemplate" Value="{StaticResource ResourceKey=CursorTimeSpanAxisLabelTemplate}" />
    </Style>

I will note that I’m binding my YAxes to an ObservableCollection because throws a binding error. But I’ve also tried using {x:Type sci:NumericAxisViewModel} which doesn’t work because it doesn’t derive from “FrameworkElement” and <x:Type sci:NumericAxisForMvvm} doesn’t style either.

I’m just not sure how to best make the NumericAxes styled.

Thanks!

0 votes
250 views

Do scichart supports microsoft blazor ?
If yes, Any examples available ?

  • Abhilash R asked 2 months ago
  • last active 2 months ago
0 votes
0 answers
271 views

I am tryng to use ScichartScrollbar,and in trouble.

When view port range is beyond data binded with scrollbar and center of the scrollbar is clicked,data jumps horizontally.
please refer to the Picture below.
I used official sample program named SciChart_PerAxisScrollbar in the picture.
How can I stop this and scroll seamlessly?

0 votes
0 answers
183 views

Hi SciChart,

using the default RolloverModifier with CandleStick Charts will add a white circle at the candle’s close position. Is it possible to change this position to the high/low value of this candle? I’ve tried with a derived RolloverModifier and found the AttachRolloverMarker function to override. But I’ve absolutely no idea how to proceed from there on.

Any help is greatly appreciated.

Thanks,

René

0 votes
254 views

Hi,

we updated to version 6.3 and since then the VisualXcceleratorEngine is no longer used. The fallback type ‘HighQualityRenderSurface’ is always used. What about the auto-select feature for the best GPU?

This is the code we use to check whether DirectX is used:

using (var sciChartSurface = new SciChartSurface())
{
    sciChartSurface.OnRenderException += OnSciChartRenderException;

    VisualXcceleratorEngine.SetIsEnabled(sciChartSurface, true);
    VisualXcceleratorEngine.SetFallbackType(sciChartSurface, typeof(HighQualityRenderSurface));
    VisualXcceleratorEngine.SetDowngradeWithoutException(sciChartSurface, false);
    VisualXcceleratorEngine.SetEnableImpossibleMode(sciChartSurface, true);

    if (sciChartSurface.RenderSurface.GetType() == typeof(VisualXcceleratorRenderSurface))
    {
        // DirectX is enabled!
        retval = true;
    }
    else
    {
        // Restart 2D engine with D3D9   
        VisualXcceleratorRenderSurface.RestartEngineWith(DirectXMode.DirectX9c);

        // For 3D Charts only: Restart 3D engine with D3D9
        //Viewport3D.Restart3DEngineWith(DirectXMode.DirectX9c, FullScreenAntiAliasingMode.None, true);

        VisualXcceleratorEngine.SetIsEnabled(sciChartSurface, true);
        VisualXcceleratorEngine.SetFallbackType(sciChartSurface, typeof(HighQualityRenderSurface));
        VisualXcceleratorEngine.SetDowngradeWithoutException(sciChartSurface, false);
        VisualXcceleratorEngine.SetEnableImpossibleMode(sciChartSurface, true);

        if (sciChartSurface.RenderSurface.GetType() == typeof(VisualXcceleratorRenderSurface))
        {
            // DirectX is enabled!
            retval = true;
        }
    }

    sciChartSurface.OnRenderException -= OnSciChartRenderException;
}

What can I do?

Regards

  • Tobias asked 2 months ago
  • last active 2 months ago
0 votes
0 answers
197 views

Hi,

Using a tooltip with a LineSeries with an Logarithmic Y-axis, seem to give widely inaccurate results.

The series is as follows:

double[] x = new double[] { 1, 1.0e1 , 1.0e2 };
double[] y = new double[] { 615.9, 275.6197, 11.05376};

Using a CursorModifier as follows:

<s:CursorModifier ShowAxisLabels="True" UseInterpolation="True" SnappingMode="CrosshairToSeries" ShowTooltip="True"/>

The expected behaviour would be for the Crosshair to follow the curve, but for some reason it’s some way off. It looks as if it’s following Y-values which are somewhat truncated. X-values are fine for some reason.

Is there are a way to increase the resolution of the Y-values so the user gets the correct value when using a tooltip.

0 votes
0 answers
212 views

We’re using ReactiveUI and bindings in code-behind. We’re now upgrading from SciChart v3 to v6 and we’re wondering how to use the SeriesBinding in code-behind like this:

public partial class BarChartView : ReactiveUserControl<sBarChartViewModel>
{
    public BarChartView()
    {
        InitializeComponent();

        this.WhenActivated(disposable =>
        {
            this.OneWayBind(ViewModel,
                            vm => vm.SeriesSource,
                            view => view.BarChart.SeriesSource)
                .DisposeWith(disposable);

            this.OneWayBind(ViewModel,
                            vm => vm.LabelProvider,
                            view => view.FaciesAxis.LabelProvider)
                .DisposeWith(disposable);

            this.OneWayBind(ViewModel,
                            vm => vm.TooltipDataContext,
                            view => view.TooltipModifier.TooltipLabelDataContextSelector)
                .DisposeWith(disposable);

            this.OneWayBind(ViewModel,
                            vm => vm.XAxisRange,
                            view => view.FaciesAxis.VisibleRange)
                .DisposeWith(disposable);
        });
    }
}

Now the IChartSeriesViewModel and SciChartSurface.SeriesSource is deprecated so we have to move to IRenderableSeriesViewModel instead and then bind to SciChartSurface.RenderableSeries. But how can we convert from IRenderableSeriesViewModel to IRenderableSeries here?

0 votes
0 answers
202 views

Dear sir,

I’m trying SciChartSurface.
I wanna have a Chart updating per minute,
X-Axis means time, Y-Axis means products,
and every product has a multi-color bar which I can build it in the viewmodel.
Every product’s name should be the position between two lines.
Can SciChart do that…? Cause I’m using surface with numericAxis, but the product name is always next to the line, not between two lines.

0 votes
0 answers
202 views

I would like to know if there is an option to create chart with an arc lines grid in addition to the regular grid.
I’ve attached the sample. the question is referred to the white arc lines.
the blue lines need to be paint too.
all of this lines need to be as background, the same size as display in the picture.

0 votes
302 views

Getting an exception when trying to add tooltip template MVVM style to a blox plot. The chart also contains a scatter plot which should not be styled. That works fine, hoverwer, when I move the mouse over a box in the box plot, the exception is thrown.

I want to keep the styling, I just want to write something different than the default text.

The template:

  <DataTemplate DataType="scalarPlot:ToolTipData" x:Key="BoxSeriesTooltipTemplate">
    <TextBlock>
      <Run Text="Max:      " />
      <Run Text="{Binding Maximum}" />
      <LineBreak />
      <Run Text="P90:       " />
      <Run Text="{Binding P90}" />
      <LineBreak />
      <Run Text="Median: " />
      <Run Text="{Binding Median}" />
      <LineBreak />
      <Run Text="P10:       " />
      <Run Text="{Binding P10}" />
      <LineBreak />
      <Run Text="Min:       " />
      <Run Text="{Binding Minimum}" />
      <LineBreak />
    </TextBlock>
  </DataTemplate>

The binding:

      <Style TargetType="s:BaseRenderableSeries" x:Key="BoxSeriesStyle">
        <Setter Property="s:TooltipModifier.TooltipTemplate" Value="{StaticResource BoxSeriesTooltipTemplate}"/>
        <Setter Property="s:TooltipModifier.IncludeSeries" Value="True"/>
      </Style>

The modifier:

<s:SciChartSurface.ChartModifier>
      <s:ModifierGroup>
        <s:TooltipModifier IsEnabled="True" ShowTooltipOn="Always" ReceiveHandledEvents="True" TooltipLabelDataContextSelector="{Binding ToolTipDataContext}"/>
      </s:ModifierGroup>
    </s:SciChartSurface.ChartModifier>

The view model:

    private static IRenderableSeriesViewModel CreateBoxPlotViewModel(BoxPlotDataSeries<int, float> boxPlotDataSeries)
    {
        return new BoxPlotRenderableSeriesViewModel
        {
            DataSeries = boxPlotDataSeries,
            Stroke = Colors.SteelBlue,
            Fill = new LinearGradientBrush(Colors.White, Colors.LightSteelBlue, new System.Windows.Point(0, 0), new System.Windows.Point(0.5, 1)),
            StyleKey = "BoxSeriesStyle"
        };
    }

The data context selector:

    public Func<SeriesInfo, object> ToolTipDataContext
    {
        get
        {
            return seriesInfo =>
                   {
                       return seriesInfo switch
                       {
                           BoxPlotSeriesInfo boxInfo =>
                               new ToolTipData
                               {
                                   Fill = seriesInfo.Fill,
                                   Stroke = seriesInfo.Stroke,
                                   Maximum = (float) boxInfo.MaximumValue,
                                   P90 = (float) boxInfo.UpperQuartileValue,
                                   Median = (float) boxInfo.MedianValue,
                                   P10 = (float) boxInfo.LowerQuartileValue,
                                   Minimum = (float) boxInfo.MinimumValue
                               },
                           _ => seriesInfo
                       };
                   };
        }
    }
  • Tore Munch asked 2 months ago
  • last active 2 months ago
0 votes
0 answers
221 views

Hello!

I have data to display XyDataSeries, they have parameters: SeriesName and Tag. I want to bind the text of the tooltip to the Tag parameter, but for some reason an error pops up. Everything works correctly with the SeriesName.
I understand this is due to the data type, Tag-object, SeriesName-string. But how do I properly convert to the desired type, or is this not the problem?

When installing the vertical slice with the Tag parameter instead of SeriesName, errors occur:
The Tag property was not found for an object of the XySeriesInfo type.
Can’t find the control FrameworkElement or FrameworkContentElement for the target element.

0 votes
276 views

Hi,

We would like to add a vertical line on the month end, and display CategoryDateTime axis label as DD (instead of HH:MM) on the month end date.

We would like to avoid using vertical line annotations (read somewhere in the forum that they are WPF elements, and can potentially make chart slower).

I have tried going through the LabelProvider classes, but don’t see a concrete example on how it should work when we apply zoom in zoom out – We would like to keep existing axis labeling behavior intact.

Regards,
Vinay

0 votes
253 views

Hi,

is it possible to have same colors on my volume chart based on OHLC chart (red Green)? One option I see is to create a dependency property, and bind to OHLC Series data source to my VolumePalletteProvider? Is there any pre-existing way, without requiring me to bind to OHLC Series source?

public class VolumePallettProvider : IStrokePaletteProvider, IFillPaletteProvider
{
    Color _sbC = Colors.LightPink;
    SolidColorBrush _sb = Brushes.Transparent;

    public void OnBeginSeriesDraw(IRenderableSeries series)
    {
        _sbC = (Color)ColorConverter.ConvertFromString("#FF713232");
        _sb = (SolidColorBrush)new BrushConverter().ConvertFromString("#FFB75252");
    }

    public Brush OverrideFillBrush(IRenderableSeries rSeries, int index, IPointMetadata metadata)
    {
        var series = rSeries.DataSeries as XyDataSeries<DateTime, double>;
        var value = null != series ? series.YValues[index] : 0;
        value = !Double.IsNaN(value) ? value : 0;
        if (value < 0)
            return _sb;
        return null;
    }

    public Color? OverrideStrokeColor(IRenderableSeries rSeries, int index, IPointMetadata metadata)
    {
        var series = rSeries.DataSeries as XyDataSeries<DateTime, double>;
        var value = null != series ? series.YValues[index] : 0;
        value = !Double.IsNaN(value) ? value : 0;
        if (value < 0)
            return _sbC;
        return null;
    }
}
0 votes
228 views

I am in process of trying to upgrade scichart on a wpf project from 5.4 to 6.2. Before I created a class like below to override what the column width would be. Now it state that FastColumnRenderableSeries does not have a method called GetColumnWidth to override. How can I do same thing with newer version? Thanks.

public class ConstantColumnRenderableSeries : FastColumnRenderableSeries
{
    public static readonly DependencyProperty ColumnWidthProperty =
        DependencyProperty
            .Register("ColumnWidth",
                typeof(IComparable),
                typeof(ConstantColumnRenderableSeries),
                new PropertyMetadata(default(IComparable), OnInvalidateParentSurface));

    public IComparable ColumnWidth
    {
        get => (IComparable) GetValue(ColumnWidthProperty);
        set => SetValue(ColumnWidthProperty, value);
    }

    protected override double GetColumnWidth(IPointSeries points, IRenderPassData renderPassData)
    {
        return ConvertToDouble(ColumnWidth);
    }

    private static double ConvertToDouble(IComparable comparable)
    {
        switch (comparable)
        {
            case null:
                return 0;
            case DateTime time:
                return time.Ticks;
            case TimeSpan span:
                return span.Ticks;
            default:
                return Convert.ToDouble(comparable, CultureInfo.InvariantCulture);
        }
    }
}
  • John asked 3 months ago
  • last active 3 months ago
0 votes
232 views

Dear SciChart people,

when trying to export a SciChartSurface instance present in a view (i.e. modified by zoom and series visibility settings etc. done by the user in the UI), it seems that its member functions
ExportToFile
may only be called from the UI thread – invocations from a background thread yield an InvalidOperation exception

So for the period of exporting, the application stays unresponsive even when “useXamlRenderSurface=false” is set in the call.

This does not change when trying to clone the surface, using a derived SciChartSurface class (still in in the view) that allows for cloning (cf . the SciChartEx class in the “CreateAnnotationsDynamically” SciChart example): calling CreateCloneSurfaceInMemory is still only allowed on the UI thread.
If one accepts this, but tries to continue with a background thread on the cloned surface’ s ExportToFile instance, it still mandates using the UI thread, so no escape …

Any ideas to go away from the UI thread in this scenario?

Thanks a lot.

0 votes
0 answers
201 views
.

Problem was a mistake on my side, please remove this question.

  • T0 bi asked 3 months ago
  • last active 3 months ago
0 votes
251 views

Is there an efficient way to append a subset of an array to a DataSeries? Manually looping with Append is slow (as expected). Iterating over an IEnumerable introduces overhead. I’ve read in the performance tips and tricks section that “Arrays have the biggest impact as these can be indexed using unsafe code”. The help documentation doesn’t list an Append overload specifically for an array so I assume the type is checked within the method.

I am reusing arrays whenever possible; however, my arriving data is not always the same length. In order to reduce allocations and garbage collection, I make use of Memory, Span, and ArraySegment elsewhere in my project. This allows me to pool and reuse memory. I have not found any DataSeries.Append overloads that would accept any of these types or otherwise allow me to specify the usable range of the array. Please let me know if I’ve overlooked something.

Thank you.

0 votes
302 views

Hi.

In my application every series (FastLineRenderableSeries) has it’s own y axis (e.g. surface with 3 serieses will have 3 Y axes). When series is created I’m creating NumericAxis and adding it to YAxes collection. So my chart surface declared as follows (simplified view):
<s:SciChartSurface>
<s:SciChartSurface.XAxis>
<s:DateTimeAxis />
</s:SciChartSurface.XAxis>
<s:SciChartSurface>

Problem 1: when I do not declare YAxis in xaml I have problem with VerticalSliceModifier: when slice is added by user on surface the crosspoint with series is positioned correctly, but slice vertical line itself is drawn on the left side of surface and positioned correctly on some redraw (e.g. panning).
enter image description here

I found out that VerticalSliceModifier does not work properly if Axis is not declared, so I declared it:
<s:SciChartSurface.YAxis>
<s:NumericAxis Visibility="Collapsed"/>
</s:SciChartSurface.YAxis>

Now VerticalSliceModifier works fine, but now we come to problem 2.
Problem 2: when YAxis declared with Visibility=”Collapsed” the chart surface squares gets wrong color (look at blinks on panning).
enter image description here

So I’ve got stuck in search of magic combination when everything works as expected :-).

0 votes
0 answers
253 views

Hello, I am working for making a 3d model animation, but the problem I encounter is class ObjectModel3D has a dependency property named PositionProperty , but it has not a dependency property named XProperty or ZProperty, so I can’t use BeginAnimation or StoryBoard.Begin Class.

for StoryBoard Class, my code is:

_3dObject obj3d = new _3dObject();
         Vector3 vector3 = new Vector3();
         vector3.X = obj3d.ChassisModel.Position.X;

        var animationChassis = new DoubleAnimation()
        {
            From = obj3d.ChassisModel.Position.X,
            To = 100,
            Duration = new Duration(TimeSpan.FromSeconds(1))
        };

        Storyboard storyboard = new Storyboard();
        Storyboard.SetTarget(animationChassis,obj3d.ChassisModel);
        Storyboard.SetTargetProperty(animationChassis,new PropertyPath(ObjectModel3D.PositionProperty));
        storyboard.Children.Add(animationChassis);
        storyboard.Begin();

here Storyboard.SetTargetProperty(animationChassis,new PropertyPath(ObjectModel3D.PositionProperty)); is wrong because ObjectModel3D.PositionProperty can’t be applied.

for BeginAnimation, my code is :

TranslateTransform tt3D = new TranslateTransform();
        _3dObject obj3d = new _3dObject();
         var animationChassis = new DoubleAnimation()
        {
            From = obj3d.ChassisModel.Position.X,
            To = 100,
            Duration = new Duration(TimeSpan.FromSeconds(1))
        };

         obj3d.ChassisModel.RenderTransform = tt3D;

         tt3D.BeginAnimation(TranslateTransform.XProperty,animationChassis);

this code has no error(maybe), but it does nothing. I wanted to use TranslateTransform3D. but obj3d.ChassisModel.RenderTransform don’t correspond to TranslateTransform3D.

Do you have any thoughts about making an animation using ObjectModel3D or any other kind?
Please Help me!
Thanks!!

Update1
I’ve work on this for a whole day, I still didn’t find a way to animate a translation movement of 3d model.
I’m trying to add a dependency property to ObjectModel3D class.
if anyone has any idea, please bring it on.

Update 2
I doubt that ObjectModel3D could be used with DoubleAnimation or StoryBoard.
What I did is take a for loop to manipulate Position.X, and make sure to use second thread to do that.
PS : WPF is a bad platform for 3d model, U3D is better for C# user.

  • Jong Ming asked 3 months ago
  • last active 3 months ago
0 votes
371 views

Hello, I am looking for a solution about how to get a 3D model DLL, like Schichart did in the example:SciChart_AddObjectsToa3DChart, and the name of DLL is: SciChart.Examples.ExternalDependencies.
I wish I can also compile a 3d model into DLL, because if I import directly an Obj model, it will become a huge burden for WPF.
Please help me if you have some ideas. Thanks!

  • Jong Ming asked 3 months ago
  • last active 3 months ago
0 votes
0 answers
257 views

When I send the offline trial activation email it responds with “invalid username/password” despite me being able to sign in to the SciChart website with the same credentials.

0 votes
319 views

Hello,

On our SciChart’s XAxis we are using a NumericAxis and within the NumericAxis we bind to a LabelProvider. In the UI, this works perfectly and we get the XAxis appearing with the titles we desire (as strings writing over the numeric values 0, 1, 2, …). Meanwhile the YAxis doesn’t use any LabelProvider and stays numeric. The XAxis.LabelProvider is an IList of strings.

Although this works great in the UI, when I export the SciChart it does not pick up the LabelProvider and the exported image only contains the numeric values 0, 1, 2, … on the XAxis.

I do the export as following:

SciChartSurfaceBase.ExportToFile(filename, SciChart.Core.ExportType.Png, useXamlRenderSurface, exportedSize);

Is there a way to get the ExportToFile command to acknowledge the LabelProvider is there like it does with the UI?

Thank you!
Hannah

0 votes
290 views

Hi.

I use MouseWheelZoomModifier. If some modifier key pressed (Ctrl, Shift, Alt) it produces scroll instead of zoom. My X axis is styled as follows:

<Style TargetType="s:DateTimeAxis">
            <Setter Property="TextFormatting" Value="dd-MM-yyyy"/>
            <Setter Property="SubDayTextFormatting" Value="HH:mm:ss"/>
            <Setter Property="AutoRange" Value="Never"/>
            <Setter Property="GrowBy" Value="0.1, 0.1"/>
            <Setter Property="AxisAlignment" Value="Bottom"/>
            <Setter Property="VisibleRangeLimitMode" Value="MinMax"/>
            <Setter Property="VisibleRange" Value="{Binding Mode=OneWay, RelativeSource={RelativeSource Mode=Self}, Path=VisibleRangeLimit}"/>
        </Style>

VisibleRangeLimit is set in code behind. So as you can see X axis can not go out of VisibleRangeLimit. So we came to my problem: with MouseWheelZoomModifier if I hold Ctrl button and scrolling, when X axis comes to limit it starts to zoom X axis.
The same happens with ZoomPanModifier, but in ZoomPanModifier it can be disabled by setting ClipModeX=”ClipAtExtents”, so when you approaches to the border and continue panning it simply do nothing – that’s what behavour I need in MouseWheelZoomModifier with Ctlr key pressed. I could not find anything like this in MouseWheelZoomModifier. Any ideas?

0 votes
0 answers
0 views

Histogram statistics: if negative numbers appear when xaxis is positioned on the left, why is it on the top? The integers are below, which is not what we want. Please tell me how to revise it. It’s urgent

Please refer to Fig
The effect we want is that the negative number in the red area is below and the integer in the white area is above. How can we modify it?

0 votes
285 views

Hello,

I am using the BrushAnnotation and it works fine except that the
mouseover events seems to happen too soon.
I mean that when the mouse is close to the BrushAnnotation, but not on it,
the mouse cursor changed and I can drag the BrushAnnotation.
It happens for all lines but especially for shapes with many segments which
are closed to each other, see attached file ‘MouseOver event too soon (my application).png’.
I saw something similar in your ‘Trade Annotation’ example ,
it happens when I used the Tools=>Pointer, see attached figure ‘MouseOver event too soon (from Scichart example).png’.
Can I changed the distance from which the mouseover event starts?

Best regards,
Eyal

  • Eyal Nevo asked 3 months ago
  • last active 3 months ago
0 votes
303 views

Hello,

How can I make the XY coordinate to be symmetrical and stay
symmetrical also after zooming.
That is including the case the user is zooming by selecting unsymmetrical area (rectangle ).
In symmetrical XY both axis have the same scale, meaning the real distance on the screen of 1 in the X axis is exactly the same as 1 in the Y axis.
One of the results of symmetrical XY axis is the grid lines creates squares instead of rectangles.
See the attached figure for example of symmetrical XY axis.

Regards,
Eyal

  • Eyal Nevo asked 3 months ago
  • last active 3 months ago
0 votes
311 views

I’ve been asked to create a chart where the gridlines are always in the same position regardless of scale/zoom. When the user performs a zoom, I will update a textbox else where on the app (not on the chart, there are no axis labels) with the current value between each tick. The further in you zoom, the small the value is between each tick/gridline.

They also want zoom to be handled by two buttons on the screen, outside of the chart.

So, I’ve found the MVVM implementation for the Axes. I have created the observable collections an bound them up. I’m planning on handling the button commands, zooming the chart, and then redrawing the axis by modifying the AxisViewModel collection from my control view model.

Am I on the right track? If so, my question is, how do I implement the zoom using MVVM?

I see a lot of documentation on customizable ChartModifiers, but I’m not seeing anything about using them in an MVVM environment. Do they follow the same paradigm as the Axes and RenderableSeries? An observable collection?

How do I take a command from an external button and reroute it to zoom the chart in an MVVM environment?

0 votes
303 views

I have a FastLineRenderableSeries, sorted data is added in XValues (datetimeaxis) and YValues, Everything works well until date changes, at exactly 00:00:00 points are not connected properly. Please see the attached image.

  • Bilal Maan asked 4 months ago
  • last active 4 months ago
0 votes
314 views

I’m wanting to apply an AxisLabelContainerStyle and AxisLabelTemplate to my YAxes which are of type NumericAxisViewModel.

My style and template:

<Style TargetType="{x:Type sci:AxisLabelControl}" x:Key="CursorAxisLabelStyle">
        <Setter Property="Background" Value="Black" />
    </Style>

<DataTemplate DataType="{x:Type sci:AxisInfo}" x:Key="CursorNumericAxisLabelTemplate">
        <Border BorderBrush="White" BorderThickness="1">
            <TextBlock Foreground="White" Margin="2" Text="{Binding DataValue, StringFormat={}{0:0.0}}" />
        </Border>
    </DataTemplate>

And I’ve tried the following with both TargetTypes NumericAxis and NumericAxisForMvvm. Using NumericAxisViewModel as the TargetType gives the error: “must derive from FrameworkElement or FrameworkContentElement.”

<Style TargetType="{x:Type sci:NumericAxis}">
        <Setter Property="sci:CursorModifier.AxisLabelContainerStyle" Value="{StaticResource ResourceKey=CursorAxisLabelStyle}" />
        <Setter Property="sci:CursorModifier.AxisLabelTemplate" Value="{StaticResource ResourceKey=CursorNumericAxisLabelTemplate}" />
    </Style>

But neither of the two types (NumericAxis and NumericAxisForMvvm) seems to take on the style and template.

My XAxis is a TimeSpanAxis and the styles work just fine when applied there. (I have a different AxisInfo DataTemplate for the TimeSpanAxis.)

Any ideas on how I can apply those styles and templates to my YAxes? Thanks!

  • Greg Knox asked 4 months ago
  • last active 3 months ago
0 votes
330 views

I want to reach 2 specific points:
1. Bar Chart – chart with view like digital chart but with centering like column chart. I cant use any of these because with first I cant centering point mark and with second I cant disable or change visibility of columns border.
2. Custom labels for one or more axis. For example, I have uniquely defined and limited range of double values for axis and I want to represents this values on axis labels as spcific text by relation value->string.
You can see example in the attahcments.
Is this even possible? And if possible, how can I achieve this?

0 votes
0 answers
288 views

Hello,
how can I offset the origin coordinate (0,0 – top left) of a BoxAnnotationViewModel to (0.5, 0)? Basically what I have is a path in my BoxAnnotation that describes an arrow and I want to set the arrow tip to a specific x position in my chart.

  • Roland D asked 4 months ago
  • last active 4 months ago
0 votes
312 views

From example, I know I can bind and generate X Y axes in view model.
I want the left and right Y axes value are exactly the same and just use label provider to change the

I can find something similar in forum.
https://www.scichart.com/questions/wpf/faq-how-to-have-two-yaxis-on-left-and-right-with-the-same-visiblerange-mirrored-yaxis

But I am not sure how to do the same thing using axisviewmodel

xaml:

view model

       public  ObservableCollection<IAxisViewModel> YAxes {get; set;}

       YAxes = new ObservableCollection<IAxisViewModel>();
       var yNumAxis = new NumericAxisViewModel
       {

            AutoRange = AutoRange.Always,
            DrawLabels = true,
            AxisAlignment = AxisAlignment.Left,
            TickProvider = new CustomTickProvider(5),
            TextFormatting = "0.0#",
            GrowBy = new DoubleRange(0.1, 0.1)
        };

        YAxes.Add(yNumAxis);

        var yAxis2 = new NumericAxisViewModel
        {
            Id = "SecondaryAxis",
            AutoRange = AutoRange.Always,
            DrawLabels = true,
            AxisAlignment = AxisAlignment.Right,
            TickProvider = new CustomTickProvider(5),
            LabelProvider = new CustomLabelProvider(10),
            TextFormatting = "0.0#",
            GrowBy = new DoubleRange(0.1, 0.1)
        };


        YAxes.Add(yAxis2);
0 votes
312 views

Hi, we got performance problems with 3D chart on UniformGridDataSeries3D when size of mesh is bigger than 400×400.
The rendering is fine, but it have weird behavior when controlling from mouse: rendering is lags behind mouse movement and it’s hard to rotate the surface accurate.

To reproduce it you can use SciChart_SurfaceMesh3DNonUniformData scichart example and set the surface size to 500×500 for example.

Perfectly we are planning to use 1500×1500 mesh but currently we had to downsample it to 250×250.

Is there is some workaround for this?
Thanks

1 vote
0 answers
342 views

Hi Sci Chart,

I am using WPF with MVVM.

What i want to achieve is by reading the rollover modifier current hit point data, when user click left click, i want to add VerticalSliceModifier in the graph based on the hit point.

Attach is my code from xaml and viewmodel.

I have two issues which are:
“if (DistanceSeriesData.SeriesInfo.Count > 0)”, i always get zero count of seriesinfo.

In DistanceVerticalLines?.Add(new VerticalLineAnnotation(), the added Distance Vertical Lines data did not reflect in graph.

0 votes
355 views

I downloaded your SciChart trial version. The download placed all you assemblies into:

C:\Program Files (x86)\SciChart\SciChart SDK\Lib\net452

and duplicated the assemblies into:

C:\Program Files (x86)\SciChart\SciChart SDK\Lib\netcoreapp3.0.

Then I download the SciChart examples from GitHub directly into Visual Studio and it created a repository at

C:\Users\Dell\source\repos\SciChart.Wpf.Examples\Examples

Then I tried to compile but the dependencies were not resolved in the project SciChart.Exmaples.ExternalDependencies. I get yellow warning signs next to all your SciChart assemblies (e.g. SciChart.DirectX). Please advise.

0 votes
433 views

Hi, I found that the text formatting of discontinous DateTimeAxis is not working in WPF
I put the following format in DateTimeAxis and it displays correctly but not in discontinous DateTimeAxis
TextFormatting=”dd-MM”
SubDayTextFormatting=”HH:mm”

Showing 1 - 50 of 3k results