Pre loader

Forums

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

3 votes
18k views

I am using MVVM and am having problems and need you to have a quick look please as this is substantial

1)Run Solution

2)Click on Load, browse to folder Configuration\20120814 and select OK

3) 6 data series will load, the program then adds random data for each trace. The point count for each trace is shown on the form

4) After a few minutes, the update speed of the points reduces (this is not intended) the counter should update each second

5) when the count reaches about 16000 the program is pretty well locked up and non responsive.

It may well be a problem that I have introduced, at least I hope it is, as our intended application will be using very large data sets
Please could you have a look ASAP and get back to me

You have also not replied to the annotation problem I explained in another thread, I sent you example code to show you the problem

Thanks

  • wilx asked 11 years ago
  • last active 9 months ago
1 vote
18k views

I am considering applying server-side licensing for my javerScript application.

In the document below, there is a phrase “Our server-side licensing component is written in C++.”
(https://support-dev.scichart.com/index.php?/Knowledgebase/Article/View/17256/42/)

However, there is only asp.net sample code on the provided github.
(https://github.com/ABTSoftware/SciChart.JS.Examples/tree/master/Sandbox/demo-dotnet-server-licensing)

I wonder if there is a sample code implemented in C++ for server-side licensing.

Can you provide c++ sample code?
Also, are there any examples to run on Ubuntu?

  • srillaert asked 10 years ago
  • last active 10 years ago
2 votes
18k views

Hi,
I have some XyDataSeries<DateTime, double> showing some data on my chart. Also I have 2 vertical line annotations (red and blue) where I know the two DateTime values.

Is there a effective way to get the double values between this range of each XyDataSeries.

Regarrds Markus

0 votes
18k views

I am using WPF with SciChart version 1.3.1.1107 and the MVVM pattern.
I am using a series of modifiers like the ZoomPanModifier in a similar manner to samples that you provide that I load from an attached behaviour.

I am adding a feature to adjust the visible range when new data points arrive that would not otherwise be visible; however, if a user pans the surface I want to detect that so I can stop adjusting the visible range.

My thinking is that I need to capture a mouse event either associated with the chart to the current modifier; however, nothing I seem to do allows me to capture a mouse event. If their is a better way I am open to that as well.

0 votes
17k views

The default appearance for the vertical line annotation is for the series name and Y value to be displayed next to the data point. Is it possible to move this display elsewhere? On sine wave type data it doesn’t work so good because the text box moves up and down so much as the user scrolls the line annotation. Even just putting it at the bottom of the chart right above the X axis would be a huge improvement.

I assume this is a ControlTemplate modification type issue but I don’t know where to start looking.

0 votes
17k 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 years ago
  • last active 7 years ago
1 vote
17k views

Hello,
I’m using your package for price charting. And I need to put on one bar (or candlestick) several markers (for example several dots with different colours and sizes). Also sometimes I need to change size on some of these markers. Now I am doing this by putting CustomAnnotations. Is there a way to plot the same with for example XyScatterRenderableSeries to increase drawing speed?

Best regards,
Roman.

  • Roman asked 9 years ago
  • last active 9 years ago
2 votes
17k views

Hi guys,

I’m tackling a difficult problem in my solution here. Our chart will allow users to add as many as 50 different series at any one time.

As well as this – the user will be able to specify the RenderableSeries (Chart Type) of each of these between; column, line and mountain.

One solution is to replicate the method found in your own SciChart SciTrader demonstration (in which each type of RenderableSeries is added to the xaml once for each data series, they share a DataSeries and then the Visibility property within the style is managed to only show the one the user requests), but this would require 150 (50 placeholders for 50 possible series * 3 definitions per series) definitions of different RenderableSeries, each with their own Style defined.

Is there any way to create a custom RenderableSeries that extends BaseRenderableSeries and add a DependencyProperty that allows a binding from the xaml to modify the type of RenderableSeries that is displayed?

Even better – is there a way to add RenderableSeries using MVVM (I noticed the add/remove dynamic series tutorial has a note to standby for such a tutorial). I will attempt to find a solution by going down this path as it sounds much less verbose.

Thanks in advance for all your help!
Miles

  • bstapylton asked 12 years ago
  • last active 1 year ago
1 vote
17k views

Hi,

I have a chart showing data sets composed of multiple renderable series. Each data set is displayed using one FastLineRenderableSeries and three XyScatterRenderableSeries. All four series show in the legend for each data set, but I would only like to show the FastLineRenderableSeries in the legend for each data set. How can I do this?

I’ve seen the legendModifier.GetLegendDataFor property, but that can only be set to show options from this enum

public enum SourceMode
{
    AllSeries = 0,
    AllVisibleSeries = 1,
    SelectedSeries = 2,
    UnselectedSeries = 3,
}

which aren’t what I need. Some kind of flag on the renderable series saying whether they should be shown in the legend, or some way to specify the items source for the legend would be good.

Thanks!

1 vote
17k views

I would like to show the Y values of the slice on a special panel. So far I have not yet found out how to disable the tooltips that appear next to the annotation line. I have tried to add a ToolTipOpening handler to the anntotated line, to the modifier and to the chart surface but it does not get called.

What should I do?

0 votes
17k views

Hi,

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

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

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

Any ideas?

  • Igor Peric asked 7 years ago
  • last active 7 years ago
2 votes
17k views

I’m trying out polar chart for my specific needs. In my scenario x-axis needs to display 0-360 (angle) values starting from bottom and going counter-clockwise so that 0 is at the bottom, 90 is at right, 180 is at the top and so on. Looking at polar chart default x-axis display it starts from right and go clockwise. Is there any way to change this behavior?

0 votes
17k views

Hello,
I would like to allow user click on Legend and highlight the corresponding Series on the chart but I don’t know if this feature is supported or not.

I tried to add mouse events to the Legend Modified but it seems like mouse events are not triggered

This is the simple code that I am using

<s:LegendModifier x:Name="chlLegend" ShowLegend="True" LegendPlacement="Top" Orientation="Horizontal" MouseDown="chlLegend_MouseDown" ScrollViewer.HorizontalScrollBarVisibility="Auto" />

Before investigating more I would like to ask you if you have any hints which is the correct way to implement this behavior.
Is the LegendModifier suitable for this or should I override instead the Legend Control Template?

Thank you in advance for the support

1 vote
17k views

In my project the output panel showing the following binding errors

System.Windows.Data Error: 40 : BindingExpression path error: 'Exponent' property not found on 'object' ''DefaultTickLabelViewModel' (HashCode=56110932)'. BindingExpression:Path=Exponent; DataItem='DefaultTickLabelViewModel' (HashCode=56110932); target element is 'TextBlock' (Name=''); target property is 'Text' (type 'String')
System.Windows.Data Error: 40 : BindingExpression path error: 'HasExponent' property not found on 'object' ''DefaultTickLabelViewModel' (HashCode=56110932)'. BindingExpression:Path=HasExponent; DataItem='DefaultTickLabelViewModel' (HashCode=56110932); target element is 'TextBlock' (Name='exponent'); target property is 'Visibility' (type 'Visibility')
System.Windows.Data Error: 40 : BindingExpression path error: 'Separator' property not found on 'object' ''DefaultTickLabelViewModel' (HashCode=9331561)'. BindingExpression:Path=Separator; DataItem='DefaultTickLabelViewModel' (HashCode=9331561); target element is 'TextBlock' (Name=''); target property is 'Text' (type 'String')

my Line chart view code is here (I can’t able to make attachment)

<UserControl x:Class="Instron.Database.Presentation.DatabaseViews.Views.Visualization.LineChartView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:SciChart="clr-namespace:Abt.Controls.SciChart;assembly=Abt.Controls.SciChart.Wpf.3.0"
             xmlns:s="http://schemas.abtsoftware.co.uk/scichart" 
             mc:Ignorable="d" Width="Auto" Height="Auto"   
             xmlns:gbl="clr-namespace:Instron.Database.Presentation.DatabaseViews.Globalization">

    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="ContentControlDataTemplate.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>

    <Grid >

        <TextBlock  FontSize="24" 
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    TextWrapping="Wrap"   
                    Foreground="DimGray"
                    Visibility="{Binding IsAxisVisible,Converter={StaticResource  NotBooleanToVisibilityConverter}}" >
                    <TextBlock.Text>
                        <gbl:TranslateExtension>
                            <gbl:TranslateExtension.DesignTimeText>Either X or Y axis do not contain sufficient data</gbl:TranslateExtension.DesignTimeText>
                            <gbl:TranslateExtension.StringId>010000123</gbl:TranslateExtension.StringId>
                        </gbl:TranslateExtension>
                    </TextBlock.Text>
        </TextBlock>

        <s:SciChartSurface x:Name="sciChart" ChartTitle="{Binding ChartName}" Style="{StaticResource SciChartSurfaceStyle}"   Visibility="{Binding IsLegendVisible,Converter={StaticResource  BoolToVisibilityConverter}}" 
            GridLinesPanelStyle="{StaticResource GridLinesPanelStyle }"  RenderableSeries="{Binding RenderableSeries}"  Margin="0,-5,0,-10"
               DataContextChanged="sciChart_DataContextChanged" Rendered="sciChart_Rendered"  ViewportManager="{Binding ViewportManager}">

            <s:SciChartSurface.ContextMenu>
                <ContextMenu >
                    <MenuItem  Command="{Binding SaveAsCommand}">
                        <MenuItem.Header>
                            <gbl:TranslateExtension>
                                <gbl:TranslateExtension.DesignTimeText>SaveAs</gbl:TranslateExtension.DesignTimeText>
                                <gbl:TranslateExtension.StringId>010000126</gbl:TranslateExtension.StringId>
                            </gbl:TranslateExtension>
                        </MenuItem.Header>
                    </MenuItem>
                    <MenuItem  Command="{Binding CopyCommand}">
                        <MenuItem.Header>
                            <gbl:TranslateExtension>
                                <gbl:TranslateExtension.DesignTimeText>Copy</gbl:TranslateExtension.DesignTimeText>
                                <gbl:TranslateExtension.StringId>010000127</gbl:TranslateExtension.StringId>
                            </gbl:TranslateExtension>
                        </MenuItem.Header>
                    </MenuItem>
                    <MenuItem  Command="{Binding PrintCommand}">
                        <MenuItem.Header>
                            <gbl:TranslateExtension>
                                <gbl:TranslateExtension.DesignTimeText>Print</gbl:TranslateExtension.DesignTimeText>
                                <gbl:TranslateExtension.StringId>010000128</gbl:TranslateExtension.StringId>
                            </gbl:TranslateExtension>
                        </MenuItem.Header>
                    </MenuItem>
                </ContextMenu>
            </s:SciChartSurface.ContextMenu>

            <s:SciChartSurface.XAxis>
                <s:NumericAxis  AutoTicks="False" GrowBy="0.05, 0.05"  
                                DrawMajorGridLines="{Binding IsLegendVisible}"  DrawMinorGridLines ="False"
                                AxisTitle="{Binding XAxisName}"  TitleStyle="{StaticResource AxisTitleStyle}" TickLabelStyle="{StaticResource AxisLabelStyle}" 
                                LabelProvider="{Binding XLabelFormatter}"
                                MajorDelta="1" MinorDelta="0.2"
                                 />
            </s:SciChartSurface.XAxis>

            <s:SciChartSurface.YAxis>
                <s:NumericAxis  GrowBy="1, 1" TickLabelStyle="{StaticResource AxisLabelStyle}" DrawMajorGridLines="{Binding IsLegendVisible}"
                                AxisAlignment="Left"  DrawMinorGridLines ="False"
                                AxisTitle="{Binding YAxisTitle}" 
                                TitleStyle="{StaticResource AxisTitleStyle}" />
            </s:SciChartSurface.YAxis>

            <!--  Adding the ZoomPanModifier gives SciChart the ability to pan on mouse-drag  -->
            <s:SciChartSurface.ChartModifier>
                <s:ModifierGroup>
                    <s:XAxisDragModifier ClipModeX="ClipAtExtents"/>
                    <s:YAxisDragModifier ClipToBounds="True" />
                    <s:RubberBandXyZoomModifier x:Name="rubberBandZoomModifier" IsEnabled="True" IsXAxisOnly="False" ZoomExtentsY="False" IsAnimated="True"/>
                    <s:ZoomExtentsModifier x:Name="zoomExtentsModifier" ClipToBounds="True" ExecuteOn="MouseDoubleClick"/>
                    <s:LegendModifier x:Name="legendModifier" GetLegendDataFor="AllVisibleSeries" />
                </s:ModifierGroup>
            </s:SciChartSurface.ChartModifier>

        <s:SciChartSurface.Annotations>
                <s:CustomAnnotation>
                    <s:CustomAnnotation.ContentTemplate>
                        <DataTemplate>
                            <s:SciChartLegend  x:Name="legendControl" Margin="2,2" Orientation="Horizontal"  Background="Transparent" BorderThickness="0" ScrollViewer.VerticalScrollBarVisibility="Auto"
                                Visibility="{Binding IsLegendVisible,Converter={StaticResource  BoolToVisibilityConverter}}" 
                                LegendData="{Binding LegendData, ElementName=legendModifier,Mode=OneWay}" >

                                <s:SciChartLegend.Resources>
                                    <SciChart:ColorToBrushConverter x:Key="ColorToBrushConverter"/>
                                </s:SciChartLegend.Resources>
                                <s:SciChartLegend.ItemTemplate>
                                    <DataTemplate DataType="SciChart:XyzSeriesInfo">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="Auto" />
                                                <ColumnDefinition Width="Auto" />
                                            </Grid.ColumnDefinitions>
                                           <Rectangle Grid.Column="0"
                                                VerticalAlignment="Center"
                                                Stretch="Fill"
                                                Width="10"

                                                StrokeThickness="10"
                                                Stroke="{Binding SeriesColor,
                                                Converter={StaticResource ColorToBrushConverter}}" />
                                            <TextBlock Grid.Column="1" Foreground="Black" 
                                                Margin="2,0,15,0"
                                                HorizontalAlignment="Center"
                                                Text="{Binding SeriesName}" FontWeight="Normal"/>
                                            </Grid>
                                    </DataTemplate>
                                </s:SciChartLegend.ItemTemplate>
                            </s:SciChartLegend>
                        </DataTemplate>
                    </s:CustomAnnotation.ContentTemplate>
                </s:CustomAnnotation>
            </s:SciChartSurface.Annotations>
        </s:SciChartSurface>
    </Grid>
</UserControl>
  • Raghupathy asked 10 years ago
  • last active 9 years ago
1 vote
17k views

I made an example based on the “Vertically Stacked Axes” from SciChart Examples. The main difference is that I can add DataSeries / YAxes on the fly.

The problem is that when I set VisibleRange and VisibleRangeLimit it does not crop the trace (as you can see on the Tan traces that are drawn on the whole surface).

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

  • Jan Kaiser asked 10 years ago
  • last active 9 years ago
0 votes
17k views

If there a way to bind series color/thickness to a custom control so the line color and thickness changes dynamically when user select a different color/thickness? I will need use this with the MVVM dataseries API.

1 vote
17k views

Hello,

I have ClipModeX=”ClipAtExtents” on my ZoomPanModifier. I need the same behavior on the y-axis, but there is no “ClipModeY”.

How do I prevent y-axis data from panning off the chart?

Thanks,
Neville

0 votes
17k views

We were recently asked on priority support tickets ‘How do I ZoomExtents a SciChartSurface to a specific range, e.g. VisibleRangeLimit, when double clicking on the chart’.

For the benefit of our user-base our solution is below.

1 vote
17k views

Hi, I am displaying no of BoxAnnotation , I want to link some of the BoxAnnotation randomly .I want to perform the operaton on annotation with relation.When it move BoxAnnotation,related link should also move accordingly.I am also performing Y axis with yaxisID so Annotation also move to Y direction with Y axis.
Please help me out.
Thanks

1 vote
17k views

I am considering applying server-side licensing for my javerScript application.

In the document below, there is a phrase “Our server-side licensing component is written in C++.”
(https://support-dev.scichart.com/index.php?/Knowledgebase/Article/View/17256/42/)

However, there is only asp.net sample code on the provided github.
(https://github.com/ABTSoftware/SciChart.JS.Examples/tree/master/Sandbox/demo-dotnet-server-licensing)

I wonder if there is a sample code implemented in C++ for server-side licensing.

Can you provide c++ sample code?
Also, are there any examples to run on Ubuntu?

1 vote
17k views

hi, i have some issues with SciChartScrollbar control. i’m trying to use it like in the Custom Overview demo, but with possibility to contol zoom programmatically (by keyboard). So i bound SciChartScrollbar control’s property

Axis ="{Binding ElementName =XAxis}"

where XAxis is the axis from the top chart

     < s: SciChartSurface.XAxis >
        < s: NumericAxis x: Name ="XAxis"
                       DrawMinorGridLines ="True"
                       DrawMinorTicks ="True">
        </ s: NumericAxis >
    </ s: SciChartSurface.XAxis >

and then i change VisibleRange of top chart from code behind (previously i tried this without Scrollbar.SelectedRange)

        MainChartSurface.XAxis.VisibleRange.Min = Scrollbar.SelectedRange.Min = ((SpectraAnalysisTools )VM.AnalysisTools).ZoomMin;
        MainChartSurface.XAxis.VisibleRange.Max = Scrollbar.SelectedRange.Max = ((SpectraAnalysisTools )VM.AnalysisTools).ZoomMax;

eventually the top chart’s zoom works perfect but the bottom scrollbar moves only first time when value changed and never more again.
So my question is – what should i do to make the scrollbar control (like in Custom Overview demo) working with controlling from codebehind?

0 votes
17k views

Have a good day!

In the new SciChart version (5th august) I’ve got this result of painting line using palette provider (image 1). Is there any way to make it look like this (image 2)?

  • Egor asked 9 years ago
  • last active 9 years ago
1 vote
17k views

Hi,

I have a scichart surface defined in xaml like this,

<local:SciChartSurface x:Name="_ChartSurface"  Annotations="{Binding ChartAnnotations}">

        </local:SciChartSurface>

In the code behind I have ChartAnnotations defined as,

 public const string ChartAnnotationsPropertyName = "ChartAnnotations";
        private AnnotationCollection _ChartAnnotations = new AnnotationCollection();
        public AnnotationCollection ChartAnnotations
        {
            get { return _ChartAnnotations; }
            set
            {
                if (_ChartAnnotations == value)
                    return;

                _ChartAnnotations = value;
                RaisePropertyChanged(ChartAnnotationsPropertyName);
            }
        }

 public ViewModelExample()
{  
  ChartAnnotations.CollectionChanged += ChartAnnotations_CollectionChanged;    
}

 void ChartAnnotations_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
        {
            RaisePropertyChanged(ChartAnnotationsPropertyName);          
        }

Than in the code behind, I just initialize and add some annotations to the ChartAnnotations collection to populate my chart. The problem is that my Annotations property on the scichart surface is still null, and the RaisePropertyChanged() is not affecting the Bindings at all. I’m certain that the DataContext is set right as other stuff in the graph works fine. I works when I explicitly set the surface’s Annotations property with my ChartAnnotations collection, but obviously this is less than ideal.

Is there an additional step that I’m missing here?

Thanks

  • kewur asked 10 years ago
  • last active 10 years ago
0 votes
17k views

Hi Andrew

We would like to be able to set SuspendUpdates in an MVVM scenario as we are using ObservableCollection of IChartSeriesViewModel to drive chart datatemplates.

We are getting some flickering when updating multiple series on the chart due to y axis rescaling.

Is there a bindable property on the SciChartSurface we can use for this? Or do you have another approach?

Thanks in advance
Regards
Ian

  • Ian Carson asked 10 years ago
  • last active 9 years ago
0 votes
17k views

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

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

0 votes
17k views

Can you please provide some examples of how to alter the formatting of a DateTimeAxis axis. I’d like to show the date and the time component that also supports localization based on the user regional settings.

1 vote
17k views

I am adding charts with 10 million points.

With 40 million points the chart throws an OutOfMemoryException

In SciChart is there a limit on the number of points ? Or should I configure something?

  • I added 3 XyDataSeries<double, double> each with 10 million points. I get 7-8 FPS at the start, and 111-130 FPS when I zoom in.
  • I added 3 XyDataSeries<DateTime,Double> each with 10 million points: I get 2-3 FPS at the start, but when you zoom in the chart freezes.

Why such a difference if X data type is DateTime?

  • Nicholas asked 10 years ago
  • last active 10 years ago
0 votes
17k views

Hi,

I have a VerticalLineAnnotation that can be dragged over the chart by clicking and dragging on the line itself. (See attached image). The problem is, whenever I put the chart in front of a user, they try to drag by clicking on the label (the blue label with the time in the image).

How can I make this label draggable like the line?

Thanks.

1 vote
17k views

Hello. I need to provide custom point marker with height and width based on my data, but trying to implement BasePointMarker I have the center points but not the original data to make the width and height based in my original binding. Is there a solution to do that? Thank you.

Tommy Garcia.

0 votes
17k 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 7 years ago
  • last active 7 years ago
0 votes
17k views

Hi,

I would like to create a bitmap/png of the scichart surface.
How can i do this in MVVM?

I saw an example with a “ExportElementToPng(FrameworkElement element, string filename)” function.
This works in Code behind, but in mvvm I don’t have the SciChartSurface.

Thanks…

1 vote
17k views

Hello,

I have to draw vertical straight line and horizontal curved line. Here is the requirements,

  • Before two lines intersect they should draw as dashed lines
  • After two lines intersect they should draw as solid lines
  • Both the lines should be move by clicking mouse pointer
  • And background color of lines intersect area should be white, other places should be gray color

I could draw the vertical line using two VerticalLineAnnotations however I don’t know how to draw curved line and implement above requirements. Please refer the attached sample image file.

Thanks.

0 votes
17k views

Hi Guys,

I have successfully added text labels to my charts using ILabelProvider.

However, some of the charts are showing duplicate labels for each bar, and others are not showing the labels for all bars (even though there is space to do so).

Any idea how to fix these? See the attached images for more details.

Thanks in advance.
Andre.

  • andrecsa asked 8 years ago
  • last active 8 years ago
1 vote
17k views

Hi!

I would like to ask what is the best strategy to implement 1-to-many relationship between DataSeries and SciChartSurfaces, when charts are shown in a second window and presumably rendered in its UI thread.

Currently I have a root object in the main window that creates and carry updates for a single DataSeries. The object has a property that creates a new SciChartSurfaces instance programmatically everytime, as the property is read. As a chart is created, I assign the same DataSeries as source for chart’s RenderableSeries.

This approach allows me to multiple charts in the second window and all these chart share the same dataseries on the root object. However, I have some issues with flicking, re-rendering and updating. For example, only the most recently created chart redraws after updates in the dataseries. I use dataSeries.SuspendUpdates() and batch Append but I guess it works only for the last chart.

I attached here a screenshot showing what happening when the shared DataSeries is filled with random values in real-time.

Could you recommend something for this scenario?

Thanks in advance,

Ilia

  • corvex asked 10 years ago
  • last active 10 years ago
1 vote
17k views

Hi there,

I am currently evaluating SciChart for use within a new piece of software we are developing. One important feature that we need to provide is to be able to draw a polygon and determine which points are contained within it. Then the colour, visibility, etc of these points can be changed. I can see from your documentation that this could be achieved by creating a custom chart modifier to draw lines that make up the shape and then implement my own algorithm to determine which points are contained within it. Before I embark on this route, could you tell me if I have missed any implementation that already exists? Will the drawn polygon zoom and pan with the graph, therefore enclosing the same points?

Kind Regards,

Kathryn

1 vote
17k views

How can I only show Legends when the corresponding RenederableSeries is visible.
If the corresponding RenderableSeries is not visible then that Legend shouldn’t be shown.
Keep in mind my users will be able to hide and show RenderableSeries during runtime.

My xaml code is:

                                            <s:LegendModifier x:Name="legendModifier" ShowVisibilityCheckboxes="False" Orientation="Vertical" ShowLegend="{Binding ParentViewModel.ShowLegends, Mode=TwoWay}" Margin="10" />
                                        <s:SeriesSelectionModifier>
                                            <s:SeriesSelectionModifier.SelectedSeriesStyle>
                                                <Style TargetType="s:BaseRenderableSeries">
                                                    <Setter Property="StrokeThickness" Value="3"/>
                                                </Style>
                                            </s:SeriesSelectionModifier.SelectedSeriesStyle>
                                        </s:SeriesSelectionModifier>
3 votes
17k views

The issue I’m dealing with is that after setting up the SeriesSelectionModifier, I require a double-click (and a very, very precise double click, at that) to select a series. Naturally, this is also competing with the ZoomExtents() call that is the normal effect of a doubleclick.

<!-- Chart -->
        <scichart:SciChartSurface Grid.Column="1" Grid.Row="1" x:Name="sciChartSurface"
                                  SeriesSource="{Binding SeriesList, Mode=OneWay}"
                                  ChartTitle="{Binding Title}"
                                  >

            <scichart:SciChartSurface.XAxis>
                <scichart:NumericAxis x:Name="AxisX" Id="AxisX" AxisTitle="{Binding XTitle}" AxisAlignment="Bottom" />
            </scichart:SciChartSurface.XAxis>

            <scichart:SciChartSurface.YAxes>
                <scichart:NumericAxis x:Name="AxisY1" Id="AxisY1" AxisTitle="{Binding Y1Title}" AxisAlignment="Left"
                                      />
                <scichart:NumericAxis x:Name="AxisY2" Id="AxisY2" AxisTitle="{Binding Y2Title}" AxisAlignment="Right"
                                      IsEnabled="{Binding ShowY2Axis}"
                                      Visibility="{Binding RelativeSource={RelativeSource Self},
                                                           Path=IsEnabled,
                                                           Converter={StaticResource convBooleanToVisibility}}"
                                      />
            </scichart:SciChartSurface.YAxes>

            <!-- Modifiers -->
            <scichart:SciChartSurface.ChartModifier>

                <scichart:ModifierGroup>

                    <!-- TODO: Comment -->
                    <scichart:ZoomPanModifier ExecuteOn="MouseRightButton" />

                    <!-- TODO: Comment -->
                    <scichart:RubberBandXyZoomModifier IsEnabled="True" x:Name="rubberBandZoomModifier" IsXAxisOnly="False" ZoomExtentsY="False" IsAnimated="True"/>

                    <!-- TODO: Comment -->
                    <!--<scichart:RolloverModifier x:Name="rolloverModifier" DrawVerticalLine="False" UseInterpolation="True"  SourceMode="AllSeries" />-->

                    <!-- TODO: Comment -->
                    <scichart:CursorModifier x:Name="cursorModifer" SourceMode="AllSeries" UseInterpolation="True"/>

                    <!-- TODO: Comment-->
                    <scichart:ZoomExtentsModifier />

                    <!-- Exposes a LegendData property (of type ChartDataObject) which can be accesed via elementName from another control -->
                    <!-- ChartDataObject exposes a list of SeriesInfo -->
                    <scichart:LegendModifier x:Name="legend" GetLegendDataFor="AllSeries"/>
                    
                    <!-- Provides selection of series and custom styling options (to the selected series) -->
                    <scichart:SeriesSelectionModifier SelectedSeriesStyle="{StaticResource selectedSeriesStyle}" ExecuteOn="MouseLeftButton"
                                                      />
                    
                </scichart:ModifierGroup>
            </scichart:SciChartSurface.ChartModifier>

        </scichart:SciChartSurface>
0 votes
17k views

Do you know a good way to print the hole chart to a printer?
Our first solution is to create a PNG from the chart and paste it into a PDF. But I have to stretch/resize the PNG to the paper size.
It exist a good way to direct paint?

Thanks for helping?
Marcel

  • Marcel asked 12 years ago
  • last active 2 years ago
0 votes
17k views

Hi,

Can I write SciStockChart with DateTimeAxis like:

        <s:SciStockChart SeriesSource="{Binding ChartManager.ChartData, 
                                                UpdateSourceTrigger=PropertyChanged, 
                                                Mode=TwoWay}" 
                         x:Name="SciChart"
                         YAxes="{Binding ChartManager.YAxes}"
                         s:ThemeManager.Theme="Chrome">
            <s:SciStockChart.XAxis>
                <s:DateTimeAxis DrawMinorTicks="True" 
                                DrawMinorGridLines="True" 
                                VisibleRange="{Binding ChartManager.XVisibleRange, 
                                                       UpdateSourceTrigger=PropertyChanged, 
                                                       Mode=TwoWay}"
                                DrawMajorGridLines="True"/>
            </s:SciStockChart.XAxis>
        </s:SciStockChart>

