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

0 votes
6 views

When I open activity with chart on real devices chart area for a moment has black color and theh succesfuly displayed chart data.
On emulators I do not see thes behavior.
How can I fix black screen?

0 votes
0 answers
9 views

Hi,
we are using an UICollectionView to display different kinds of views in our application, including charts created with SciChart. We noted that every time a cell with a SciChart is loaded, some memory is allocated and not freed when the cell disappears, which leads to a massive memory leak and eventually crashes the application.
Is there a way to free SciChart resources on demand? Or maybe you suggest another solution to solve this issue?
Regards,
Anna

0 votes
0 answers
7 views

I am binding my chart to an ObservableCollection that consists of many XYDataSeries. When I create and add the XyDataSeries, I set the SeriesName and Stroke properties. The data shows on the chart. I have the following Legend Template:

    <DataTemplate x:Key="LegendItemTemplate" DataType="s:SeriesInfo">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <CheckBox Grid.Column="0" 
                      Margin="5,0"
                      HorizontalAlignment="Left"
                      VerticalAlignment="Center"        
                      Foreground="{StaticResource BlackBrush}"
                      Content="{Binding SeriesName}"
                      IsChecked="{Binding RenderableSeries.IsVisible, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                      Visibility="{Binding LegendData.ShowVisibilityCheckboxes, RelativeSource={RelativeSource AncestorType=s:SciChartLegend}, Converter={StaticResource VisibleWhenTrueConverter}}" />


            <xctk:ColorPicker Grid.Column="2"  x:Name="cpPalette" 
                              ColorMode="ColorPalette" VerticalAlignment="Center"
                              SelectedColor="{Binding RenderableSeries.Stroke, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Height="25" Width="40" />

        </Grid>
    </DataTemplate>

However, when I change the colour using the Colorpicker, my charts series are not updated (ie, changing colour)

0 votes
0 answers
7 views

Hi

Is it possible to show an axis line like on the image?

/Flemming

0 votes
0 answers
7 views

Hi

I have attached an image of a chart.

Is it possible to get the first and last date to stand directly under the tick?

/Flemming

0 votes
0 answers
8 views

Hi

I have tried following your custom DeltaCalculator example:

https://www.scichart.com/documentation/v5.x/Axis%20Ticks%20-%20TickProvider%20and%20DeltaCalculator%20API.html

var axis = new NumericAxis();
axis.DeltaCalculator = new CustomNumericDeltaCalculator();

But there does not seem to be a DeltaCalculator property on the axis object?

/Flemming

0 votes
12 views

Hi,
I want to implement a chart that represent currency changed rate, so that the chart will show a rise with a green point and a fall with a red point.

in the image I’ve uploaded I’ve used Custom PaletteProvider to manipulate the colors accordingly.

what I want to implement is instead of coloring the Point (Ellipse) I want to load an Image.
the closest i’ve got is to load a single image to all the points, without theme changing (red or green) accordingly.

I did managed to implement that exact behavior in iOS.

how could I implement a dynamically changing Sprits in a PaletteProvider ?

Thanks in advance…

0 votes
0 answers
11 views

I am aware that for performance reasons that SciChart expects data to be sorted in the X direction. But is it possible to have it sorted in a descending order rather than the default ascending order?

  • muh fugen asked 4 days ago
  • last active 4 days ago
0 votes
21 views

Can you help me please!
I was searching forum and see all different questions with dfferent ansvers but no one help for me.

I’m using CategoryDateAxis and whant to show to users vertical lines between days, weeks or month
Its depends from timestamp and visible period.
I need to opportunity to provide themself when to display vertical line.

In chart I display CandlestickSeries from stosk market and users whant to know when one day is ended and new day is begin.

How can I do that?

0 votes
13 views

I want to use a CursorModifier – but is it possible to only show the vertical line?

/Flemming

0 votes
25 views

I have CategoryDateAxis and whant to setup range limit from series size – 50 to series size + 10

mBottomAxis.setVisibleRangeLimit(new DoubleRange(series.size() - 50d, series.size() + 10d));
mBottomAxis.setVisibleRangeLimitMode(RangeClipMode.MinMax);

And this code works but not as I expected
When I scrol chalt and hits the range limit scroll is stopped BUT chart is zooming in

How to disable zooming when I hits the limit?

0 votes
23 views

