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

1 vote
9k views

Hi,

I observed a weird behavior with custom pointmarkers in SciChart. The issue is related to the previous one I reported, so I will not post my code snippets here, because it’s actually the same code as in the link. However, it is a different kind of issue, so I thought I should start a new thread.

Description (I attached a .gif to illustrate the issue):
Inside my RenderSurface, I have some pointmarkers which are filled with a transparent color and others which are filled with the color of the stroke of this pointmarker. Whether or not the pointmarker is filled depends on the IPointMetaData object attached to the point (and the meta data won’t change in any way).
When the chart gets displayed I have 4 pointmarkers visible. All 4 are filled, BUT only the leftmost SHOULD be filled. When I now scroll the chart to the right so that the leftmost pointmarker is not visible anymore the 3 remaining pointmarkers lose their fill and are now displayed as they should. Scrolling the first one back in the get filled again. I can only assume that this is maybe caused by SciChart cacheing some resources internally?

Important: I did only observe this issue with the Direct3D10RenderSurface. Everything works as expected with the other three surface types.

Edit:
seems like the gif animation does not work, so I added two more pictures.

DiaryPointMarker.cs

public class DiaryPointMarker : BasePointMarker
{
    private IList<IPointMetadata> _dataPointMetadata;
    IList<int> _dataPointIndexes = new List<int>();

    private readonly List<Point> _points = new List<Point>();

    public bool UseClustering { get; set; }
    public bool IndicateCommentWithFill { get; set; }

    private IPen2D _lowStrokePen;
    private IPen2D _midStrokePen;
    private IPen2D _highStrokePen;


    private IBrush2D _lowRatingColor;
    private IBrush2D _midRatingColor;
    private IBrush2D _highRatingColor;
    private IBrush2D _noCommentColor;

    public Brush LowRatingColor { get; set; }
    public Brush MidRatingColor { get; set; }
    public Brush HighRatingColor { get; set; }

    public override void BeginBatch(IRenderContext2D context, Color? strokeColor, Color? fillColor)
    {
        _dataPointMetadata = RenderableSeries.DataSeries.Metadata;

        _dataPointIndexes = new List<int>();
        _points.Clear();

        base.BeginBatch(context, strokeColor, fillColor);
    }


    public override void MoveTo(IRenderContext2D context, double x, double y, int index)
    {
        if (IsInBounds(x, y))
        {
            _dataPointIndexes.Add(index);
            _points.Add(new Point(x,y));
        }

        if (UseClustering)
        {
            base.MoveTo(context,x,y,index);
        }
    }

    public override void EndBatch(IRenderContext2D context)
    {
        if (UseClustering)
        {
            base.EndBatch(context);
        }
        else
        {
            Draw(context, _points);
            context.SetPrimitvesCachingEnabled(false);
        }
    }

    public override void Draw(IRenderContext2D context, IEnumerable<Point> centers)
    {
        TryCasheResources(context);

        var markerLocations = centers.ToArray();

        for (int i = 0; i < markerLocations.Length; ++i)
        {
            var diaryMetaInfo = _dataPointMetadata[_dataPointIndexes[i]] as DiaryPointMetaData;

            var center = markerLocations[i];

            var strokePen = diaryMetaInfo.Rating < 60
                ? _lowStrokePen
                : diaryMetaInfo.Rating < 80 ? _midStrokePen : _highStrokePen;
            var fillBrush = diaryMetaInfo.Rating < 60
                ? _lowRatingColor
                : diaryMetaInfo.Rating < 80 ? _midRatingColor : _highRatingColor;

            context.DrawEllipse(
                strokePen,
                IndicateCommentWithFill ? (String.IsNullOrEmpty(diaryMetaInfo.Comment) ? _noCommentColor : fillBrush) : fillBrush,
                center,
                Width,
                Height
                );
        }
    }

    private void TryCasheResources(IRenderContext2D context)
    {
        _lowStrokePen = _lowStrokePen ?? context.CreatePen(LowRatingColor.ExtractColor(), AntiAliasing, (float)StrokeThickness, Opacity);
        _midStrokePen = _midStrokePen ?? context.CreatePen(MidRatingColor.ExtractColor(), AntiAliasing, (float)StrokeThickness, Opacity);
        _highStrokePen = _highStrokePen ?? context.CreatePen(HighRatingColor.ExtractColor(), AntiAliasing, (float)StrokeThickness, Opacity);

        _lowRatingColor = _lowRatingColor ?? context.CreateBrush(LowRatingColor);
        _midRatingColor = _midRatingColor ?? context.CreateBrush(MidRatingColor);
        _highRatingColor = _highRatingColor ?? context.CreateBrush(HighRatingColor);
        _noCommentColor = _noCommentColor ?? context.CreateBrush(Color.FromArgb(0, 0, 0, 0));
    }
}
0 votes
0 answers
0 views
0 votes
19k views

Hi

I’m using auto range on a numeric axis. The data can be anything, but I want the axis to never have a range of less than 5.
E.g.: -100 to -95
E.g.: 17 to 22
E.g.: 0 to 5
etc.