because I have exeption “Axis type DateTimeAxis requires that DataRange and VisibleRange is of type Abt.Controls.SciChart.DateRange”. The XVisibleRange is a IRange type.

Thanks,
Arthur

2 votes
17k views

Hi folks,

I haven’t been able to produce scatter charts using a XyScatterRenderableSeries. To demonstrate, I took a sample project you sent me earlier and replaced one line as shown below:

_chartSeries = new ObservableCollection<IChartSeriesViewModel>();
//var renderableSeries = new FastLineRenderableSeries { SeriesColor = Colors.BlueViolet};
var renderableSeries = new XyScatterRenderableSeries { SeriesColor = Colors.BlueViolet};
_chartSeries.Add(new ChartSeriesViewModel(ds0, renderableSeries));

With the original FastLineRenderableSeries, I see the chart. But with XyScatterRenderableSeries, the data does not appear. (Annotations remain visible, of course.)

Am I doing something wrong, or does the ChartSeriesViewModel not work with scatter charts?

Thanks,
–George

  • yefchak asked 11 years ago
  • last active 9 years ago
3 votes
17k views

Hi,

When we have 9 horizontal gridlines, we would also like to see 9 yvalues.

Is it possible to also show 300 and -500 on Yaxis1 and 500 and -300 on Yaxis2
(see attachment)