I’m trying to create a custom overview control as shown in the example with the same name, but all I get is an empty black box. The main chart is working just fine and I have it bound (for now) to the same data series as the main chart. However the only way I can get it to show anything in the overview chart is to bind it’s x and y axes to the same as the main chart, which basically makes it a copy.

            <sc:SciChartSurface x:Name="OverviewSurface" Loaded="OnOverviewSurfaceLoaded" Grid.Row="1" Margin="10,0,0,0" RenderableSeries="{sc:SeriesBinding RenderableSeriesViewModels}" >

            <sc:SciChartSurface.XAxis>
                <sc:NumericAxis DrawMajorGridLines="False" DrawMinorGridLines="False" Visibility="Collapsed"/>
            </sc:SciChartSurface.XAxis>

            <sc:SciChartSurface.YAxis>
                <sc:NumericAxis DrawMajorGridLines="False" DrawMinorGridLines="False" Visibility="Collapsed"/>
            </sc:SciChartSurface.YAxis>
        </sc:SciChartSurface>

That code above just doesn’t work at all. The RenderableSeriesViewModels are the same as bound to the main chart which is working. I’ve tried variations, using AutoRange and and creating all new ViewModels just for the overview axes but the only way I can get it to show anything at all is to bind it to the main chart axis and then I can’t hide them without hiding them on the main chart.

0 votes
0 answers
23 views

Hi!

As I found a decent solution to my previous question for how to create a simple, single vertical line chart modifier, I deleted my previous post; I use the TooltipModifierBase and just added a line where I need it, orientating myself on how the CursorModifier works.

My problem now is, I can’t get the coordinates to show on the axis label when using “UpdateXAxesOverlay(mousePoint)”. The label shows up properly, but it just says “SciChart.Charting.Visuals.RenderableSeries.AxisInfo” on it. I assume I’m missing a binding or such somewhere, but I’ve sadly been unable to figure out where or how to get it work.

0 votes
0 answers
24 views

When there are 2 or more horizontal/vertical axis, how to hide the cursor label for specific axis?

0 votes
0 answers
27 views

Sir,
I have a dataseries from a music file and displaying it in realtime on the screen. The chart shows only a small portion of the waveforms and on each dispatcher timer tick (10ms) I am adjusting the visible range of the chart as shown below.

        }
       // sciChartZoom.XAxis.VisibleRangeChanged -= TimeSpanAxis_VisibleRangeChanged;

        DateTime dtmp = dtmin;
        TimeSpan drng = new TimeSpan(0, 0, VisCon.zoomRangeIn);
        TimeSpan ttmp = TimeSpan.FromSeconds(VandC.posSeconds);
        TimeSpan dtlo = ttmp.Subtract(drng);
        TimeSpan dthi = ttmp.Add(drng);

        dtmp = dtmp.AddSeconds(VandC.posSeconds);


        double posAxis = (double)sciChartFull.XAxis.GetCoordinate(ttmp);

        Thickness m = posRec.Margin;
        m.Left = posAxis - VisCon.posRectmargin1;
        posRec.Margin = m;

        sciChartZoom.XAxis.VisibleRange = new TimeSpanRange(dtlo, dthi);

        //sciChartZoom.XAxis.VisibleRangeChanged += TimeSpanAxis_VisibleRangeChanged;

    }

My problem is that the chart does not move very smooth and it uses around 50% CPU power(core i5 3.2GHz). Decreasing the timer ticks less than 10ms does not make any improvement.

I am attaching a picture of how the chart looks. The top is the zoom chart while the bottom one is always static.

Can you help please?

Regards
Julian

0 votes
0 answers
24 views

Hi, we are updating our scichart component to version 5. Now we had to change our Series Binding which is obsolete now to RenderableSeries binding.

In the most graphs it works fine but I have also graphs that uses ElementName with paths for the binding and that does not work.

I tried the following versions which all did not work, is there a different way to do it?

<!-- old scichart version which is not allowed anymore-->
    <s:SciChartSurface Style="{StaticResource SciChartSurfaceStyle}" 
                       SeriesSource ="{Binding ElementName=GraphRoot, Path=Series}"
                       BorderThickness="1 0 0 0"
                       Background="Transparent">

<!-- First try with new version which is not working because we don't use seriesBinding-->
    <s:SciChartSurface Style="{StaticResource SciChartSurfaceStyle}" 
                       RenderableSeries ="{Binding ElementName=GraphRoot, Path=Series}"
                       BorderThickness="1 0 0 0"
                       Background="Transparent">

<!-- Second try with new version which is also not working -->
    <s:SciChartSurface Style="{StaticResource SciChartSurfaceStyle}" 
                       RenderableSeries ="{s:SeriesBinding ElementName=GraphRoot, Path=Series}"
                       BorderThickness="1 0 0 0"
                       Background="Transparent">

<!-- Last try with new version which is also not working becaus without ElementName he cannot find the Series-->
    <s:SciChartSurface Style="{StaticResource SciChartSurfaceStyle}" 
                       RenderableSeries ="{s:SeriesBinding Series}"
                       BorderThickness="1 0 0 0"
                       Background="Transparent">

Please is there any idea how to solve this?

