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

1 vote
7k views

I am trying to use a line series to display digital values (0,1) Is it possible to have the line series remain at 1 if there is no data after the reading until it reaches the next value read. Currently the line goes to 1 and then starts to fall until it reaches zero as there is no data to tell it otherwise

0 votes
6k views

Hi Support Team,

I am a SL developer and i am trying to save the scichart surface as a png file.

I have seen you example “First download the source code, you can find i.e. here: ScreenshotsXpsAndXLabels.zip”

but unfortunally it only works in Wpf , any suggestions would be appreciated.

Cheers

Giuseppe

  • jp13 asked 8 years ago
1 vote
9k views

My previous example/question worked because I hard coded to use two charts each with their own chart modifiers as follows all in the same class.

_chartModifiers = new ModifierGroup();
MouseManager.SetMouseEventGroup(_chartModifiers, "MyGroup");
_chartModifiers2 = new ModifierGroup();
MouseManager.SetMouseEventGroup(_chartModifiers2, "MyGroup");

I am now building the ui that allows me to add and remove a graph from an items control. Each graph now binds to a view model to get its data and a parent class manages a collection of graphs (view models). I set the mouse event group in the constructor which is empty when I call SetMouseEventGroup. This causes some weird behavior when zooming as both graphs zoom together plus scrolling the yaxis scolls both yaxis at the same time and sometimes crashes.

Note: in my code now this gets call two times; once for each chart.

public GraphViewModel()
{
  _chartModifiers = new ModifierGroup();
  MouseManager.SetMouseEventGroup(_chartModifiers, "MyGroup");
}

private ModifierGroup _chartModifiers;
public ModifierGroup ChartModifiers
{
  get { return _chartModifiers; }
  set
  {
    _chartModifiers = value;
    NotifyPropertyChanged(_chartModifierArgs);
  }
}

I also tried to manage the number of items that I add to the mouse event group and while that stopped linking the zoom and yaxis scoll in this case I can no longer get the rollover to work.

ModifierGroup total = new ModifierGroup();
foreach (GraphViewModel www in vm.HistoricalHealthViewModel.DisplayedGraphs)
{
   foreach (IChartModifier chartModifier in <a target="_blank" href="http://www.ChartModifiers.ChildModifiers)"  target="_blank">www.ChartModifiers.ChildModifiers)</a> 
   {
      // do not add the drag modifiers
      if (!(chartModifier is YAxisDragModifier))
      {
         total.ChildModifiers.Add(chartModifier);
      }
   }
}
MouseManager.SetMouseEventGroup(total, &quot;MyGroup&quot;);

Can you please suggest how to use the mouse event group?

0 votes
5k views

Hi,
How can i get smooth lines in FastLineRenderableSeries. Please see the attached image, specially when the stroke thickness is high, you see lots of small steps in the line.

Thanks
Aysan

1 vote
0 answers
7k views

Hallo once again,

Im trying to set/control my YAxis visiblerange. With good help I was able to come up with the piece of code below. However one more problem arrives with this solution. When i double click on the chart and there is no fixed visiblerange to set, then the corresponding YAxis must go back to normal (sse code). However this has bugs undesirably i must doubleclick twice in order for the YAxisRange to go back to normal. The first time does change the YAxisRange but not good. The second time finish the job correctly.
Does anyone has any idea why this happens? It should go back to normal from the first doubleclick.

    public class CustomZoomExtentsModifier : ChartModifierBase
    {
        public override void OnModifierDoubleClick(ModifierMouseArgs e)
        {
            base.OnModifierDoubleClick(e);

            //This piece of code is for setting the YAxis Limit, the limmit is Set only OnZoomExtends           
            
                if (this.YAxis.IsFixedRange)
                {
                    this.YAxis.VisibleRange = RangeFactory.NewWithMinMax(this.YAxis.VisibleRange, this.YAxis.YMinRange, this.YAxis.YMaxRange);
                }
                else
                {
                    var newYRange = this.YAxis.GetMaximumRange();
                    if (newYRange != null && newYRange.IsDefined) this.YAxis.VisibleRange = newYRange;
                }

            // And we must calculate the VisibleRange of X Axis, otherwise it will not zoom back to normal
            var newXRange = this.XAxis.GetMaximumRange();
            if (newXRange != null && newXRange.IsDefined) this.XAxis.VisibleRange = newXRange;
            
        }
    }
  • bochelie asked 7 years ago
  • last active 7 years ago
0 votes
8k views

Now I am trying to add MVVM bindings for a Chart Legend

I have

        <SciChart:SciChartSurface x:Name="sciChart" DataSet="{Binding DataSeriesSet}" 
            SciChart:ThemeManager.Theme="Oscilloscope" 
            Grid.Row="1" 
            RenderableSeries="{Binding RenderableSeries}"
            ChartModifier="{Binding ChartModifier}"
            XAxis="{Binding XAxis}" 
            YAxes="{Binding YAxes}">
                   </SciChart:SciChartSurface>
        <SciChart:SciChartLegend x:Name="legendControl" Grid.Row="1" Margin="23,23" ShowVisibilityCheckboxes="True" LegendData="{ Binding LegendDataSource,  Mode=OneWay}"/>