What do I need to set to be able to do this? I have tried MinimalZoomConstrain and VisibleRangeLimit without success. Preferably something to set in XAML on my axis.

Thanks.

3 votes
17k 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 8 months ago
2 votes
19k views

Hi Guys

I am using an ItemsControl to display a collection of SciStockCharts. I want to be able to use a single SciChartOverview (not part of the Item Template) to set the visible range on all of the charts displayed in the ItemsControl. Is this possible and if so how would I go about achieving it.

Thanks in advance
Regards
Ian Carson

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

Scatter don’t show point marker if there is a only one value on the chart.
How can i solve that problem?

P.S: If i create my own renderiableseries class which only draw point markers, all works fine.
P.P.S I suppose that this behavior depenends on ReasmplingMode value.

0 votes
9k views

Hi! So I’ve got a quick question hopefully. I’m looking at the Bind Multiple Charts example that you provide and I’m wondering that if a dataset can be modified once its added to the observable collection. And if possible, how would it be done in the context of that example? Would the surface need to be updated?

1 vote
11k views

Hi,
i’ve a Example as Screenshot. What i want to do is to draw and move two Lines on Scichart and draw the difference between the two Lines on an Arrow.
Did anyone know a possibility to do this ?
Thanks in Advance

1 vote
10k views

Hi there,

Following your example “Change Render Series Type” I’d like to know if there is a straightforward way of extending it to include the XyScatterRenderSeries? I’d like to be able to have relatively the same styled appearance when selected and toggled between a FastLineRenderableSeries and an XyScatterRenderableSeries but am uncertain of how this would be accomplished. I apologize in advance if the answer is obvious, I’m quite new to this whole WPF, C#, MVVM thing and any help would be appreciated.

Matt

  • Matt Brown asked 9 years ago
  • last active 9 years ago
1 vote
10k views

Hi,

I ran into a problem with EllipsePointMarkers when I have a big amount of PointMarkers inside the Rendersurface. Here is a brief description of what I am trying to do:

  1. I created a custom BasePointMarker-derived class which draws Ellipses with a varying Color – depending on some threshold defined in the IPointMetaData implementation

  2. Everything works fine as long as the points are not tightly spaced between each other. That said, when I rescale my Rendersurface, the points get shifted so that the red points (who are below the threshold) will move up and suddenly green points are at minimum YValue positions.

I attached two pictures which hopefully illustrate my problem better than my words can do. Maybe somebody knows a workaround / fix for this problem. Any help is appreciated! ( I assume it has sth to do with the RescaleMode which prevents some points from being drawn to the surface and shifts others so that the Chart isn’t too dense)

Best,
Matthias

Update
Since Andrew suggested that the behavior comes from my custom code (which is hopefully true), here are the relevant parts:

DiaryView.xaml

<s:SciChartSurface Grid.Row="1" Grid.Column="0"
                       s:ThemeManager.Theme="Chrome"
                       Background="White" RenderableSeries="{s:SeriesBinding DiarySeriesViewModels}">
        <s:SciChartSurface.RenderSurface>
            <s:HighQualityRenderSurface/>
        </s:SciChartSurface.RenderSurface>
        <s:SciChartSurface.YAxis>
            <s:NumericAxis AxisAlignment="Left" DrawMajorBands="False" VisibleRange="0,900"/>
        </s:SciChartSurface.YAxis>
        <s:SciChartSurface.XAxis>
            <s:DateTimeAxis DrawMajorBands="True" VisibleRangeLimit="{Binding VisibleRangeLimit}"
                            DrawMinorGridLines="False"
                            x:Name="XAxis"
                            CursorTextFormatting="dd.MM.yyyy HH:mm"/>
        </s:SciChartSurface.XAxis>
    </s:SciChartSurface>

DiaryViewModel.cs

Property:

    public List<IRenderableSeriesViewModel> DiarySeriesViewModels { get; private set; }

inside the Constructor:

this.DiarySeriesViewModels.Add(new LineRenderableSeriesViewModel()
        {
            AntiAliasing = true,
            PointMarker = new DiaryPointMarker()
            {
                AntiAliasing = true,
                LowRatingColor = Brushes.Red,
                MidRatingColor = Brushes.Orange,
                HighRatingColor = Brushes.Green,
                Width = 10,
                Height = 10,
                StrokeThickness = 2
            },
            DataSeries = GetSampleSeries()
        });

GetSampleSeries():

private XyDataSeries<DateTime, double> GetSampleSeries()
    {
        var series = new XyDataSeries<DateTime, double>();

        var startDate = this.VisibleRangeLimit.Min.AddDays(5);
        var currentDate = startDate;
        int i = 0;
        while (currentDate < DateTime.Now)
        {
            var yval = 60*(Math.Log(i))*Math.Abs(Math.Sin(Math.PI*(i++/100.0)));
            currentDate = currentDate.AddHours(5.3);
            string comment = i%20 == 0 ? String.Format("Sample comment #{0}", i) : string.Empty;
            double rating = 100*yval/60;
            series.Append(currentDate,yval,new DiaryPointMetaData(rating,comment));
        }

        return series;
    }

DiaryPointMarker.cs: (based on an example which I found here at SciChart)