0 votes
29 views

When trying to create a candlestick graph, if I have data with no high low bars with a range of more than 0.00950 then the graph won’t zoom in on initial load. See my code further below. Above 0.00950 and it’s okay. BTW I’ve tried withVisibleRage.

Please help, my trial is going to run out soon. I’m really stuck.

For example:

The following won’t zoom in:

[
    {
        "symbol": "AUDCAD",
        "ctm": "2018-02-10 09:00:00",
        "high": 0.98000,
        "low": 0.97100,
        "open": 0.97900,
        "close": 0.97800,
        "volume": 1238
    } ]

The following does zoom in:

[
    {
        "symbol": "AUDCAD",
        "ctm": "2018-02-10 09:00:00",
        "high": 0.98000,
        "low": 0.97000,
        "open": 0.97900,
        "close": 0.97800,
        "volume": 1238
    }
]

Here’s a screenshots:

enter image description here enter image description here

Here’s the code which produces the charts:

final CategoryDateAxis xAxis = sciChartBuilder.newCategoryDateAxis()
        .withVisibility(isMainPane ? View.VISIBLE : View.GONE)
        .withAutoTicks(true)
        .withGrowBy(new DoubleRange(0d, 0.1d))
        .build();

final NumericAxis yAxis = sciChartBuilder
        .newNumericAxis()
        .withAxisId(PRICES)
        .withAutoRangeMode(AutoRange.Always)
        .withDrawMinorGridLines(true)
        .withDrawMajorGridLines(true)
        .withMinorsPerMajor(10)
        .withMaxAutoTicks(20)
        .withGrowBy(new DoubleRange(0d, 0.1d))
        .build();

surface.getXAxes().add(xAxis);
surface.getYAxes().add(yAxis);

surface.getRenderableSeries().addAll(model.renderableSeries);
0 votes
0 answers
31 views

for HorizontalLineAnnoataion and VerticalLineAnnotation, if the LabelPlacement is set to values other than Auto or Axis, the label is still seen even the ShowLabel is set to false.

Here is the source code
Xaml

<sc:SciChartSurface.XAxis>

</sc:SciChartSurface.XAxis>
<sc:SciChartSurface.YAxis>

</sc:SciChartSurface.YAxis>

        <sc:SciChartSurface.Annotations>
            <sc:VerticalLineAnnotation VerticalAlignment="Stretch" x:Name="V1"
                                      FontSize="12"
                                      FontWeight="Bold"
                                      ShowLabel="True"
                                      Stroke="Brown"
                                      StrokeThickness="2"
                                      X1="9" LabelPlacement="Auto"
                                      Y1="4" />

            <sc:HorizontalLineAnnotation HorizontalAlignment="Stretch" x:Name="H1"
                                        FontSize="12"
                                        FontWeight="Bold"
                                        LabelPlacement="TopLeft"
                                        ShowLabel="True"
                                        Stroke="Orange"
                                        StrokeThickness="2"
                                        X1="7"
                                        Y1="2.8" />
        </sc:SciChartSurface.Annotations>
    </sc:SciChartSurface>
    <UniformGrid Rows="1" VerticalAlignment="Top" HorizontalAlignment="Right">
        <CheckBox IsChecked="{Binding ElementName=H1, Path=ShowLabel}" Foreground="White"  Margin="3">
            <CheckBox.Content>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="H1" VerticalAlignment="Center"/>
                    <ComboBox ItemsSource="{Binding Source={x:Static local:MainWindow.LabelPlacements}}" SelectedItem="{Binding ElementName=H1, Path=LabelPlacement}" />
                </StackPanel>
            </CheckBox.Content>
        </CheckBox>
        <CheckBox IsChecked="{Binding ElementName=V1, Path=ShowLabel}" Foreground="White" Margin="3">
            <CheckBox.Content>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="V1" VerticalAlignment="Center"/>
                    <ComboBox ItemsSource="{Binding Source={x:Static local:MainWindow.LabelPlacements}}" SelectedItem="{Binding ElementName=V1, Path=LabelPlacement}" />
                </StackPanel>
            </CheckBox.Content>
        </CheckBox>
    </UniformGrid>
</Grid>

And the cs
using SciChart.Charting.Visuals.Annotations;
using System;
using System.Windows;

namespace SciChartLineAnnotation
{
///

/// Interaction logic for MainWindow.xaml
///

public partial class MainWindow : Window
{
public static LabelPlacement[] LabelPlacements { get; private set; }

    static MainWindow()
    {
        Array array = System.Enum.GetValues(typeof(LabelPlacement));
        LabelPlacements = new LabelPlacement[array.Length];
        int idx = 0;
        foreach(var item in array)
        {
            LabelPlacements[idx++] = (LabelPlacement)item;
        }
    }