Thanks and best regards,
Egbert

0 votes
17k views

I want to build a column chart but I got the following error:

ERROR TypeError: Cannot read property ‘append’ of undefined

The error happened in line #42.

My code:

export class OutputAmplitudeComponent implements OnInit, OnDestroy {

constructor(@Inject(SETTING_SERVICE) private settingService: SettingService, private cdr: ChangeDetectorRef) {}

ngOnInit() {        
                this.settingService.registerSetting(HarmonicAmpSetting).pipe(takeUntil(this.ngUnsubHarmonicData)).subscribe(setting => {
                    const OutputAmplitudeData = setting.value;

                    for (let x = 1; x < this.numberOfOutput; x++) {
                        if (this.OutputMode === 'Voltage') {
                            if (phaseNum === 1) {
                                this.ampSource.data[x-1].voltage1 = OutputAmplitudeData[x];
                            } else if (phaseNum === 2) {
                                this.ampSource.data[x-1].voltage2 = OutputAmplitudeData[x];
                            } else if (phaseNum === 3) {
                                this.ampSource.data[x-1].voltage3 = OutputAmplitudeData[x]; 
                            }
                        } else if (this.OutputMode === 'Current') {
                            if (phaseNum === 1) {
                                this.ampSource.data[x-1].current1 = OutputAmplitudeData[x];
                            } else if (phaseNum === 2) {
                                this.ampSource.data[x-1].current2 = OutputAmplitudeData[x];
                            } else if (phaseNum === 3) {
                                this.ampSource.data[x-1].current3 = OutputAmplitudeData[x];
                            }
                        }

                    }   
                    this.updateData();
                });
                this.sciChartInit();
            }   

updateData(){
    var phaseNum1 = [];
    var xData = [];
    for (let x = 1; x < this.numberOfOutput; x++) {
        if (this.ampSource.data != null && this.ampSource.data[x-1] != null) {
            phaseNum1[x - 1] = parseFloat(this.ampSource.data[x - 1].voltage1);
            xData[x - 1] = x;
            if (!isNaN(phaseNum1[x - 1])) {
                this.dataSeries1.append(x,x);
            } else {
                console.log("No num");
            }
        }
    }
}       

async sciChartInit() {

    const { wasmContext, sciChartSurface } = await SciChartSurface.create("chart");

    var phaseNum1 = [];
    var xData = [];
    this.dataSeries1 = new XyDataSeries(wasmContext);
    for (let x = 1; x < this.numberOfOutput; x++) {
        this.dataSeries1.append(x, x);
    }

    const xAxis = new NumericAxis(wasmContext);
    sciChartSurface.xAxes.add(xAxis);
    const yAxis = new NumericAxis(wasmContext);
    sciChartSurface.yAxes.add(yAxis);

    const rendSeries1 = new StackedColumnRenderableSeries(wasmContext);
    rendSeries1.fill = "#dc443f";
    rendSeries1.stroke = "green";
    rendSeries1.strokeThickness = 1;
    rendSeries1.dataSeries = this.dataSeries1;
    rendSeries1.stackedGroupId = "one";

    const verticallyStackedColumnCollection = new StackedColumnCollection(wasmContext);
    verticallyStackedColumnCollection.dataPointWidth = 0.5;
    verticallyStackedColumnCollection.add(rendSeries1);
    verticallyStackedColumnCollection.animation = new ScaleAnimation({ duration: 1000, fadeEffect: true });

    sciChartSurface.renderableSeries.add(verticallyStackedColumnCollection);
    sciChartSurface.chartModifiers.add(new ZoomExtentsModifier(), new ZoomPanModifier(), new MouseWheelZoomModifier());
    sciChartSurface.zoomExtents();

    sciChartSurface.chartModifiers.add(
        new LegendModifier({
            placement: ELegendPlacement.TopRight,
            orientation: ELegendOrientation.Horizontal,
            showLegend: true,
            showCheckboxes: true,
            showSeriesMarkers: true
        })
    );
    return { wasmContext, sciChartSurface };
}}