public class DiaryPointMarker : BasePointMarker
{
    private IList<IPointMetadata> _dataPointMetadata;
    IList<int> _dataPointIndexes = new List<int>();


    private IPen2D _lowStrokePen;
    private IPen2D _midStrokePen;
    private IPen2D _highStrokePen;


    private IBrush2D _lowRatingColor;
    private IBrush2D _midRatingColor;
    private IBrush2D _highRatingColor;
    private IBrush2D _noCommentColor;

    public Brush LowRatingColor { get; set; }
    public Brush MidRatingColor { get; set; }
    public Brush HighRatingColor { get; set; }

    public override void BeginBatch(IRenderContext2D context, Color? strokeColor, Color? fillColor)
    {
        _dataPointMetadata = _dataPointMetadata ?? RenderableSeries.DataSeries.Metadata;

        _dataPointIndexes = new List<int>();

        base.BeginBatch(context, strokeColor, fillColor);
    }


    public override void MoveTo(IRenderContext2D context, double x, double y, int index)
    {
        if (IsInBounds(x, y))
        {
            _dataPointIndexes.Add(index);
        }

        base.MoveTo(context, x, y, index);
    }

    public override void Draw(IRenderContext2D context, IEnumerable<Point> centers)
    {
        TryCasheResources(context);

        var markerLocations = centers.ToArray();

        for (int i = 0; i < markerLocations.Length; ++i)
        {
            var diaryMetaInfo = _dataPointMetadata[_dataPointIndexes[i]] as DiaryPointMetaData;

            var center = markerLocations[i];

            context.DrawEllipse(
                diaryMetaInfo.Rating < 60 ? _lowStrokePen : diaryMetaInfo.Rating < 80 ? _midStrokePen : _highStrokePen,
                String.IsNullOrEmpty(diaryMetaInfo.Comment) ? _noCommentColor : diaryMetaInfo.Rating < 60 ? _lowRatingColor : diaryMetaInfo.Rating < 80 ?_midRatingColor : _highRatingColor,
                center,
                Width,
                Height
            );
        }
    }

    private void TryCasheResources(IRenderContext2D context)
    {
        _lowStrokePen = _lowStrokePen ?? context.CreatePen(LowRatingColor.ExtractColor(), AntiAliasing, (float)StrokeThickness, Opacity);
        _midStrokePen = _midStrokePen ?? context.CreatePen(MidRatingColor.ExtractColor(), AntiAliasing, (float)StrokeThickness, Opacity);
        _highStrokePen = _highStrokePen ?? context.CreatePen(HighRatingColor.ExtractColor(), AntiAliasing, (float)StrokeThickness, Opacity);

        _lowRatingColor = _lowRatingColor ?? context.CreateBrush(LowRatingColor);
        _midRatingColor = _midRatingColor ?? context.CreateBrush(MidRatingColor);
        _highRatingColor = _highRatingColor ?? context.CreateBrush(HighRatingColor);
        _noCommentColor = _noCommentColor ?? context.CreateBrush(Color.FromArgb(0, 0, 0, 0));
    }
}
0 votes
12k views

Hey

why do i need to use SuspendUpdates when i can append an array of data?

Thanks!

1 vote
11k views

Hi folks,

I’ve just upgraded a project to SciChart version 3.x. I got most everything working, but one issue remains…

In 1.x and 2.x, I was able to hide cursor labels by adding an empty AxisLabelTemplate like this:

<s:CursorModifier x:Name="MainCursor" ShowAxisLabels="True" ShowTooltip="False" LineOverlayStyle="{x:Null}">
     <s:CursorModifier.AxisLabelTemplate>
         <!-- This empty template hides Themes cursor labels -->
         <ControlTemplate TargetType="s:TemplatableControl" />
      </s:CursorModifier.AxisLabelTemplate>
 </s:CursorModifier>

In 3.x, this doesn’t quite seem to work. I have no y-axis cursor label, but I do have an x-axis cursor label. (My axes are treated differently; one is in XAML, and one is in code since I swap between linear and log axes occasionally.)

How can I get rid of the x-axis cursor?

Thanks,
–George

  • yefchak asked 10 years ago
  • last active 10 years ago
1 vote
15k 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
9k views

To whom this may concern:

I was successfully able to create a rollover modifier tooltip template for the actual data, as shown in the attached screenshot.

You can see the red arrow shows that the X-Axis tooltip is still the default style. I would like for it to be the same style as the tooltip templates circled in green.

I have tried using the AxisLabelTemplate dependency property, but the tooltips show up on the Y-Axes as well, and I don’t know how to bind it to the X-Axis Value.

Can you please advise?

Thanks kindly!

— Ari

  • Ari Sagiv asked 8 years ago
  • last active 5 years ago
0 votes
14k views

Hello,

I do not seem to be able to have a scrolling Date/Time axis show seconds (or anything except hh:mm) regardless of what values I use for TextFormatting and SubDayTextFormatting.

Everything else works/displays as expected

My X axis XAML looks like:

<SciChart:SciChartSurface.XAxis>
<SciChart:CategoryDateTimeAxis TextFormatting=”MM/dd/yy” GrowBy=”0.1,0.1″ SubDayTextFormatting=”hh:mm:ss” AutoRange=”True” />
</SciChart:SciChartSurface.XAxis>