    public MainWindow()
    {
        InitializeComponent();
    }
}

}

0 votes
35 views

How can I append a float array to an XYDataSeries?

I’m developing an app with scichart. I receive buffers of 20 floats in a float[] type. How can I append this buffer to an XYDataSeries? The chart is updated in real time each time one Buffer is received with FIFO capacity.

What I need is something similar to:

void updateChart(final float[] a, final float[] b) {
    UpdateSuspender.using(surface, new Runnable() {
            @Override
            public void run() {
                // Append the new data received
                lineData.append(a,b);
                // Zoom series to fit the viewport to the x variable
                surface.zoomExtentsX();
            }
        });
}

Is this possible?
Thank you in advance

0 votes
36 views

I have an error after update Android Stutio to version 3.1
But project is steel builds and run successfully

0 votes
42 views

I added nearly 607 lines using code:
_verticalLineAnnotations.Add(new VerticalLineAnnotationViewModel()
{
VerticalAlignment = VerticalAlignment.Stretch,
Stroke = Utility.Utility.ConverStringToColor(item.Color.ToString()),
StrokeThickness = 2,
X1 = item.Time,
Tooltip = item.Label,

        });

However, the rendering on the chart is very slow, it takes time to get these points loaded, is there a way to make it fast???

0 votes
0 answers
41 views

Hello,

I am using Numeric Axis View Model for making Y-Axis dynamically. I want to show strings instead of number. I saw the label provider api but i don’t get how to use this Label Provider. Can anyone tell me or give me a working example of showing strings instead of number using label provider.

Thanks

0 votes
31 views

Hi

Please can you give me a guide as to how to pull out the Android EEG channel example into a standalone project so that I can use it and build on it.

I have tried but I am getting errors.

Thanks

  • BuchananA5 asked 2 weeks ago
  • last active 2 weeks ago
0 votes
0 answers
34 views

Hello,

I have a usercontrol in which there is SciChartSurface and Modifiers and this UserControl(Name = UCSciChart) have its own ViewModel(Name = UCSciChartViewModel). Now I have Another User Control(Name = TimeChartView) in which I placed UCSciChart usercontrol 1 for single mode and 16 for multiple mode. TimeChartView has its own view model (TimeChartViewModel). Now if click on series, the style applies, but if i click outside it does not goes to old style, it is in single mode. If i click on multiple mode, then there is multiple user control and all have their own view model. But in multiple mode, if i click on series no style is applied.

I am posting my code here:

UCSciChart.xaml


<s:SciChartSurface.ChartModifier>


<s:SeriesSelectionModifier.SelectedSeriesStyle>

</s:SeriesSelectionModifier.SelectedSeriesStyle>






</s:SciChartSurface.ChartModifier>

TimeChartView.xaml

<UniformGrid.ContextMenu>

</UniformGrid.ContextMenu>

0 votes
0 answers
38 views

How performance can be improved?

0 votes
0 answers
45 views

How can i distinguish vertical line annotations?

Suppose there are 2 groups of vertical lines. I want to delete vertical lines of one group.

Thanks.

0 votes
0 answers
50 views

Hello,

I am unable to install SciChart pod.
The podfile has multiple pods with multiple platforms and source.
I get the error saying ” [!] Unable to find a specification for ‘SciChart’.”
Please advice..

use_frameworks!

pod 'UICircularProgressRing'
pod 'Alamofire'

platform :ios, '8.0'
source 'https://github.com/CocoaPods/Specs.git'

pod 'SideMenu'

source 'https://github.com/ABTSoftware/PodSpecs.git'
pod 'SciChart', :git => 'https://github.com/ABTSoftware/PodSpecs.git'
0 votes
0 answers
37 views

Hello,

I just want to get the x-axis value anywhere i click on the chart . Suppose if i click on a chart in centre, i want to get the values of this point(x-axis,y-axis). I am using the custom modifier for hit-testing to check if i click on x-axis,y-axis or on chart. Tell me what should i change in this modifier code to achieve my expected output.

Below is my Custom Modifier Code.

public class HitTestingModifier : ChartModifierBase
{
public override void OnModifierMouseDown(ModifierMouseArgs e)
{
IAxis xAxis = null;
IAxis yAxis = null;
bool isOnYAxis = false;
bool isOnXAxis = false;
bool isOnChart = IsPointWithinBounds(e.MousePoint, ModifierSurface);

        foreach (var axis in YAxes)
        {
            isOnYAxis = IsPointWithinBounds(e.MousePoint, axis);
            if (isOnYAxis)
            {
                yAxis = axis;
                break;
            }
        }

        foreach (var xaxis in XAxes)
        {
            isOnXAxis = IsPointWithinBounds(e.MousePoint, xaxis);
            if (isOnXAxis)
            {
                xAxis = xaxis;
                break;
            }
        }

        if (isOnXAxis)
        {
            MessageBox.Show("X-Axis: " + xAxis.AxisTitle);
        }

        if (isOnYAxis)
        {
            MessageBox.Show("Y-Axis: " + yAxis.AxisTitle);
        }

        base.OnModifierMouseDown(e);
    }