I don’t understand what is undefined and why.

Thank you.

  • ETS Ong asked 3 years ago
  • last active 3 years ago
1 vote
17k views

How can i wrap legend? if legend width is out of window.

  • Raghupathy asked 9 years ago
  • last active 9 years ago
0 votes
17k views

Hi

what I’m trying to achieve is displaying Candlesticks in a real time stock chart with added space between price bars. This empty space is very important as it’ll allow me to show further information regarding volumes per price level.

You can have a better understanding of what I’m trying to achieve by having a look at the following image.

I’m already at the point where I’m rendering both the candlesticks and labels correctly (via textannotations). It’s just that the whole graph is crowded and impossible to understand as annotations and price bars overlaps each other.

Thank you for your support,
Michele

0 votes
17k views

Hi,

I’m using SCiChart version 2.0 and trying to use the VisibleRange in realtime mode with zooming mode on DateTime axis. I want to when chart is zooming I see only zoom area, and chart shouldn’t be calculate VisibleRange, after that, when I’m double clicking on the surface, the chart should be continue working in realtime mode.

                var visibleMax = (DateTime)Properties.XAxis.VisibleRange.Max;
                var seriesMax = (DateTime)provider.DataSeries.XMax;
                if (_lastXMax != null && !Properties.XAxis.VisibleRange.IsZero)
                {
                    var diff = seriesMax.Subtract((DateTime)_lastXMax);

                    if (visibleMax + diff >= seriesMax)
                    {
                        var existingRange = (DateRange)Properties.XAxis.VisibleRange;
                        var newRange = new DateRange(existingRange.Min, visibleMax + diff);
                        Properties.XAxis.VisibleRange = newRange;
                    }
                }

                _lastXMax = provider.DataSeries.XMax;