Many Thanks for your help

Mark

.NET 4.5, Win 7 SP1, VS2012

0 votes
9k views

Hallo,

I use this line to set my YAxis range:
myYAxis.VisibleRange = RangeFactory.NewWithMinMax(myYAxis.VisibleRange, 2.22, 2.33);

However i get an error that the value expected is int32. But i want to pass a double.

  • bochelie asked 10 years ago
  • last active 10 years ago
0 votes
9k views

Hello,

I have a problem: I’m creating FastLineRenderableSeries with big StrokeThickness value. The bigger this value is the slower my program works.

Is there any way to speed it up in this situation?

P.S. I’ve attached project below.

Thanks in advance.

  • Egor asked 8 years ago
  • last active 8 years ago
1 vote
7k views

Hi Support,

I am trying to use the AxisMarkerAnnotation object inside a chart but I am facing a problem that I would be thankful if you can solve it.

I am adding the marker without any problems and it looks equals to the marker that you have into examples :

enter image description here

I am trying to find a way to remove/hide/use the green boxes on front but I did not find a way to do it.

can you help me please?

Thanks in advance.

Carlos.

0 votes
11k views

Hi,

I’m trying to set the visible ranges of the X and YAxis with MVVM.

My xaml code looks like this:

        &lt;!-- Define the SciChartSurface --&gt;
        &lt;SciChart:SciChartSurface Margin=&quot;5&quot; x:Name=&quot;sciChartSurface&quot;
                                  SciChart:ThemeManager.Theme=&quot;ExpressionDark&quot; DataSet=&quot;{Binding ChartData, Mode=TwoWay}&quot; ChartTitle=&quot;Lage rug vs romp&quot;
                                  AutoRangeOnStartup=&quot;False&quot;&gt;

            &lt;!-- Declare RenderableSeries --&gt;
            &lt;SciChart:SciChartSurface.RenderableSeries&gt;
                &lt;SciChart:XyScatterRenderableSeries ResamplingMode=&quot;None&quot;&gt;
                    &lt;SciChart:XyScatterRenderableSeries.PointMarkerTemplate&gt;
                        &lt;ControlTemplate&gt;
                            &lt;Ellipse Width=&quot;9&quot; Height=&quot;9&quot; Fill=&quot;SteelBlue&quot; Stroke=&quot;LightSteelBlue&quot; StrokeThickness=&quot;2&quot;/&gt;
                        &lt;/ControlTemplate&gt;
                    &lt;/SciChart:XyScatterRenderableSeries.PointMarkerTemplate&gt;
                &lt;/SciChart:XyScatterRenderableSeries&gt;
            &lt;/SciChart:SciChartSurface.RenderableSeries&gt;

            &lt;!-- Create an X Axis --&gt;
            &lt;SciChart:SciChartSurface.XAxis&gt;
                &lt;SciChart:NumericAxis DrawMinorTicks=&quot;False&quot; DrawMinorGridLines=&quot;False&quot; TextFormatting=&quot;0&quot; AxisTitle=&quot;Romp&quot; VisibleRange=&quot;{Binding Path=LowerBackXAxisVisibleRange}&quot; &gt;
                &lt;/SciChart:NumericAxis&gt;
            &lt;/SciChart:SciChartSurface.XAxis&gt;

            &lt;!-- Create a Y Axis --&gt;
            &lt;SciChart:SciChartSurface.YAxes&gt;
                &lt;SciChart:NumericAxis TickTextBrush=&quot;#FF4083B7&quot; AxisAlignment=&quot;Left&quot; AutoRange=&quot;False&quot; DrawMinorTicks=&quot;False&quot; DrawMinorGridLines=&quot;False&quot; TextFormatting=&quot;0&quot; AxisTitle=&quot;Lage rug&quot; VisibleRange=&quot;{Binding Path=LowerBackYAxisVisibleRange}&quot;&gt;
                &lt;/SciChart:NumericAxis&gt;
            &lt;/SciChart:SciChartSurface.YAxes&gt;
        &lt;/SciChart:SciChartSurface &gt;

This works fine for the XAxis, but not for the YAxis.
Any idea?

Thanks,
Egbert

2 votes
11k views

Is there any documentation besides the tutorials? Something like the one found on MSDN, with all the Properties of the SciChart elements that can be styled.

  • catalin asked 12 years ago
  • last active 8 years ago
2 votes
13k views

I’m new to SciCharts, so this might be a terminology issue or something like that.

I’m trying to add a vertical line annotation to my chart that the user can drag around. So far so good. However, I’d like it to also display the values of the series data the line intersects with. This is where I’m unsure of the best way to proceed. What I want is basically the behavior of the RolloverModifier, which displays tooltips when it intersects with series data, but it’s always visible rather than triggered by a rollover. It may be possible to use the RolloverModifier for this, but I ran into an issue where I couldn’t have both a VerticalLineAnnotation with IsEditable=true and a RolloverModifier, and I need to add another VerticalLineAnnotation in addition to this one.

Any advice?