and in My ViewModel

        public AnalogueChartViewModel()
        {
            XAxis = new DateTimeAxis
            {
                VisibleRange = RangeFactory.NewRange(DateTime.Now.AddDays(-2), DateTime.Now),
                DrawMinorGridLines = false,
                AxisTitle = "X-Axis"
            };
            RenderableSeries = new ObservableCollection<IRenderableSeries>();
            YAxes = new AxisCollection();
            DataSeriesSet = new DataSeriesSet<DateTime, double>();
            var xAxisDrag = new XAxisDragModifier();
            var zoomExtents = new ZoomExtentsModifier();
            var rubberBandZoom = new RubberBandXyZoomModifier();
            var panModifier = new ZoomPanModifier { ExecuteOn = ExecuteOn.MouseRightButton };
            _legendDataSource = new LegendModifier { GetLegendDataFor = 0 };

            ChartModifier = new ModifierGroup(xAxisDrag, zoomExtents, rubberBandZoom, panModifier, _legendDataSource);

        }

        private LegendModifier _legendDataSource;

        public LegendModifier LegendDataSource
        {
            get { return _legendDataSource; }
            set 
            { 
                _legendDataSource = value;
                OnPropertyChanged("LegendDataSource");
            }
        }


But not sure how to bind to the LegendData

Sorry I keep troubling you, but after all this there should be some good MVVM code for others to follow too.

  • wilx asked 8 years ago
0 votes
5k views

Since Google have dropped their support for Silverlight in Chrome the online demo pages no longer work. Just wondering if you will be fixing this so that people can view the demos in Chrome again? Thank you.

  • sdavies asked 6 years ago
  • last active 5 years ago
0 votes
4k views

Hello again!
I’m creating fastlinerenderableseries and I need to show only one part of this line. For this purpose I’m using palette provider. But there is a strange side effect: when I set transparent color for line segment, it also paints lines on the chart (see pictures below-1 before switching on segment painting, 2 – after).
How can I fix it.

Thanks in advance
P.S. I ‘ve also attached project below.

  • Egor asked 5 years ago
  • last active 5 years ago
0 votes
7k views

Hello.
Using SciChart v2.2.
BaseRenderableSeries.HitTest(MousePoint) triggers not only in series pane, but also in other panes.

My hit-test code is below, called from public override void OnModifierMouseMove(ModifierMouseArgs mouseEventArgs)

foreach (var renderSeries in ParentSurface.RenderableSeries)
            {
                var series = renderSeries as BaseRenderableSeries;
                bool isCandleSeries = ((series as FastCandlestickRenderableSeries) != null);

                if (series != null && series.DataSeries != null)
                {
                    var hitTest = series.HitTest(mouseEventArgs.MousePoint);

                    if (hitTest.DataSeriesType == DataSeriesType.Ohlc)
                    {
                        seriesAnnotaion[k].X1 = hitTest.DataSeriesIndex;
                        seriesAnnotaion[k].Y1 = hitTest.CloseValue;

                        if (hitTest.IsHit)
                        {
                            //show tooltip
                        }
                     }
                  }
               }
0 votes
0 answers
5k views

Hi there,

if I use a ScaleTransform, the Fonts (e.g. axis text) are rendered with higher resolution – the chart is only scaled.
Is there a possibility to increase the render resolution for the chart also?

The intent is to print the chart with higher resolution.

Thanks and regards

  • miri asked 6 years ago
0 votes
8k views

Hi,

I have some plots that lay vertically, and I want them align well, how to sync the Y Axis that is located at left width to have same width of X Axis which is located at the bottom.

Thanks.

1 vote
7k views

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

0 votes
8k views

Hi,

I have a simple chart with FastLineRenderableSeries with a DateTime X axis and a numeric Y axis. I’ve also added a RubberBandXyZoomModifier and a ZoomExtentsModifier. In this chart I want to be able to zoom out to previous visible range. E. g. the user use the rubber band to zoom in to range A, then he zooms in a second time to range B, then he should have the opportunity to zoom out from range B and back to range A. Do you have a recommendation for how I can achieve this?

My first thought was to override the ZoomExtensModifier to allow the user to both use the full zoom out functionality, and also, by holding shift or something, zoom out to previous. In addition I can handle the VisibleRangeChanged event to collect the ranges.

Then I noticed that the VisibleRangeChanged event always seems to get fired twice after a user modification of the visible range. For example if I test with a slightly modified version of the line chart in http://http://www.scichart.com/documentation/webframe.html#BuildingASimpleLineChart.html, and zoom from X (205,431) to (250,300); the first time VisibleRangeChanged is fired the e.NewVisibleRange is (215,404), the second time it is as expected (250,300). Why is that? Will it always fire two times, or can I also expect it to fire one or three times? Is this something that can or will change in future releases of scichart?

  • Olav
0 votes
7k 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 6 years ago
  • last active 6 years ago
1 vote
0 answers
3k views