    public bool IsPointWithinBounds(Point point, IHitTestable element)
    {
        var tPoint = ParentSurface.RootGrid.TranslatePoint(point, element);


        bool withinBounds = (tPoint.X <= (element as FrameworkElement).ActualWidth && tPoint.X >= 0)
                            && (tPoint.Y <= (element as FrameworkElement).ActualHeight && tPoint.Y >= 0);

        return withinBounds;
    }
}
0 votes
0 answers
39 views

Hello,

I’ve created a generalized UserControl that allows the user to add any number of charts. This control also has a shared X axis that all charts in it use. In another control, any number of these UserControls can be generated. When I have three or more of these controls, the graphing slows down tremendously. Upon profiling the program, the DoDrawingLoop function uses >70% of the CPU despite drawing very little.

In essence, if I have 8 charts in one of my controls it will be quite performant. If I have 2 charts in 4 different controls, then I experience incredible slowdown in the charts. I do have RenderPriority set to low. I turned the sample rate of the NI card I’m using down to 20 hz (to virtually eliminate any external load, the individual controls can handle 10000 hz with several charts quite easily) and the issue persists. This leads me to believe it may be a synchronization issue (perhaps overloading the UI thread, etc.)

Any other insight would be much appreciated.

VS2015 diagnostic report (96mb): https://drive.google.com/open?id=1tQajTLsp8U-Ws7IxlMGkXiNd8MSEbRaI

Thanks,
Mike

0 votes
39 views

Hi Team,

As per our requirement, we need to plot chart as shown in the attachment, let us know is it achievable with SciChart and if yes, could you please help us on this.

Thanks!!
SP

  • Swapna P asked 3 weeks ago
  • last active 2 weeks ago
0 votes
87 views

Hi everyone!

Tell me please why this is happening (in logcat) This is the message I always get the first call or load the markup with scichart

03-30 14:20:46.406 3564-3564/com.gtmobile D/WellDetailChartFragment: BEFORE INFLATE…
03-30 14:20:46.457 3564-3564/com.gtmobile E/libEGL: call to OpenGL ES API with no current context (logged once per thread)
03-30 14:20:46.471 3564-3564/com.gtmobile D/WellDetailChartFragment: AFTER INFLATE…

Сan anyone give me an example of markup for <android.support.design.widget.CoordinatorLayout>
what should I use there is a container to display the scichart?

Have tried containers for Fragment with scichart :

in the first case gives an error (Perhaps this is not acceptable, because the container has a scroll)

<android.support.v4.widget.NestedScrollView
    android:id="@+id/well_detail_container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"/>

in the second case is not displayed, ie just empty.

<FrameLayout
    android:id="@+id/well_detail_container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"/>

I need to work in the wide screen mode (tablet) has several elements on the screen.

In simple activity (as in your examples) everything works perfectly.

On my test device Android 7.0

Android Studio 3.1
Gradle(app)
minSdkVersion 19
targetSdkVersion 26
I am using trial version scichart which will end in a few days 🙁

Thanks in advance for any information.

0 votes
0 answers
53 views

I am looking for the change the interval in Axis. Suppose I have a visible range from 1 to 10. Then SciChart Axis shows 1,2,3..10. But if i want to change its interval like i want to show 1,1.5,2,2.5,3…10. So how can i change this.

0 votes
59 views

Hi all,

I’m developing an app which receives and displays 100’s of samples per second similar to what you would see with the FIFO tutorial. Instead of the sample number, 1000, 1001, etc., I’d like to show seconds so far instead of the sample number.

For example, at sample 1000 display 10, from 1001 to 1099 display nothing, at 1100 display 11, etc. Something simple like sampleNum/100. Can you give me a hint where to start looking to change the behavior of the (major?) tick markings? Do I do something with the NumericAxis class?

Thank you for pointers.

Ed

0 votes
59 views

I am stacking a number of SciChartSurfaces in a UniformGrid and using the MouseEventGroup to control modifiers. This works well in my test code for modifiers such as the CursorModifier and RolloverModifier, but when I add a VerticalSliceModifier to the ModifierGroup, it does not work as expected. Each chart gets the vertical slice cursors, but they function independently as if not part of a mouse event group. Are the VerticalSliceModifier(s) compatible with mouse groups? An image of the output is attached. Here is the data template that I’m using:

<ItemsControl.ItemTemplate>
    <DataTemplate>

      <s:SciChartSurface Margin="0,0,0,2" 
          RenderableSeries="{s:SeriesBinding RenderableSeries}"  
          Annotations="{s:AnnotationsBinding Annotations}"
          YAxes="{s:AxesBinding YAxes}"
          XAxes="{s:AxesBinding XAxes}">

        <s:SciChartSurface.ChartModifier>

          <s:ModifierGroup s:MouseManager.MouseEventGroup="{Binding MouseEventGroup}">


            <s:VerticalSliceModifier Name="sliceModifier" ReceiveHandledEvents="True">
              <s:VerticalSliceModifier.VerticalLines>
                <s:VerticalLineAnnotation Style="{StaticResource sliceStyle}" X1="500"/>
                <s:VerticalLineAnnotation Style="{StaticResource sliceStyle}" X1="2000"/>
              </s:VerticalSliceModifier.VerticalLines>
            </s:VerticalSliceModifier>

          </s:ModifierGroup>
        </s:SciChartSurface.ChartModifier>
      </s:SciChartSurface>
    </DataTemplate>
  </ItemsControl.ItemTemplate>
</ItemsControl>
0 votes
64 views

I see that there is a hit test api in SciChart. It is quite easily used if we check that a renderable series is clicked or not. But i want to use it for axis or legend modifier click. So when i click on surface i got the points as x and y point. Now i check that if a axis is clicked or legend modifier is clicked. Please help me in this.

I attached a image which shows sample code that series can be checked by IsHit but there is no such type for axis

0 votes
50 views

Hi,

I tried to remove the black borders of the chart surface but to no avail. Is there a way to remove the border and have the chart to show just the major Grid lines?

I am right now using the theme – Bright Spark.

0 votes
45 views

We have a SciChartSurface that displays data, and includes a collection of threshold lines that can be modified by the user by dragging.
To accomplish this, we are using a class that inherits from ChartModifierBase that includes an attached property for binding an IEnumerable:

public static readonly DependencyProperty ThresholdsSourceProperty =
    DependencyProperty.Register
    (
        "ThresholdsSource",
        typeof(IEnumerable),
        typeof(CustomThresholdModifier),
        new PropertyMetadata(null, OnThresholdsSourceChanged)
     );

public IEnumerable ThresholdsSource
{
    get { return (IEnumerable)GetValue(ThresholdsSourceProperty); }
    set { SetValue(ThresholdsSourceProperty, value); }
}

The property includes a callback method (OnThresholdsSourceChanged) which is used to populate the Annotations collection of the parent SciChartSurface:

private static void OnThresholdsSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
    var thresholdAnnotationModifier = d as CustomThresholdModifier;
    if (thresholdAnnotationModifier != null)
    {
        var newValue = e.NewValue as IEnumerable;
        if (newValue == null) return;

        thresholdAnnotationModifier.RebuildAnnotations();
    }
}

private void RebuildAnnotations()
{
    if ((ParentSurface == null) || (ThresholdsSource == null)) return;

    var annotationCollection = ParentSurface.Annotations;
    annotationCollection.Clear();

    foreach (IThresholdViewModel item in ThresholdsSource)
    {
        var threshold = new CustomHorizontalLineAnnotation{ DataContext = item };
        annotationCollection.Add(threshold);
    }
}

When this code is run, a binding exception occurs, but not until all of the code is successful. The exception:

System.Windows.Data Error: 2 : Cannot find governing FrameworkElement
or FrameworkContentElement for target element.
BindingExpression:Path=RotationAngle; DataItem=null; target element is
‘RotateTransform’ (HashCode=28139356); target property is ‘Angle’
(type ‘Double’)

The exception is clearly thrown downstream by some WPF thread, or I’d be able to wrap a try/catch around this and have better details.

If I comment out the line that creates the CustomHorizontalLineAnnotation, no exception.
If I add a short artificial delay before the first creation of CustomHorizontalLineAnnotation, no exception.
If I set “ShowLabel” = False in the HorizontalLineAnnotation, no exception.
If I add a dummy creation of CustomHorizontalLineAnnotation in the constructor of my CustomThresholdModifier, no exception.
If I add a dummy creation of AnnotationLabel in the constructor of my CustomThresholdModifier, no exception.

In short, the root cause of the binding exception seems to be coming from the creation of an AnnotationLabel in HorizontalLineAnnotation, either through setting ShowLabel=True, or adding it to the AnnotationLabels collection of the HorizontalLineAnnotation.

Any thoughts? I’d like to use the dummy creation of AnnotationLabel in the constructor as the solution to the problem, but this feels too much like a hack, and likely wont pass muster for my team. Maybe there’s some “best practice” being violated here, in using the modifier to update the annotation on property change?