Hopefully I just missed something in the documentation.

1 vote
15k views

I have an application that is using 20 fastrederableseries for the purpose of high-speed stripcharting. With only one series visible, the chart fails to render at 20ms intervals. It is very sporadic between 20-150 ms. I have searched the forums and completed the following to improve performance:

resamplingmode = mid
antialiasing = false
renderpriority = low
strokethickness = 1 (although this is too small)

None of these changes resolve the stutter or speed limitations. If I move to a different screen where the chart is not located, speed is no longer an issue. I believe the rendering is slowing things down. How can I imporve this?

Chart XAML:

<s:SciChartSurface x:Name="sciStripChart" Padding="400,45,10,5" s:ThemeManager.Theme="ExpressionDark" Margin="0,0,0,0" RenderPriority="Normal">
      <s:SciChartSurface.RenderSurface>
                 <!-- High Quality subpixel rendering -->
                 <s:HighQualityRenderSurface/>
                  </s:SciChartSurface.RenderSurface> 
                  <s:SciChartSurface.XAxis>
                  <s:NumericAxis x:Name="xAxis" AxisTitle="Time (seconds)" AutoRange="Never" DrawMinorGridLines="False" IsStaticAxis="True" TextFormatting="0.#">
                  </s:NumericAxis>
                  </s:SciChartSurface.XAxis>
                  <s:SciChartSurface.YAxis>
                  <s:NumericAxis x:Name="yAxis"  AxisTitle="Awesomeness (A)" AutoRange="Never" DrawMinorGridLines="False" />
                         </s:SciChartSurface.YAxis>
                        <s:SciChartSurface.ChartModifier>
                                   <s:ModifierGroup>

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

20 data series created in code using this:

// Create a DataSeries and append some data
var dataSeries = new XyDataSeries<double, double>();
 // Create a RenderableSeries and ensure DataSeries is set
 var renderSeries = new FastLineRenderableSeries
{
         StrokeThickness = 1,
         AntiAliasing = false,
         ResamplingMode = Abt.Controls.SciChart.Numerics.ResamplingMode.Mid,

          SeriesColor = fdctCollection[fdctCollection.Count - 1].color,
          DataSeries = dataSeries,
};

    renderSeries.DataSeries.SeriesName = "Tag " + (z+1);
     // Add the new RenderableSeries
    sciStripChart.RenderableSeries.Add(renderSeries);
    sciStripChart.RenderableSeries[fdctCollection.Count - 1].IsVisible = fdctCollection[fdctCollection.Count - 1].PenEnable;

Attempting to append data and adjust the x-axis every 20 ms:

sciStripChart.RenderableSeries[CurrentPointCount].DataSeries.XValues.Add(CurrentTimeCounter);
sciStripChart.RenderableSeries[CurrentPointCount]DataSeries.YValues.Add(NewYaxisData);

 sciStripChart.RenderableSeries[0].XAxis.AnimatedVisibleRange = (new DoubleRange(CurrentTimeCounter- 100, ((CurrentTimeCounter-0.4))));
0 votes
14k views

Hello guys

How to change Crosshair annotation string format?
I need to round it to decimals. shall i make new Control Template?

  • VRueda asked 11 years ago
  • last active 8 years ago
0 votes
10k views

Hi

Please can you give me a guide as to how to pull out the real time stock chart example into a standalone project so that I can use it and build on it.

I have tried but I am getting errors in the xaml with this

xmlns:Common=\\\\”clr-namespace:Abt.Controls.SciChart.Example.Common\\\\”

and

Thanks

1 vote
9k views

Hi ,

I have two X Axes and two Y Axes, I want to stretch X Axes so it fills up the empty spaces marked
‘2’ in attached image.

1 vote
17k views

From reading the material on the site I know how to do what I want to do in xaml:

    <Style x:Key="AxisLabelStyle" TargetType="s:DefaultTickLabel">
    <Setter Property="RenderTransform">
        <Setter.Value>
            <RotateTransform Angle="30"/>
        </Setter.Value>
    </Setter>
    <Setter Property="HorizontalAnchorPoint" Value="Left"/>
</Style>

Now however my chart will be using two diffrent x-axis, one numeric and one with date and time. Both axis are defined in code:

            _xAxisNum = new NumericAxis
        {
            ...
        };

        _xAxisDat = new DateTimeAxis
        {
            ...
        };

        InitializeComponent();
        sciChartSurface.XAxis = _xAxisDat;

What code must I add to my x-axes to get the same result as the xaml above accomplishes? Or can I achieve what I want with a LabelProvider?

1 vote
14k 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

1 vote
14k views

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

  • anth asked 11 years ago
  • last active 8 years ago
1 vote
19k views

Hi

I want to override the default AxisLabelTemplate for a DateTimeAxis beyond the normal circumstances.
Setting the AxisLabelTemplate to a StaticResource is easy enough, but all I have inside the Template is the CursorFormattedDataValue and I want to be able to send in something more then a simple string.