Hi,

I previously asked a question about a flickering chart. (https://www.scichart.com/questions/question/flickering-chart)

After stripping down my application I think I have found the root cause, and the information in that question seem to be completely irrelevant. If it is ok I’d rather delete that question.

I have extracted the relevant code out of my application and put it in the attached test application. After clicking the start button data should be added in real time. To reproduce change the visible area to a part of the chart and then hold to right scrollbar grip and move it, don’t release, just hold still, the chart starts to flicker.

0 votes
5k views

In the oil industry a well survey is usually displayed by a series of points connected by arcs. An arc is very close to the actual path a drill will take between points on a survey. Survey points are about 90 feet apart, so connecting them with a straight line looks ugly. Which method should I override to accomplish this?

If I get ambitious, I may also consider using Bezier curves to connect points, as this could be useful to represent geological boundaries as a background for my well survey plots.

I have attached a picture showing the type of plots I need to make. The red line is a survey and the background represents geological layers. The survey is presently connected with straight lines, which makes it difficult to determine precisely where the survey intercept the boundaries.

0 votes
8k views

Is there a way to guarantee a label at the minimum and maximum axis values?

The min of my data is 0, but I can’t seem to get an axis label to appear at 0. The same goes for the maximum value. This would be very helpful in framing the chart data.

  • Todd asked 8 years ago
0 votes
8k views

Hey guys,

I am setting the GridLinesPanelStyle property of my SciChartSurface to the following Style from the Resources of the parent Border element:

<Style x:Key="GridLinesPanelStyle" TargetType="{x:Type axes:GridLinesPanel}">
    <Setter Property="KeyboardNavigation.ControlTabNavigation" Value="None" />
    <Setter Property="IsTabStop" Value="False" />
    <Setter Property="Background" Value="Transparent" />
    <Setter Property="BorderBrush" Value="{StaticResource ChartBorderBrush}" />
</Style>

When snooping down into the “PART_GridLinesArea” I see that the Background is set to #FF353535 from the “Parent Template”. It gets interesting; I can Delve into the Style property of the same element and see my setters from the above snippet of code.

This approach was working pre-SciChart 2.0 and it appears to be the approach being used by the Examples suite as well, but I can’t yet get that running with my licence (there is another thread asking for help to fix this too ;)!).

Thanks for your support,
Miles

0 votes
7k views

Hi guys,

Update: Based on some other desired functionality about how the mouse should interact with this element, I’ve developed my own modifier to handle the roll-over functionality. As such, this ticket doesn’t need a reply any more. Thanks – and my apologies if it consumed any resources in the meantime!

This is a strange one. I am using seven XyScatterRenderableSeries on the one SciChart, in conjunction with a style for each of these to display seven different icons (in my case, I use path geometry or ellipses to define a full-circle, a circle with a divider down the middle or a circle split into three from the centre – each section then gets its own color).