But when I’m double clicking on the surface, the chart is froze(visible range doesn’t calculate correctly).. How can I calculate the VisibleRange correctly?

Thanks,
Arthur

1 vote
17k views

I have a WPF TextBlock control that I want to set the foreground color for based on the colors in the current SciChart theme (I want to make it the same color as, say, the axis titles). How do I access the color values for the current theme?

1 vote
17k views

How can i change default chart title style? like margin,font size etc

  • Raghupathy asked 10 years ago
  • last active 10 years ago
3 votes
17k views

I was trying to figure out why I couldn’t get minor tick marks to appear on my axes and then I realized it’s because of the theme I was using (BrightSpark). Just a heads up to anyone else who may run into this.

IMO themes should not hide chart features such as tick marks.

0 votes
17k views

Hi,

Is there a way to add an option to enable/disable scaling on the X-axis for the ZoomPanModifier? If not, is there a way to disable the scaling when panning beyond the min and max of the X-Axis?

Thanks,

Johnny

0 votes
0 answers
17k views

I have a collection of line charts that use FastLineRenderableSeries, and they all share the same View.xaml. I’m trying to change the font size for the Y-axis tick labels in the view but for some reason it gets ignored.

This is the view for the container for all the charts:

<UserControl x:Class="….SciCharts.MainView"
…..

<ItemsControl.ItemsPanel>

</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>

</ItemsControl.ItemTemplate>

And this is the view for each individual line chart:

<UserControl x:Class="SciCharts.LineChartView"

</UserControl.Resources>


<s:SciChartSurface.XAxes>

</s:SciChartSurface.XAxes>
<s:SciChartSurface.YAxes>

</s:SciChartSurface.YAxes>

I’m able to change the color and the anchor point using the code above, but the font size is ignored completely. Tried setting it under NumericAxis but same result. Please let me know what can I do to achieve this.
Thanks,

Showing 101 - 150 of 4k results