<ControlTemplate x:Key="RolloverModifierAxisLabelTemplateDefault">
    <Border Background="LightGray" 
            Opacity="0.80" 
            BorderThickness="0"
            CornerRadius="5"
            Padding="2"
            Visibility="{Binding IsXAxis, Converter={StaticResource BoolToVisibilityConverter}}">
        <TextBlock Text="{Binding CursorFormattedDataValue}" />
    </Border>
</ControlTemplate>

Extending the LabelProviderBase gives me the opportunity to override the FormatCursorLabel method, but it only returns a string and not an object and therefore I can not pass my own data structure to be used inside the AxisLabelTemplate.

How can we solve this issue? Is there a workaround, or is this something you need to implement?

1 vote
18k views

In your custom overview example the width of the grid column used as padding is linked to the width of the y axis.

            <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <!--  Hosts overview control  -->
            <ColumnDefinition Width="{Binding ActualWidthValue, ElementName=proxy, Mode=OneWay, Converter={StaticResource DoubleToGridLengthConverter}}" />
            <!--  Used to bind to parent surface YAxis  -->
        </Grid.ColumnDefinitions>

        <!-- This class is in the Examples Source Code, under your install directory -->
        <helpers:ActualSizePropertyProxy x:Name="proxy" Element="{Binding ElementName=MainChartSurface, Path=YAxis}" />

What do you use for the Path if you have multiple y axes. I have tried objects like AxisAreaLeft with no success.

0 votes
6k views

Is there anyway to make the ChartTitle render, but take no space in the layout? I want to YAxis to extend up into the area of the ChartTitle.

0 votes
11k views

Hello,

We would like to use SciChart to show data from a binary file (up to 1 GB!).
What would you suggest as the best method for achieving this?

Thanks

Zoe


More details:
The binary file contains for example the following data: a1b1c1a2b2c2a3b3c3…
where a1 b1 c1 etc are double byte numbers.
In the chart we would like to show 3 series:
serie a: (1,a1) (2, a2) (3,a3) etc
serie b: (1,b1) (2, b2) (3,b3) etc
serie c: (1,c1) (2, c2) (3,c3) etc
Hope this is clear…

  • zoe asked 11 years ago
1 vote
15k views

I want to color individual points in the line. How can it be done with the SciChart?

Attached is an image of what I want to accomplish.

Thanks.

  • Miguel Hau asked 10 years ago
  • last active 10 years ago
1 vote
14k views

I want to display a point as a decimar separator in numeric values. I have achieved this in chart axis and vertical slices tooltips, creating a custom NumericLabelProvider (see attached picture). How can I do the same with vertical slices xacis labels? (in the picture attached, note that every numeric value has a point as a decimar separator, but vertical slice label has a comma). I have defined LabelTextFormatting of the slice with “#.##E+0”, but it doesn’t work.

Thanks in advance

Regads, Juan

0 votes
10k views

New to Scichart – evaluating the product. Looks very impressive. Can I control the orientation of an Axis title. For example, the Y Axis on a line chart – can its axis title be Horizontal? The demos don’t show that capability.

  • Mike A asked 8 years ago
  • last active 8 years ago
0 votes
10k views

Hi,

I have been doing a little demo work with you library to make sure it fits our needs before we commit to a license.

I was becoming extremely frustrated when your sample apps would work perfectly fine, yet when I tried to copy the exact same code into my application I consistently got a blank window, no exceptions or errors…

I finally figured out the cause of this was that I was embedding the SciChart dll into my application as a resource (see here if interested ).

I usually do this will ALL of my dll’s as it makes deployment easier and adds a level of obfuscation to the end user as they can’t see all of the libraries being used without using something to unpack the main exe.

Did you do something to intentionally prevent this with the trial version? Or would we have this same issue even after we buy a license?

3 votes
18k views

Hi Guys,

My Sci Chart has dates along the X-Axis. So far my data is at week level (one point for each week).

Ideally I would like to have a subtle grid line at each week, a more noticeable grid line to represent the start of each month, and a major grid line to represent the start of each year.

I understand that the current implementation of the XAxis seems to only use Minor and Major gridlines.

I am interested in drawing grid lines such that:

one minor vertical grid-line is drawn on the start of each week
one medium vertical grid-line is drawn on the start of each month
one major vertical grid-line is drawn on the start of each year
And for these grid lines to be drawn regardless of the current visible range or “zoom” of the chart.

Is there a simple tutorial or some snippet of code illustrating what I need to overwrite in a custom class in order to get this functionality into my chart?

Thanks again,
Miles

0 votes
0 answers
9k views

Hello,
I’m having a problem with FastBandRenderableSeries.
When chart is zoomed out there are strange lines on band intersection:

But when I zoom in it’s becomes ok:

1 vote
13k views

Hi,

I’m creating a CustomChartModifier which I am able to hook to a SciStockChart (a template item in a SciChartGroup MVVM) and now I’m having difficulties in adding the BoxAnnotation to the Chart.

This is the code I’m using in my ChartModifier and placing a breakpoint shows me that indeed the code runs through this method, however, I do not see any BoxAnnotation on my chart? I’ve even tried adding the Height and Width properties without any further success. Other CustomModifiers to draw Lines and Ellipses works without problems. Do BoxAnnotations work differently?

I’m looking to have the the user be able to draw a BoxAnnotation on the chart, free hand / dynamically.