Have a look at the attached screenshot for an idea of what it looks like – not a conventional chart by any means. The YAxis range is hard-coded in to only allow three possible values, whereas the XAxis is a Date axis and can allow values at any week. To allow the circles to sit where they are they are assigned a Y-coordinate of either 0.5, 1.5 or 2.5 (this allows them to sit between the gridllines I’ve defined in the xaml.

My problem is that the RolloverModifier is not following all of the RendereableSeries at all, and is acting strange and not providing me with a tooltip for some circles some of the time. It all seems very random.

Are RolloverModifiers working for multiple scatter series, where each series may have a different number of points to all others?

Note that it is possible in my example for one of the DataSeries to have two values (Y) for the one DateTime (X) as well.

I have attached some snippets of code – pasting it in here was not working for me, apologies!

If you require any further information, please let me know.

Cheers,
Miles

P.S. I had originally attempted to do this using your annotations example in the demo (with the Trade Markers for buy/sell). The Control Template I created to add the circles in and the looping that followed at run-time made rendering any sizeable number of these simply too expensive. Everything was slowing down. After going down this new route and using the SciChart itself to render everything – there are no performance issues at all! So bravo, whatever you’re doing to render geometries is paying dividends. Everything is very quick.

0 votes
3k views

Is it possible to create a BoxRendableSeries with outliers by a predefined range (e.g. 2%-98%) and everything which exceeds will be drawn as a outlier (a ellipse a like dot)?

What I want to do is, given each box, I want to mark the box with a dot if parameters exceed certain values. Is this something that SciChart supports?

0 votes
7k views

Hello.

Found a bug: when working with the axis-X scales the Y-axis
To get started, you need to configure in SciChart so zooming and moving only happened on the axis-X

Next:

  1. Take any chart (1.png)
  2. Highly scalable any point (2.png)
  3. Try to move the schedule of shifts sharply to the side, Y-axis scale changes (3.png)
  4. increase the scale to its original condition(4.png)

At the same time if you do everything except the third paragraph then all is well

This is a bug or need to configure something else?

  • Nicholas asked 7 years ago
  • last active 7 years ago
1 vote
7k views

I need to be able to show the user pre- and postmarket phases on a chart. Above is the screenshot of another control that does what I need.

To my understanding, I just need to implement the read only vertical range annotation and place it behind the series.

As I don’t have the source code license, could you please give me some advice from where to start the implementation process?

  • gman asked 8 years ago
0 votes
6k views

I successfully set my x-axis visible range between 0.0 and 5.0. I would like to have major grid lines every 1.0. How can I do this? I see a MajorDelta property which I set to 1.0. This did not work. Instead, the major grid lines are every 0.5 on the x axis.

0 votes
4k views

Hi,
Can I draw chart manually? I want to give user possibility to draw line chart by mouse. Is it possible?
Thank you

1 vote
0 answers
7k views

Hallo,

Once again I have a strange behaivour with the labeltextformating.

I have xaml code wich wont work. If i do the same in code behind it works perfectly. Why is that?

Code wich won’t work:

<Style x:Key="VerticalLineAnnotationStyle" TargetType="s:VerticalLineAnnotation">
            <Setter Property="Stroke" Value="#FFFF6600"/>
            <Setter Property="StrokeThickness" Value="2"/>
            <Setter Property="ShowLabel" Value="False"/>
            <Setter Property="LabelPlacement" Value="Axis"/>
            <Setter Property="VerticalAlignment" Value="Stretch"/>
            <Setter Property="LabelTextFormatting" Value="dd MMM yyyy HH:mm:ss"/>
        </Style>

<s:SciChartSurface.Annotations>
               
                <pp:CustomVerticalLineAnnotation x:Name="FVert" YAxisId="GenYAxis" FontSize="12" ShowLabel="True" IsEditable="True" IsEnabled="True" Height="600"
                                          Style="{StaticResource VerticalLineAnnotationStyle}" IsHidden="True"/>


            </s:SciChartSurface.Annotations>

Code wich works:

internal void AddVerticalLineDiff(string annotationType)
        {
            var type = _annotationTypes[annotationType];
            var resourceName = String.Format(&quot;{0}Style&quot;, type.Name);

            CustomVerticalLineAnnotation HAnot = new CustomVerticalLineAnnotation();
            HAnot.Name = &quot;VAnot1&quot;;
            HAnot.YAxisId = &quot;GenYAxis&quot;;
            // HAnot.YAxisId = &quot;GenYAxis&quot;;
            HAnot.Style = (Style)Resources[resourceName];
            HAnot.DragDirections = XyDirection.XDirection;
            HAnot.Height = sciChart.RenderSurface.ActualHeight;
            HAnot.IsEnabled = true;
            HAnot.IsEditable = true;
            HAnot.ShowLabel = true;

            // Perform the hit test relative to the GridLinesPanel
            HitTestInfo hitTestInfo = sciChart.RenderableSeries[0].HitTest(new Point(0, 0));
            HAnot.X1 = hitTestInfo.XValue;

            //HAnot.AnnotationLabels[0].Template = (ControlTemplate)Resources[&quot;VerAnnotLabelTemplate&quot;];
            sciChart.Annotations.Add(HAnot);

        }
private readonly IDictionary<string, Type> _annotationTypes = new Dictionary<string, Type>()
        {
            { "LineAnnotation", typeof(LineAnnotation)},
            { "LineArrowAnnotation", typeof(LineArrowAnnotation)},
            { "TextAnnotation", typeof(TextAnnotation)},
            { "BoxAnnotation", typeof(BoxAnnotation)},
            { "HorizontalLineAnnotation", typeof(HorizontalLineAnnotation)},
            { "VerticalLineAnnotation", typeof(VerticalLineAnnotation)},
            { "AxisMarkerAnnotation", typeof(AxisMarkerAnnotation)}
        };
0 votes
7k views

Hello,

I am getting started with Scichart (again) and was hoping you could help me with a question.
I am attempting to plot a data series on a scatter plot. Is it possible to set the color for each individual point (either manually, or based on another piece of data)?

I thought I remember seeing an example on this a while back, but I can’t seem to find it now.

Thanks.

1 vote
9k views

I am trying to set the extents of a chart beyond where the data stops, ex. data stops at 22 hours and I would like the chart to go to 24 hours. I would also like double clicking to go back to 24 hours after zooming, and I would like to be able to retrieve this extent later. Right now I set the visible range to 24, but it automatically re-sizes to 22 and when I use XAxis.GetMaximumRange, it also gives me 22. I would like to set the min and max to a specific number, so I don’t think GrowBy is the answer. I tried AutoRangeOnStartup but it seems to be deprecated. Is there any way to do what I am trying to achieve?

Thanks,
Greg

0 votes
16k views

I have the following code and want to move this portion to code-behind but have problems understanding how I can programmatically set the properties in Style:

<s:SciChartSurface.ChartModifier>

                <!-- Provides Interactivity -->
                <s:RubberBandXyZoomModifier IsAnimated = "False" IsXAxisOnly = "True" ExecuteOn = "MouseRightButton"/>
                <s:ZoomPanModifier XyDirection="XYDirection" ClipModeX = "ClipAtExtents" ExecuteOn ="MouseLeftButton" />
                <s:MouseWheelZoomModifier XyDirection = "XYDirection"/>
                <s:ZoomExtentsModifier IsAnimated = "False" ExecuteOn = "MouseDoubleClick" />
                <s:XAxisDragModifier  DragMode = "Scale"/>
                <s:CursorModifier SourceMode="AllSeries"  UseInterpolation="True"/>

                <!-- Provides selection of series and custom styling to the selected series -->
                <s:SeriesSelectionModifier ReceiveHandledEvents="True" SelectionChanged="SeriesSelectionModifier_OnSelectionChanged">
                    <s:SeriesSelectionModifier.SelectedSeriesStyle>
                        <Style TargetType="s:BaseRenderableSeries">
                            <Setter Property="SeriesColor" Value="White"/>
                            <Setter Property="PointMarkerTemplate">
                                <Setter.Value>
                                    <ControlTemplate>
                                        <s:EllipsePointMarker Fill="#FF00DC" Stroke="White" Width="7" Height="7"/>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </s:SeriesSelectionModifier.SelectedSeriesStyle>
                </s:SeriesSelectionModifier>

                <!-- Provides a data source for the legend control -->
                <s:LegendModifier ShowLegend="True" GetLegendDataFor="SelectedSeries" Margin="10"/>

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

Particularly the SeriesSelectionModifier and its property setters seem difficult for me to implement in code-behind. Can you please provide some sample code how I would actually implement the SeriesSelectionModifier with above Property Setters above in C# code rather than in XAML?

Thanks

  • bbmat asked 6 years ago
  • last active 6 years ago
0 votes
7k views

I know that I ask a lot of questions, but I’d like to be sure that SciChart fulfills all my application needs before I buy it, I wouldn’t like to be “blocked” afterwards as we won’t have the funds to buy multiple charts controls.

Anyway, in the data I would like to display, I have two sets of “points” for one series. One is the real, measured point and the other is points that have been calculated through a non-polynomial fitting on the data.

I would like to display the measured points as scatter but the fit as lines, except for one special series that is only extrapolated from the fit and also the first “point” of the series that is also extrapolated from the fit. This series and those points should have both line and point marker.

And while I’m at it, another feature that I have for my application:
– Being able to select a specific data point (with a visual queue that shows the point selected) and remove it. My ViewModel should be able to receive which point has been removed to trigger business logic

0 votes
9k 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
6k views

Is there a way in Sci-Chart to not have the legend inside the chart(plot) but rather have the legend outside as to not to interfere with the plots/charts?

  • Samir Shah asked 5 years ago
  • last active 5 years ago
1 vote
4k 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 6 years ago
  • last active 5 years ago
3 votes
11k views
  • bstapylton asked 8 years ago
  • last active 6 years ago
1 vote
5k views

I made my own custom modifier to act just like a rollover modifier, but allow keyboard input to move the rollover line between points. It was pretty easy to do and is working great, but there’s one final thing I cannot figure out how to achieve.

I want to display the the X-axis value tooltip below the vertical line just like the built-in RollOver modifier does. I was just going to manually render it, but it appears that you cannot render outside the chart modifier surface!

Is there any way to achieve this within SciChart or do I need to try to draw something completely on top of the entire SciChartSurface?

  • walshr asked 6 years ago
  • last active 6 years ago
0 votes
7k views

Hello, suppose I want to make a real-time rollover tooltip that displays not only the y value but also the x value, how do I do it?
I currently have a rollover modifier which gives me the y values in RolloverModifier.RolloverData.SeriesInfo.Value. How do I find out the corresponding value on the X Axis?

I have also attached some images where you can see what I have now and what I want to do..

0 votes
5k views

To whom this may concern:

I’m having a slight issue (bug, possibly?) with custom annotations. I have created a custom annotation with an image (XAML shown below)

<s:CustomAnnotation x:Class="Dashboard.SciChartCustomComponents.CustomAnnotations.MicrostructureAnnotation"
                    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:s="http://schemas.abtsoftware.co.uk/scichart"
                    xmlns:local="clr-namespace:Dashboard.SciChartCustomComponents.CustomAnnotations"
                    mc:Ignorable="d">

    <Border BorderBrush="White" BorderThickness="2" Background="Black">
        <StackPanel>
            <Image x:Name="annotationImage" Stretch="None" Width="150" Height="100" Visibility="Collapsed"/>
            <TextBlock x:Name="annotationText" HorizontalAlignment="Center"/>
            <TextBlock x:Name="parameterText" HorizontalAlignment="Center" Visibility="Collapsed"/>
        </StackPanel>
    </Border>

</s:CustomAnnotation>

The image is applied with the following code (note the anchor points are bottom-right):

var annotation = new MicrostructureAnnotation
{
    HorizontalAnchorPoint = HorizontalAnchorPoint.Right,
    VerticalAnchorPoint = VerticalAnchorPoint.Bottom,
    IsEditable = true,
    X1 = xValue, // Both Obtained from hitpoint X- and Y-Values
    Y1 = yValue
};

annotation.annotationImage.Source = // some image Uri
annotation.annotationText.Text = // some text
annotation.parameterText.Text = // some other text

So this successfully shows the annotation as i liked, shown in 1.png.

Now I have a function that collapses the visibility of the image, which yields an annotation that is removed from its anchor point (although the top-left location remains the same), shown in 2.png.

If I try to move the annotation after removing the image, the anchor point is in the location of where the top-left anchor should be when the image collapses but the image is still in the wrong location, shown in 3.png.

When I finally do move the annotation, the annotation moves away from the cursor to the top-left anchor point, shown in 4.png.

Again i’m not sure if this is a bug, but could someone please advise?

Thanks kindly!

— Ari

Edit: I don’t have this problem when setting the anchor points to top-left.

  • Ari Sagiv asked 5 years ago
  • last active 5 years ago
1 vote
10k 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 7 years ago
  • last active 7 years ago
0 votes
9k views

Hi,

I’ve got couple of questions.

  1. Is there a way to automatically change the visible x axis range once we change the DataSeriesSet?

  2. What is the purpose of AutoRange property? If AutoRange is true, it doesn’t allow to zoom the chart. Is there a way to enable zooming when AutoRange true?

Thanks,
Charith

0 votes
4k views

Hi,

I have 2 separate charts (SciChartSurface) and my goal is to enable mouse selection of a series on only the chart surface that contains the series. I do not share renderable series and not even data series between different chart surfaces. I am not sure why a series on the second chart surface is selected when I click on an area within the first chart surface. How can I prevent this from happening?

Could it be this is a bug in that SeriesSelectionModifier checks for hitpoints beyond the chart surface on which the mouse hit occurred? I verified and this problem only occurs when sharing Chart Modifiers via MouseManager. Attaching the MouseManager.MouseEventGroup to each individual modifier does not seem to work, it looks like it has to be attached to “ModifierGroup”. So I am still stuck with this problem.

<s:SciChartSurface.ChartModifier>
            <s:ModifierGroup s:MouseManager.MouseEventGroup="MyMouseEventGroup">

                <s:SeriesSelectionModifier ReceiveHandledEvents="True">
                    <s:SeriesSelectionModifier.SelectedSeriesStyle>
                        <Style TargetType="s:BaseRenderableSeries">
                            <Setter Property="StrokeThickness" Value="10"/>
                        </Style>
                    </s:SeriesSelectionModifier.SelectedSeriesStyle>
                </s:SeriesSelectionModifier>

                <s:RubberBandXyZoomModifier ReceiveHandledEvents="True" IsAnimated = "False" IsXAxisOnly = "True" ExecuteOn = "MouseRightButton"/>
                <s:CursorModifier ReceiveHandledEvents="True" SourceMode="AllSeries" ShowAxisLabels="True" />
                <s:ZoomPanModifier ReceiveHandledEvents="True" XyDirection="XYDirection" ClipModeX = "ClipAtExtents" ExecuteOn ="MouseLeftButton"/>
                <s:MouseWheelZoomModifier ReceiveHandledEvents="True" XyDirection = "XDirection"/>
                <s:ZoomExtentsModifier ReceiveHandledEvents="True" IsAnimated = "False" ExecuteOn = "MouseDoubleClick"/>
                <s:LegendModifier ReceiveHandledEvents="True" Name="GeneralLegend" ShowLegend="True" LegendPlacement ="Inside" GetLegendDataFor="AllSeries" Margin="10" LegendItemTemplate="{StaticResource LegendItemTemplate}"/>


            </s:ModifierGroup>
        </s:SciChartSurface.ChartModifier>
  • bbmat asked 5 years ago
  • last active 5 years ago
0 votes
7k views

Hi,

I have a chart with 4 axes (two X and two Y), when I try use AnnotationCreationModifier to create annotation, I get next error:

at Abt.Controls.SciChart.Visuals.Annotations.AnnotationBase.FromCoordinates(Double xCoord, Double yCoord)
at Abt.Controls.SciChart.Visuals.Annotations.AnnotationBase.FromCoordinates(Point coords)
at Abt.Controls.SciChart.Visuals.Annotations.AnnotationBase.UpdatePosition(Point point1, Point point2)
at Abt.Controls.SciChart.ChartModifiers.AnnotationCreationModifier.OnModifierMouseUp(ModifierMouseArgs mouseButtonEventArgs)
at Abt.Controls.SciChart.ChartModifiers.ModifierGroup.c9fd5ab524d787e8439d8933aeb87fdc5(IChartModifier c6b1effd112e5355cd5f051dd91cd4f67, ModifierMouseArgs cbb39038dde40bfc3fdcfa70f4bbf8778)
at Abt.Controls.SciChart.ChartModifiers.ModifierGroup.c9e8960a6a8527c20ac9e46e162c72b22(Action`2 c4bd4ab823835cf92d221476b6fb65a17, ModifierMouseArgs c4c23d80d4d060e409c3479ef17d6c65e)
at Abt.Controls.SciChart.ChartModifiers.ModifierGroup.OnModifierMouseUp(ModifierMouseArgs e)
at Abt.Controls.SciChart.Utility.Mouse.MouseManager.cad56cb88fe961ec17710025afdf79607(ModifierMouseArgs cbb39038dde40bfc3fdcfa70f4bbf8778, IReceiveMouseEvents c18509698be3f9366c690e7d2b107b62c, Boolean c3791a1b71c1577bde30b55c12b2a5583)
at Abt.Controls.SciChart.Utility.Mouse.MouseManager.cf88844ca415efe316ebbc6460c4d5477.c017276be757b162458755f3f8e0c9aa6.cd7319400482f82418e9a97b614eab2ca(IReceiveMouseEvents c133657388cc0f6f6615e21e129ac4b3a)
at A.c19dd4d74f6373c95c517d29624d76e4b.cacf72b657252e3e73860afb89d70cb9f[c13c28af86f0b14202b9c7ef43b1bd11a](IEnumerable`1 c40a30a1bb6416cd164565919fdef15a9, Action`1 c885aac61bc9832561b7ff07903c88d5e)
at Abt.Controls.SciChart.Utility.Mouse.MouseManager.cf88844ca415efe316ebbc6460c4d5477.cef5451dcf09f913b48c9730b7cb0d11d(Object cae49ecc8585f35e8dd5ce624f7fb7ab5, MouseButtonEventArgs c4c23d80d4d060e409c3479ef17d6c65e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run()
at SciTest.App.Main() in d:\Projects\Test\SciChart\SciTest1\SciTest\obj\Debug\App.g.cs:line 0
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

My Xaml code:

<s:SciChartSurface x:Name="sciChart" Grid.Row="1" ClipModifierSurface="True" s:ThemeManager.Theme="Chrome">

    <s:SciChartSurface.RenderableSeries>
        <s:FastCandlestickRenderableSeries XAxisId="X" YAxisId="Y"/>
    </s:SciChartSurface.RenderableSeries>

    <s:SciChartSurface.XAxes>
        <s:CategoryDateTimeAxis Id="X"/>
        <s:CategoryDateTimeAxis Id="X2"/>
    </s:SciChartSurface.XAxes>

    <s:SciChartSurface.YAxes>
        <s:NumericAxis TextFormatting="0.0#" Id="Y"/>
        <s:NumericAxis TextFormatting="0.0#" Id="Y1"/>
    </s:SciChartSurface.YAxes>

    <s:SciChartSurface.ChartModifier>
        <s:ModifierGroup>
            <s:AnnotationCreationModifier YAxisId="Y" x:Name="annotationCreation" AnnotationCreated="OnAnnotationCreated"/>
            <s:YAxisDragModifier/>
            <s:XAxisDragModifier/>
        </s:ModifierGroup>
    </s:SciChartSurface.ChartModifier>

</s:SciChartSurface>
0 votes
7k views

I am trying to use SciChart to graph a logarithmic spiral with a fast line renderable series. I am also using the zoom pan and mouse wheel zoom chart modifiers to allow the user to zoom and pan the chart.

However, panning the chart so part of the spiral goes off the right side of the screen causes the corresponding left part of the spiral to disappear. Moving the center of the spiral off the right side of the screen causes the entire chart disappear.

I suspect SciChart is attempting to optimizing the line drawing and does not expect the line to loop back into the visible region. Is there a setting I can change to prevent the spiral in the visible region from disappearing?

I am using SciChart version 1.55.4761 and have noticed this behavior with the x-y scatter renderable series as well.

0 votes
6k views

Hi,

TX and TY in XyDataSeries<TX,TY> are currently subject to some unclear constraints to do with the internal implementation of SciChart. Would it be possible to either remove these constraints or expose them as interfaces and .NET generic type constraints on XyDataSeries<TX,TY>?

Specifically, I’d like to enable ulong as a valid TX and my own complex data type as a TY. I’m creating a CustomRenderableSeries where each point has x, y, shape, colour and size. I can encode these data within the bytes of e.g. an XyzDataSeries<DateTime,double>, but its inconvenient, hacky and unclear. It would seem more natural to create a type to contain those fields and then have a XyDataSeries<DateTime, MyPointData>

I can make MyPointData IComparable and anything else that is required.

Any thoughts?

Cheers
Felix

  • F W asked 6 years ago
  • last active 6 years ago
0 votes
7k views

My goal: Cumulate several values over a time span and show them as stacked bars, where the bars should be located exactly over the time span.

Current situation: Bars are always centered around the x value of the datapoint.

Question: How can bars be shifted to the left? In the attached picture the blue bars represent the current situation, the yellow bars are drawn by offseting the x values by -0.5s. The latter is what I wanted to achieve. Is there an easier approach I havn’t seen so far?

Thanks for your support!

0 votes
5k views

Is there any way I can store and later access an object (enum, string,…) to/from RenderableSeries?

  • bbmat asked 6 years ago
  • last active 6 years ago
0 votes
7k views

Is there a way to bind to a collection of YAxisDragModifier?

<s:YAxisDragModifier DataContext="{Binding YAxisDragModifierList}"/>
_yAxisDragModifierList = new BindableCollection<YAxisDragModifier>();
                        YAxisDragModifier yAxisDragModifer = new YAxisDragModifier();
                        yAxisDragModifer.AxisId = y.Name;
                        _yAxisDragModifierList.Add(yAxisDragModifer);

The reason I wanted to be able to bind to the YAxisDragModifier is because some of my charts could have N numbers of Y-Axis and I need to be able to have N numbers of YAxisDragModifier that corresponds to the Y-Axis.

Y-Axis: Y1 -> YAxisDragModifier: Y1
Y-Axis: Y2 -> YAxisDragModifier: Y2

Y-Axis: YN -> YAxisDragModifier: YN

An alternative solution is to explicitly list a finite number of YAxisDragModifier and assign the AxisId to the YAxisDragModifier.:

<s:SciChartSurface.ChartModifier>
                <s:ModifierGroup s:MouseManager.MouseEventGroup="{Binding GUID}">
                    <s:LegendModifier x:Name="legendModifier" GetLegendDataFor="AllSeries"/>
                    <local:RubberBandXyZoomModifierEx ReceiveHandledEvents="True" ExecuteOn="MouseLeftButton"/>
                    <local:ZoomPanModifierEx ReceiveHandledEvents="True"/>
                    <s:MouseWheelZoomModifier />
                    <s:RolloverModifier ReceiveHandledEvents="True" />
                    <s:CursorModifier ReceiveHandledEvents="True" />
                    <s:YAxisDragModifier AxisId="R0"/>
                    <s:YAxisDragModifier AxisId="R1"/>
                    <s:YAxisDragModifier AxisId="R2"/>
                    <s:YAxisDragModifier AxisId="L0"/>
                    <s:YAxisDragModifier AxisId="L1"/>
                    <s:YAxisDragModifier AxisId="L2"/>
                    <s:XAxisDragModifier ReceiveHandledEvents="True"/>
                    <s:ZoomExtentsModifier ExecuteOn="MouseDoubleClick" IsAnimated="False"/>
                    <local:ContextMenuModifier x:Name="ContextMenuModifier" ReceiveHandledEvents="True"/>
                </s:ModifierGroup>
            </s:SciChartSurface.ChartModifier>

This means, if I have 10 Y-Axis, only six will have the YAxisDragModifier.

Does that make sense?

Thanks,

Johnny

0 votes
0 answers
6k views

HI,
My code works well with 3.1. Today I switch to 3.2. Get exception, please see the attached file.

my code is based on SciChart Trader. When mouse click the chart. the exception happens.

1 vote
5k views

Hello,

I am trying to evaluate Scichart for purchase. I am using live data (17 Channels, many samples per second) to draw FastLineRenderableSeries (0-100% on the y axis, time on the x axis). I have everything working satisfactorily using the MVVM pattern. I have tried the HighQualityRenderSurface and Direct3D10RenderSurface.

Are these renderers actually working or am I still using the software renderer?

I need to draw a translucent rectangle on the chart to indicate a “Good” range of values of y values (say 40-50%).

If I use annotations to draw a rectangle, everything slows down and it is unusable. If I use immediate mode drawing and the HighQualityRendererSurface it is kind of OK. If i use immediate mode drawing and the Direct3D10RenderSurface the rectangle and the series lines alternately flash slowly and it is unusable.

How can I draw a rectangle on the screen using live data and get good performance? Do I need the license for this to work well?

Thanks.

2 votes
11k views

Hi,

Now that I’m binding to a SeriesSource instead of creating my RenderableSeries in XAML, I don’t know how to apply a RolloverMarkerTemplate.

In XAML I had the following:

                        <SciChart:FastLineRenderableSeries SeriesColor="Blue">
                            <SciChart:FastLineRenderableSeries.Style>
                                <Style TargetType="{x:Type SciChart:FastLineRenderableSeries}">
                                    <Setter Property="RolloverMarkerTemplate">
                                        <Setter.Value>
                                            <ControlTemplate>
                                                <Ellipse Width="7" Height="7" Fill="SlateGray" Stroke="SlateGray" StrokeThickness="1" />
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </SciChart:FastLineRenderableSeries.Style>
                        </SciChart:FastLineRenderableSeries>

But now I do something like this:

    _chartSeries.Add(New ChartSeriesViewModel(rawSeries, New FastLineRenderableSeries()))
            With _chartSeries(0).RenderSeries
                .SeriesColor = Colors.Blue
            End With

I’m able to set the SeriesColor = Colors.Blue in code, but I don’t know how to generate the RolloverMarkerTemplate to control other features such as the ellipse shape.

Thanks,
–George

0 votes
9k views

I’m trying to have a two charts which have a x-axis points (datetime) that doesn’t intersect. And i want charts was synchronized like this:
enter image description here

How you can see here upper chart doesn’t have a point at 10.12.2013, but lower has. Can i reach same effect by SciChart?

  • l1pton17 asked 7 years ago
  • last active 7 years ago
Showing 1 - 50 of 3k results