Thanks!

0 votes
0 answers
46 views

I’ve been moving a project over to using MVVM, but I’ve found the IsStaticAxis option I was using in the NumericAxis doesn’t exist in the NumericAxisViewModel. Is it not possible to make the axis static with the View Models?

0 votes
60 views

Hello,
in SciChart Android the vertically-oriented axis title is displayed like this:
a1

I’d like to rotate the title -180 degrees, so that it looks like that (that is the default behaviour in SciChart iOS):
a2
Is there a way to achieve that?

  • Anna Lazar asked 4 weeks ago
  • last active 4 weeks ago
0 votes
63 views

I have a candlestick chart to display an Ohlc data. (Kotlin, Android)

        val candlestickXAxist = sciChartBuilder
            .newCategoryDateAxis()
            .withVisibleRange(range)
            .withAutoTicks(true)
            .build()

        val candlestickYAxist = sciChartBuilder
            .newNumericAxis()
            .build()

        val fastCandlestickRenderableSeries = sciChartBuilder.newCandlestickSeries()
            .withStrokeUp(upColor)
            .withFillUpColor(upColor)
            .withStrokeDown(downColor)
            .withFillDownColor(downColor)
            .withDataSeries(ohlcDataSeries)
            .build()

        UpdateSuspender.using(priceChart) {
            Collections.addAll(priceChart.xAxes, candlestickXAxist)
            Collections.addAll(priceChart.yAxes, candlestickYAxist)
            Collections.addAll(priceChart.annotations, this.currentAnnotation)
            Collections.addAll(priceChart.renderableSeries, this.fastCandlestickRenderableSeries)
            Collections.addAll(priceChart.chartModifiers, sciChartBuilder.newModifierGroupWithDefaultModifiers().build())
        }

In some cases, I need the chart displays the data in a specific date (X value) instead of user should move/pan the chart.

I have tried this

UpdateSuspender.using(priceChart){
                val lastData = priceSeries.last()
                val lastTime = lastData.timePeriodStart.time
                val oneHourAgo = lastTime - 1000*60*60

                Log.i("CHAR_DEMO", "Display time from ${Date(oneHourAgo)} to ${Date(lastTime)}")

                candlestickXAxist.visibleRange = DoubleRange(lastTime.toDouble(), oneHourAgo.toDouble())
                candlestickXAxist.invalidateElement()
            }

But it didn’t work.

And notice that, I’m not sure why the chart xAxis is CategoryDateAxis but the visibleRange is IRange instead of DateRange.

enter image description here

Can someone help me?

Thank you.

  • Vo Hoa asked 1 month ago
  • last active 4 weeks ago
0 votes
59 views

Whenever I add a new vertical line annotation to my scichartsurface, it allways spawns at the top left corner, then if I zoom in/out it then immidietly moves to the right location. Do any of you have any fix so that I dont need to zoom everytime to fix the annotation positions?

Here is a snippet of my code:

                    var line = new VerticalLineAnnotation() {
                        Stroke = Brushes.Gold,
                        StrokeThickness = 1,
                        X1 = xClicked
                    };
                    var text = new TextAnnotation() {
                        HorizontalAnchorPoint = HorizontalAnchorPoint.Center,
                        X1 = xClicked,
                        Text = input,
                        Foreground = Brushes.Black,
                        Background = Brushes.Gold,
                        BorderBrush = Brushes.Black,
                        BorderThickness = new Thickness(2),
                        CornerRadius = new CornerRadius(5)
                    };
                    ViewModel.SciChartSurface.Annotations.Add(line);
                    ViewModel.SciChartSurface.Annotations.Add(text);
0 votes
71 views

Hello,

I’ve just downloaded a trial of SciChart WPF. Now I’m trying to add a 3D graph to my VS 2017 WPF project. I’ve added references to SciChart.{Charting, Charting3D, Core, Data, Drawing, Drawing.DirectX} and I’m using the example https://www.scichart.com/example/wpf-3d-chart-example-simple-uniform-mesh-3d-chart/ .

The graph in the WPF indicates that: “3D charts are only available in the 3D or SDK editions of SciChart”. Why?

0 votes
57 views

I saw similar topic that can export HeatMapColorMap with help of BoxAnnotation. But BoxAnnotation can be placed within plot area. I want to have ColorMap outside of Plot Area, may be next to y-Axis. But it should not be obstructing the plotting area. Any idea?

0 votes
78 views

I cannot get panning to work on the x axis which is a DateTimeAxis. I am databinding the visible range to a property on my view model and the zooming works ok. Also panning on the Y-axis works.

Here is my XAML:

<s:SciChartSurface x:Name="_sciChartSurface" Grid.Row="1" Grid.ColumnSpan="2" RenderableSeries="{s:SeriesBinding PlotViewModels}">
            <s:SciChartSurface.XAxis>
                <s:DateTimeAxis AxisTitle="{Binding HorizontalTitle}" VisibleRange="{Binding HorizontalRange, Mode=TwoWay}" AutoRange="Never"
                            IsStaticAxis="True" DrawMajorBands="False" TextFormatting="dd-MMM-yyyy" SubDayTextFormatting="H:mm:ss:tt"
                            AutoTicks="True"/>
            </s:SciChartSurface.XAxis>
            <s:SciChartSurface.YAxis>
                <s:NumericAxis AxisTitle="{Binding VerticalTitle}" AxisAlignment="Left"  VisibleRange="{Binding VerticalRange}"
                           AutoRange="{Binding AutoRange}" DrawMajorBands="False"/>
            </s:SciChartSurface.YAxis>

            <s:SciChartSurface.ChartModifier>
                <s:ModifierGroup>
                    <s:RubberBandXyZoomModifier IsXAxisOnly="False" 
                                            ZoomExtentsY="True" 
                                            IsAnimated="True" 
                                            RubberBandFill="#55FFFFFF" RubberBandStroke="#FFFFFFFF" RubberBandStrokeDashArray="2 2">
                    </s:RubberBandXyZoomModifier>

                    <s:ZoomPanModifier ExecuteOn="MouseRightButton" ClipModeX="None" XyDirection="XYDirection" IsEnabled="True" />
                    <!-- Allow Dragging YAxis to Scale -->
                    <s:YAxisDragModifier DragMode="Scale"/>
                    <!-- Allow Dragging XAxis to Pan -->
                    <s:XAxisDragModifier DragMode="Scale" IsEnabled="True"/>

                    <s:MouseWheelZoomModifier ActionType="Zoom" XyDirection="XYDirection"/>

                    <s:ZoomExtentsModifier IsAnimated="True" ExecuteOn="MouseDoubleClick"/>
                </s:ModifierGroup>
            </s:SciChartSurface.ChartModifier>
        </s:SciChartSurface>
0 votes
60 views

Is it possible to scale Y Axis and its data together?.For example, Current Y Axis Range is (0,10) and Y values are [0,2,5,8]. Now when I scale Y axis range by 10 times (IRange.GrowBy(10,10)) ,i expect the Y values also gets scaled by 10 without modifying the actual data in model (expected result [0,20,50,80])

  • deepak b asked 1 month ago
  • last active 4 weeks ago
0 votes
57 views

How can I add an DataSeries with special characters like:

var newSurface = new SciChartSurface
{
Name = “Y-Test”,
XAxes = new AxisCollection(XAxisEventCollection.Where(x => x.Id == eventItem.XAxisId).ToList()),
YAxes = new AxisCollection(YAxisEventCollection.Where(y => y.Id == eventItem.YAxisId).ToList()),
RenderableSeries = new ObservableCollection(seriesCollection),
Width = Report1.EventChartWidth,
Height = Report1.EventChartHeight,
Background = ColorHelper.GetMediaBrushColor(Colors.White),
RenderSurface = new HighQualityRenderSurface()
};

0 votes
67 views

Hello,

I have added a HorizontalLineAnnotation successfully on my android app.

However, when data changes, I want to update the position (and the label) of it but I don’t see any method of class HorizontalLineAnnotation to do it.

enter image description here

Can someone help me?

Thank you

  • Vo Hoa asked 1 month ago
  • last active 1 month ago
0 votes
70 views

hello, I am Japanese

I am sorry that I am not good at English.

I would like to draw a basic real-time chart

Get numbers from arduino
/arduino/analog/0

I’d like to use HttpURLConnection and get numbers as short as possible

There was something I wanted in the sample. I want to rewrite this and use it

AnimatingLineChart

I do not know where to rewrite
I am satisfied if it can be displayed with 1 line chart

I want a format that can be built

Thank you

0 votes
70 views

We are trying to display a very large line data set and it seems SciChartOverview would be a good way of visualizing full range of data. Let’s say we have 10 lines of millions data points each to be displayed. The idea is to display down-sampled version of these 10 lines in SciChartOverview, and display full-sampled version in the parent surface with x range matched with scroll bar range in SciChartOverview. When user moves the scroll bar or changes its range in SciChartOverview, it will reload data into the parent surface.

Is there a way to achieve above? Thanks.

  • Caleb asked 1 month ago
  • last active 4 weeks ago
0 votes
79 views

Hey,
I have added vertical annotationlines to my line chart in Scichart.
But when a user tries to pull at the annotation, the whole program crashes. There is no reason why the user should do this, but it has happened sometimes. Have you heard about this problem before or do you have a solution?
Andreas

Showing 1 - 50 of 2k results