SimpleBoxAnnotationModifier.cs

public override void OnModifierMouseDown(ModifierMouseArgs e)
{
        base.OnModifierMouseDown(e);

        var resources = new AnnotationStyles();
        // x:Key="BoxAnnotationStyle" TargetType="s:BoxAnnotation"
        var style = (Style)resources["BoxAnnotationStyle"];

        _annotationCreation = new AnnotationCreationModifier () { AnnotationType = typeof(BoxAnnotation), AnnotationStyle = style };

        this.ModifierSurface.Children.Add(_annotationCreation);
}

AnnotationStyles.xaml

<ResourceDictionary 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"
                x:Class="ChartModifierBinding.AnnotationStyles">

<Style x:Key="BoxAnnotationStyle" TargetType="s:BoxAnnotation">
    <Setter Property="BorderBrush" Value="#279B27"/>
    <Setter Property="Background" Value="#551964FF"/>
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="IsEditable" Value="True"/>
</Style>

Thanks for any pointers or tips!

  • David T asked 9 years ago
  • last active 8 years ago
0 votes
10k views

Is this normal ? I was expecting SetMinMax() to set both properties and then trigger validation …

When executing this with a Axis.VisibleRange
range.SetMinMax(100, 200);
range.SetMinMax(300, 400);
I get an ArgumentEcception : VisibleRange.Min (value=300) must be less than VisibleRange.Max (value=200)

I managed to get around it like this:

        if (min &gt; range.Max)
        {
            range.Max = max;
            range.Min = min;
        }
        else
        {
            range.Min = min;
            range.Max = max;
        }  
1 vote
10k views

Is there an easy way to rotate the Chart(swapping X and Y-Axis) inclusive Annotations, Modifiers,…?

-1 votes
0 answers
8k views

i want to make y axis big in range as you can see in screenshot . Yaxis is small in Height
want to make it full screen

1 vote
14k views

I have a lot of data to process and I don’t want UI to get frozen. So I’d like to add data in a background thread.

Is it possible to append data to XyDataSeries in a separate thread? Is it supposed to handle this safely?

0 votes
12k views

Hi, I have a question: after execution of zoomExtents, how can I reset this zoom level and go back to the state before?

Thanks!

  • dsavian asked 11 years ago
  • last active 2 years ago
0 votes
10k views

HI,

After reading the example annotation code and articles in the forum, I still can’t find a way to achieve my purpose: My app has a thread to receive data sent by a server, the data may trigger an annotation created lively. My app also need to maintain all created annotations and change their properties like X/Y values or remove them later. So far I only see the way of creating annotation by clicking some button. I tries different ways but failed.

Please help me out with some detailed guides. I am a beginner for WPF.

regards
Chunxi

I try to do this in user thread:

LineAnnotation annotationBase = new LineAnnotation();
change annotationBase properties.

But get this exception:

2014-11-09 13:42:20,623 [11] ERROR WpfApplication2.MainWindow [(null)] – at System.Windows.Input.InputManager..ctor()
at System.Windows.Input.InputManager.GetCurrentInputManagerImpl()
at System.Windows.Input.KeyboardNavigation..ctor()
at System.Windows.FrameworkElement.FrameworkServices..ctor()
at System.Windows.FrameworkElement.EnsureFrameworkServices()
at System.Windows.FrameworkElement..ctor()
at System.Windows.Controls.Control..ctor()
at System.Windows.Controls.ContentControl..ctor()
at Abt.Controls.SciChart.ChartModifiers.ApiElementBase..ctor()
at Abt.Controls.SciChart.Visuals.Annotations.AnnotationBase..ctor()
at Abt.Controls.SciChart.Visuals.Annotations.LineAnnotationBase..ctor()
at Abt.Controls.SciChart.Visuals.Annotations.LineAnnotation..ctor()
at WpfApplication2.InstrumentViewModel.addZone() in c:\Users\jokeslala\Documents\Visual Studio 2013\Projects\WpfApplication2\WpfApplication2\InstrumentViewModel.cs:line 134
at WpfApplication2.InstrumentViewModel.addMA20(Int32 barIdx, Double ma) in c:\Users\jokeslala\Documents\Visual Studio 2013\Projects\WpfApplication2\WpfApplication2\InstrumentViewModel.cs:line 128
at WpfApplication2.MainWindow.processEMA(String str) in c:\Users\jokeslala\Documents\Visual Studio 2013\Projects\WpfApplication2\WpfApplication2\MainWindow.xaml.cs:line 222
at WpfApplication2.MainWindow.consumeQueue() in c:\Users\jokeslala\Documents\Visual Studio 2013\Projects\WpfApplication2\WpfApplication2\MainWindow.xaml.cs:line 155

  • chunxi asked 9 years ago
  • last active 9 years ago
0 votes
9k views

After updating to SciChart 3.1, I started getting the following binding error:

System.Windows.Data Error: 4 : Cannot find source for binding with reference ‘RelativeSource FindAncestor, AncestorType=’Abt.Controls.SciChart.Visuals.SciChartSurfaceBase’, AncestorLevel=’1”. BindingExpression:Path=MaxFrameRate; DataItem=null; target element is ‘HighSpeedRenderSurface’ (Name=”); target property is ‘MaxFramerate’ (type ‘Nullable`1’)

I’m not binding MaxFrameRate anywhere nor do I have a HighSpeedRenderSurface explicitly defined in my code, so I’m guessing this error is occurring somewhere in a SciChart control.

I have several SciChartSurface elements across different controls in my application. I tried setting a global style:

<Style TargetType="{x:Type s:SciChartSurfaceBase}">
    <Setter Property="MaxFrameRate" Value="24"/>
</Style>

This had no effect on the binding error.

Any help would be appreciated since I think these errors are affecting the loading speed of my UI.

0 votes
7k views

Hello.
I am adding Double.NaN into DataSeries for X-Axis synchronization.
It works fine with 3.x version.
When i have updated scichart to 4.x version, i got filled areas instead of empty areas. But, these filled areas are shown only with big count of points. Filled areas disappeared when i zoom in.
This is how i create renderableseries:

new OhlcRenderableSeriesViewModel
                {
                    DataSeries = ohlc,
                    DrawNaNAs = LineDrawMode.Gaps,
                    AntiAliasing = false,
                    StrokeThickness = 1,
                    StrokeUp = color,
                    StrokeDown = color,
                    Stroke = color
                }
4 votes
15k views

Hi,

I added VerticalLineAnnotation to my SciChartSurface with multiple FastLineRenderableSeries. This is working fine, but I can’t figure out how to show the corresponding Y values at side of vertical line. (Each Dataserie has its own YAxes.)

I Found a place in VerticalLineAnnotations template, where I can insert a stackpanel or something to show the values, but I don’t know how to make the data binding work.

I want to do something like in the attached picture.

Best Regards,
Martti

0 votes
14k views

Hi,

I have some charts binded to a viewmodel. I wanted to produce a bar chart, so I want to modify the AxisAlignment.

If I specify a hardcoded alignment in the XAML, it works fine.

If I bind the alignment to the viewModel, the chart does not render, and I get the following error in the output:

 SciChartSurface didn't render, because an exception was thrown:
      Message: The specified Visual and this Visual do not share a common ancestor, so there is no valid transformation between the two Visuals.

Stack Trace:    at System.Windows.Media.Visual.TransformToVisual(Visual visual)
   at A.cac257c85637821690b32a44bda9b120f.cd0eaed29fc1e87dfe7aa912a7f678b57(FrameworkElement c5aaca7e2018a1512249ec2e2170b4cc6, UIElement c708323fb6eac118d4fd2c5913dc2a6ed)
   at A.cac257c85637821690b32a44bda9b120f.cd0eaed29fc1e87dfe7aa912a7f678b57(FrameworkElement c5aaca7e2018a1512249ec2e2170b4cc6, IHitTestable cc9d5fbe91f2861ee865bbb5439d3b84d)
   at Abt.Controls.SciChart.Visuals.Axes.AxisBase.GetAxisOffset()
   at Abt.Controls.SciChart.Visuals.Axes.AxisBase.GetAxisParams()
   at Abt.Controls.SciChart.Visuals.Axes.AxisBase.OnBeginRenderPass()
   at A.cda144392e546b245ef5bb1ee71f22b3a.c64a51c8ba6b7cbda8b9d9380d6337036(ISciChartSurface c17037e8328cd0abc02d2a6957dfa450c, RenderPassInfo c16b8d70d2b6ecad8f9fca7ac3f5177b8)
   at A.cda144392e546b245ef5bb1ee71f22b3a.c1a2306a5cc0452a04d135e77f0de4ff1(ISciChartSurface c17037e8328cd0abc02d2a6957dfa450c, Size cacf0a4a95d1143f0c11e20d4508e7132)
   at A.cda144392e546b245ef5bb1ee71f22b3a.RenderLoop(IRenderContext2D renderContext)
   at Abt.Controls.SciChart.Visuals.SciChartSurface.ca065c0b671221e0e603d0e9bf2792494()

This is the axis XAML:

 <s:SciChartSurface.XAxis>
                                    <s:NumericAxis AxisAlignment="{Binding XAxisAlignment}" LabelProvider="{Binding LabelProvider}" AutoTicks="False" MajorDelta="1" MinorDelta="1" DrawMinorGridLines="False">
                                    </s:NumericAxis>
                                </s:SciChartSurface.XAxis>

                                <s:SciChartSurface.YAxis>
                                    <s:NumericAxis AxisAlignment="{Binding YAxisAlignment}" AxisTitle="Number of crimes" GrowBy="0,1"/>
                                </s:SciChartSurface.YAxis>

And the properties I’m binding to:

public AxisAlignment XAxisAlignment { get; private set; }

public AxisAlignment YAxisAlignment { get; private set; }

Any help is appreciated.

Thanks,
Charbel

  • cabdo asked 10 years ago
  • last active 10 years ago
0 votes
9k views

The defalut CursorModifier XaxisLable Format is “dd mmm yyyy”, I want to change them to be “yyyy mm dd hh:mm” in code. How to do that? thanks.

Showing 1 - 50 of 4k results

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies