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

0 votes
45 views

I have tried, numerous times, to understand your example “Series with Metadata,” but to my untrained eye it seems to be doing a lot of things at once, which makes it hard to understand. I am fairly inexperienced with WPF and prefer not to use MVVM. I have figured out most of what I need. But I haven’t figured out how to add metadata to existing data and display the metadata on a chart.

Do you have a simple example of adding metadata to an existing OhlcDataSeries and then displaying the metadata using a cursor tool tip?

Your help would be greatly appreciated,
Steven

  • Steven M asked 6 days ago
  • last active 5 days ago
0 votes
0 answers
40 views

Hi there,

I recently realized that since upgrading to scichart version 5 my custom label provider has stopped working. With version 4 it has always been working fine.

The interesting thing is that the custom label provider works fine when making use of a “standard” NumericAxisViewModel:

IAxisViewModel newAxis = new NumericAxisViewModel ();
newAxis.TickProvider = new CustomTickProvider();
newAxis.LabelProvider = new CustomLabelProvider();

When applying the same logic to a LogarithmicNumericAxisViewModel however, the label providers “FormatLabel” is never called and so no custom labels are shown:

IAxisViewModel newAxis = new LogarithmicNumericAxisViewModel();
newAxis.TickProvider = new CustomTickProvider();
newAxis.LabelProvider = new CustomLabelProvider();

After doing some research I found out that the labelprovider is never attachd to the IAxisCore as the Init function of the labelprovider is never called when its set as the labelprovider of LogarithmicNumericAxisViewModel. (When its attached to a NumericAxisViewModel it is properly called). I suspect there’s bug somewhere in the LogarithmicNumericAxisViewModel that causes this unexpected behavior.

Any help would be appreciated.

Thanks in advance,

Mathieu.

0 votes
0 answers
56 views

Hi there:

I am developing an application where the main chart is a heat map type one. I would like to have a custom cursor modifier to show some values of the x, y and z axes with limit digits. The problem is that so far I get these result:

Capture
EDIT: PLEASE INSERT AN IMAGE HERE

I would like to show only 1 decimal in the Z axis and 0 decimals en the X and Y axis. I have checked your modifiers demo but it seems to be not working for my heatmap chart. Any kind of advice about this issue would help me to have the application I am looking for.

The XAML of my chart is like this:

 <s:SciChartSurface x:Name="sciChart" Grid.Column="1" Grid.Row="3" Padding="0" BorderThickness="0" MouseDown="SciChart_MouseDown" Margin="0">
            <s:SciChartSurface.RenderableSeries>
                <s:FastUniformHeatmapRenderableSeries x:Name="heatmapSeries" 
                                                      Opacity="0.9"/>
            </s:SciChartSurface.RenderableSeries>

            <s:SciChartSurface.XAxis>
                <s:NumericAxis DrawMajorBands="True"  
                               DrawLabels="False"
                               TextFormatting="0N"
                               GrowBy="0, 1"
                               s:RolloverModifier.AxisLabelContainerStyle="{StaticResource AxisLabelStyle}" 
                               s:RolloverModifier.AxisLabelTemplate="{StaticResource AxisLabelTemplate}" 
                               s:CursorModifier.AxisLabelContainerStyle="{StaticResource CursorAxisLabelStyle}"/>
            </s:SciChartSurface.XAxis>

            <s:SciChartSurface.YAxis>
                <s:NumericAxis DrawMajorBands="True" 
                               GrowBy="0, 1"
                               DrawLabels="False" 
                               VisibleRange="0,249"  
                               TextFormatting="0"/>
            </s:SciChartSurface.YAxis>

            <s:SciChartSurface.ChartModifier>
                <s:ModifierGroup>
                    <s:RolloverModifier x:Name="RolloverModifier"
                                    IsEnabled="True"
                                    ShowTooltipOn="Always" />
                    <!--<s:CursorModifier IsEnabled="True" ShowTooltip="True" ShowTooltipOn="MouseOver"
                        ShowAxisLabels="true" SourceMode="AllSeries"/>-->
                    <s:CursorModifier x:Name="CursorModifier"
                                  IsEnabled="False"
                                  UseInterpolation="False"
                                  ShowAxisLabels="False"
                                  ShowTooltip="True"
                                  ShowTooltipOn="MouseOver"/>
                    <!--<s:VerticalSliceModifier IsEnabled="True">
                        <s:VerticalSliceModifier.VerticalLines>
                            <s:VerticalLineAnnotation IsEditable="false"
                                                  LabelPlacement="Axis"
                                                  ShowLabel="true"
                                                  LabelTextFormatting="0"/>
                        </s:VerticalSliceModifier.VerticalLines>
                    </s:VerticalSliceModifier>-->
                </s:ModifierGroup>

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

Thanks in advanced.

0 votes
63 views

I use SciChart mostly for stock charts. My understanding is that the line color of a candlestick sets both the body outline and the wicks. Is there any way to set the opacity and line color of the wicks differently than the body outline?

In a stock chart with many points, the color of the wicks becomes the dominant color, and therefore when looking at a chart the curve of the wicks becomes the dominant curve. I would like to reduce the opacity of the wicks so that the curve of the candlestick bodies is the dominant curve when looking at the chart.

Thanks,
Steven

  • Steven M asked 1 week ago
  • last active 5 days ago
0 votes
84 views

How can I shift my X Axis position upwards? I need to shift X Axis so that I can place some labels below it.

0 votes
78 views

Hello there,

I’m currently working for a customer that is interested in buying SciChart WPF.

But first we have a question regarding the real time charts. It’s not a question that I can state easily but I will give it a try.

So the question goes like this:

Is it possible to have a static curve onto the same chart where the real time data points will be plotted n real time?

For e.g. the customer wants to load a theoretical reference curve on the chart before feeding real time data on the chart so that a real time comparison can be done and based on this comparison some hardware tools that generate the real time data will be stopped or let continue depending on how big the divergence gets between that reference curve and what comes in real time from the hardware tools running in background.

Thanks!

0 votes
0 answers
59 views

I have a simple app where the main activity has a FrameLayout that I use to load fragments in to. All fragments all loaded at the same time and I use hide/show to select what fragment to view.

However, when I add a chart to one of the fragments, then it loads fine initially, but if I hide it and then show it again, the app just stops. There isn’t any errors, it just stops responding.

If I remove the graph, everything works fine. Any ideas?

private void addAllFragments()
{
    getSupportFragmentManager().beginTransaction()
            .add(R.id.mainView, mainScreen, "MainScreen")
            .add(R.id.mainView, alarmScreen, "AlarmsScreen")
            .hide(alarmScreen)
            .commit();
}

private void loadFragment(String id)
{
    FragmentTransaction ft = getSupportFragmentManager().beginTransaction();

    for(Fragment f : getSupportFragmentManager().getFragments())
    {
        if(f.getTag() != id)
        {
            ft.hide(f);
        }
        else
        {
            ft.show(f);
        }
    }

    ft.commit();
}

private void loadMainScreen() {
    loadFragment("MainScreen");
}

private void loadAlarmsScreen() {
    loadFragment("AlarmsScreen");
}
0 votes
0 answers
72 views

Hello,

I’m trying to display a vertical line annotation on a chart using MVVM.

In order to make it work I’ve (All the INotifyPropertyChanged are managed via the BaseViewModel)

public class GraphSurfaceBaseViewModel : BaseViewModel
{
    /// <summary>
    /// A list of annotations
    /// </summary>
    public ObservableCollection<IAnnotationViewModel> Annotations { get; private set; }

 ...
}

I create annotation that way

Graph.Annotations.Add(new VerticalLineAnnotationViewModel()
            {
                X1 = TimeOfComment,
                ShowLabel = true,
                StrokeThickness = 2,
                XAxisId = "Xaxis",
                YAxisId = "Yaxis1",
                AnnotationLabels = new ObservableCollection<AnnotationLabel>() { new AnnotationLabel() {Text = "mon test", LabelPlacement = LabelPlacement.TopRight } }

            });

And the binding to the scichartsurface is :

<s:SciChartSurface   
...         
Annotations="{s:AnnotationsBinding Annotations}"            
</s:SciChartSurface>

I’ve double check that my x axis and y axis have the same ID as the annotation.
The problem is I want to display several annotation labels but they are not appearing. I suspect a problem via the AnnotationsBinding which is not taking the AnnotationLabels from the VerticalLineAnnotationViewModel.

What I got :
enter image description here

What I want (paint skill here):
enter image description here

For the what I want, I can draw a simple vertical bar by settings showLabel = false but I suppose that all the label I previously added to the
AnnotationLabels will not be shown, that’s why I let it.

Thank you for any help.

Renaud

0 votes
68 views

Hi,

It is possible to have different point markers on the same dataseries? Maybe some of the points should use for example the Cross point marker, maybe other points should use the Ellipse point marker and so on. Is there any solution for this?
Thank you,
Brigitta.

0 votes
115 views

chart screenshot

So I am trying to set paddings on the chart, so that the data series do not touch chart edges

I can’t do it with View’s method setPadding because then the black background is present (screenshot shows padding on all sides but I need just left and right)

Also, I managed to achieve no labels, axes, grids etc. but in totally hacky way; I set .withIsCenterAxis and then all other things to false

 .withAxisId(Y_AXIS_ID)
        .withDrawMajorBands(false)
        .withDrawMajorGridLines(false)
        .withDrawMinorGridLines(false)
        .withDrawLabels(false)
        .withIsCenterAxis(true)
        .withDrawMajorTicks(false)
        .withDrawMinorTicks(false)

Is there a normal way of doing this?

thanks

0 votes
95 views

Hi,

I’m attempting to attach a generic/abstract DataSeries to an INotifyPropertyChanged object. However, the TX, TY generics seem to block me from using it as expected. Can anyone help me out?

internal class DataSeriesAbstract : INotifyPropertyChanged
{
    public string dataName;
    public double lastAppendedTimestamp = 0.0f;

    public List<AbstractChartViewModel> subscribers;

    // gives an error that TX and TY cannot be found
    public DataSeries<TX, TY> realData;
    public DataSeries<TX, TY> Data
    {
        get { return realData; }
        set
        {
            realData = value;
            OnPropertyChanged(dataName);
        }
    }
...
}

Thank you

  • Joe asked 2 weeks ago
  • last active 1 week ago
0 votes
0 answers
95 views

Hey Guys,

I have a requirement where I need to show Donut Chart Title , but adding any annotation is crashing my application.

    let textAnnotation = SCITextAnnotation()
    textAnnotation.coordinateMode = .relative
    textAnnotation.x1 = SCIGeneric(0.5)
    textAnnotation.y1 = SCIGeneric(0.5)
    textAnnotation.horizontalAnchorPoint = .center
    textAnnotation.verticalAnchorPoint = .center
    textAnnotation.text = "Test"
    textAnnotation.style.textStyle.fontSize = 14
    textAnnotation.style.textColor = UIColor.fromARGBColorCode(0xff000000);
    textAnnotation.style.backgroundColor = UIColor.clear
    chartSurface.annotations = SCIAnnotationCollection(childAnnotations: [textAnnotation])

Thanks

0 votes
0 answers
79 views

Hello Team,

In Pie Chart with DonutSeries, the segment spacing seems to have no effect on graph.

donutSeries.segmentSpacing = 10

Thanks

0 votes
76 views

I have a C# program that produces a custom data series in the form List, where the Dataline members are Date, Open, High, Low, Close, Volume. Is there some way I can plot my data series in SciChart, without converting it element-by-element into OhlcDataSeries?

  • Steven M asked 2 weeks ago
  • last active 2 weeks ago
0 votes
0 answers
91 views

This might need to be two separate questions, but is there a way to select a point in a line series. or, can I style a pointMarker differently for each data point?

I would prefer to not have to do this with annotations.

0 votes
93 views

Hi Everybody,

I use a FastLineRenderableSeries with an XyDataSeries,

when I append data with a negative incrementation of X value,
nothing seems to be drawn

for example:

 Clear();
 for (int i = 0; i < 100; i++)
 {
      Append(100-i, i);
 }
 ZoomExtents();

but this example is working

 Clear();
 for (int i = 0; i < 100; i++)
 {
      Append(i, i);
 }
 ZoomExtents();

Is there a way to get this working? In my application data comes in real time, so I can’t sort them.

Thanks in advance for your help.

0 votes
103 views

Hi

I want to use a custom Filter to create a new dataseries based on two existing series – like the RatioFilter.

Do you have any examples of that. There must be some complications around assuring that the data is in sync – before creating the new value.

/Flemming

0 votes
94 views

Hello everybody.

What is the best way to pass 3 y-values to single x-value?

Currently i’m using XyyDataSeries + XyDataSeries

Don’t know, if it’s best approach?

0 votes
82 views

Our team is evaluating using the WPF 3D charts for a feature. We need to know if it is possible to add custom objects to the scene and have a user be able to click on the object, allowing for use to manipulate it. Specifically, we’d need to manipulate the clicked object by scaling it and showing a tooltip. The “Add Objects To a 3D Chart” example doesn’t allow you to click on the chess pieces.

0 votes
95 views

Hello,

This might sound like a newbie question (well it is) but I was wondering how this would work.
We have a application made in python that receives data over ethernet or serial, processes it, saves data in a file and then also shows it either in graph or in value. The GUI also has buttons, drop downs and what not to select IPs, serial COMs and send commands. The problem is some issues on processing the data and customization of graphs (among others).

Scichart seems to allow all this and the idea was to make 1 or more threads for the data receiving/sending and processing and then have the GUI thread.
From the examples it seems like everything must be made in C# is this correct? I am more accustomed to C++ .

0 votes
100 views

I am using SciChart MVVM and need to bind to the stroke property of the type LineRenderableSeriesViewModel. Is there anyway to make this happen? It doesn’t support binding as follows:

LineRenderableSeriesViewModel renderSeries = new LineRenderableSeriesViewModel();
Binding b1 = new Binding();
b1.Source = this;
b1.Path = new PropertyPath("color");
BindingOperations.SetBinding(renderSeries, BaseRenderableSeries.StrokeProperty, b1);

I cannot find a way to expose the properties of the LineRenderableSeriesViewModel (IRenderableSeriesViewModel).

0 votes
89 views

Hi guys,

I’ve been trying to select data points in my heat map for the whole without success. I’ve read, re-read and re-re-read the documentation, but I can’t figure out what I’m doing wrong.

Here’s the XAML.

...

<s:SciChartSurface.RenderableSeries>
    <s:FastUniformHeatmapRenderableSeriesForMvvm
        x:Name="heatmapSeries" 
        Opacity="0.9" 
        DataSeries="{Binding UniformHeatmapDataSeries}"
        s:DataPointSelectionModifier.IncludeSeries="True" >

        <s:FastUniformHeatmapRenderableSeriesForMvvm.ColorMap>
            <s:HeatmapColorPalette Maximum="60" Minimum="6">
                <s:HeatmapColorPalette.GradientStops>
                    <GradientStop Offset="0" Color="Transparent"/>
                    <GradientStop Offset="0.1" Color="DarkBlue"/>
                    <GradientStop Offset="0.2" Color="CornflowerBlue"/>
                    <GradientStop Offset="0.4" Color="DarkGreen"/>
                    <GradientStop Offset="0.6" Color="Chartreuse"/>
                    <GradientStop Offset="0.8" Color="Yellow"/>
                    <GradientStop Offset="1" Color="Red"/>
                </s:HeatmapColorPalette.GradientStops>
            </s:HeatmapColorPalette>
        </s:FastUniformHeatmapRenderableSeriesForMvvm.ColorMap>

        <s:FastUniformHeatmapRenderableSeriesForMvvm.PointMarker>
            <s:XPointMarker Fill="Pink" Width="5" Height="5"/>
        </s:FastUniformHeatmapRenderableSeriesForMvvm.PointMarker>

        <s:FastUniformHeatmapRenderableSeriesForMvvm.SelectedPointMarker>
            <s:TrianglePointMarker Fill="White" Width="12" Height="12"/>
        </s:FastUniformHeatmapRenderableSeriesForMvvm.SelectedPointMarker>

    </s:FastUniformHeatmapRenderableSeriesForMvvm>

    ...

</s:SciChartSurface.RenderableSeries>
...

Here’s the MVVM code.

...
class SelectedPointMetadata : IPointMetadata
{
    public bool IsSelected { get; set; }

    public event PropertyChangedEventHandler PropertyChanged;
}
...

double[,] heatMap = new double[heatMapHeight + glowRadius * 2, heatMapWidth + glowRadius * 2];
double[,] glowMatrix = this.getGlowEffectMatrix(glowRadius);

SelectedPointMetadata[,] selectablePoints = new SelectedPointMetadata[heatMapHeight + glowRadius * 2, heatMapWidth + glowRadius * 2];

for (int i = 0; i < spectrogram.SpectrogramAtoms.Count; i++) {
    var atom = spectrogram.SpectrogramAtoms[i];
    int x = Math.Min((int)(atom.Frequency.Hertz / frequencyStep) + glowRadius, heatMapHeight - 1);
    int y = Math.Min((int)(atom.Time.Seconds / xStep) + glowRadius, heatMapWidth - 1);
    this.applyEffectMatrix(x, y, atom.SNR, ref heatMap, ref glowMatrix, glowRadius);

}

var xBound = heatMap.GetLength(0);
var yBound = heatMap.GetLength(1);

Random rnd = new Random();

for (var i = 0; i < xBound; i++)
{
    for (var j = 0; j < yBound; j++)
    {
        var x = rnd.Next(1, 10);

        selectablePoints[i, j] = new SelectedPointMetadata() { IsSelected = false };

        if (x == 5)
        {
            selectablePoints[i, j].IsSelected = true;
        }

    }
}

this.UniformHeatmapDataSeries = new UniformHeatmapDataSeries<double, double, double>(
    heatMap,
    (-xStep * glowRadius),
    xStep,
    (-frequencyStep * glowRadius),
    frequencyStep,
    selectablePoints
    );

...

What am I missing?

0 votes
93 views

I’m try to generate a UIImage from a SCIChartSurface into a graphic context using the code below from a view that is not displayed on the screen. The image created is pure black, which indicates it did not draw. If I display the graph in a view on the devices screen, the graph draws correctly.

UIGraphicsBeginImageContextWithOptions(self.chart.bounds.size, NO, 0.0);
[self.chart drawViewHierarchyInRect:self.chart.bounds afterScreenUpdates:YES];
UIImage *chartImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

Are there any special steps that are needed to draw into a graphic context?

0 votes
92 views

Hi all,

Why the API’s for iOS, Android and WPF are not identically?
I have seen many samples on the forum, but to adapt it to a different platform is very hard.
A lot of classes are different for each platform.

  • Is there any “comparison” for the different platforms?
  • Is this planned to unify the API’s?

Regards
Urs

  • Urs Geser asked 3 weeks ago
  • last active 3 weeks ago
0 votes
0 answers
78 views

I am trying SciChart iOS.

I run the demo code, and check on the line chart.
The y-axis label is on the right of the plot, and aligned center.

I tried to modify the alignment to right by adding the following code.
(Also, changing things like amplitude or rightAxisAreaForcedSize)

yAxis.style.labelStyle.alignmentHorizontal = SCILabelAlignmentHorizontal_Right;

I was hoping that the smallest digit of “0” and “100” can be aligned,
but no effect could be seen when I ran the code. (still center-aligned)

Is that a bug or is there any reason for the behavior?

FYI, when I modify the code again with “SCILabelAlignmentHorizontal_Left”, it work as expected.

0 votes
87 views

I am developing PieChart with MVVM.
I would like to hide the details of the item. How can I do this?

0 votes
0 answers
134 views

Hi Guys,

I am not able to figure out solution for handling NAN values in iOS which is available in Android in case of FastLineRenderableSeries.

Thanks

0 votes
152 views

Maybe this isn’t a quirk, but I wanted to point this out. (No pun intended on points.)

So, I was in search of a way to keep a series selected after the user drags a point or double-clicks on a point in that series.

I found a way, but it doesn’t really make sense to me why it works.

Before, I was using the following code and it would keep the series selected, but it would also select another series with the index of hitTestPoint.DataSeriesIndex. (Which makes sense.) But I wasn’t sure why the series with the point was staying selected too.

    private void _sciChart_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
    {
        if (SelectedSeries == null) { return; }

        HitTestInfo hitTestPoint = SelectedSeries.HitTest(rawPoint: MousePosition, hitTestRadius: 10);

        if (hitTestPoint.IsHit)
        {
            RenderableSeries[hitTestPoint.DataSeriesIndex].IsSelected = true;
        }
    }

However, by adding the IsSelected = false part right after setting it to true works like a charm. And I get why the series with the same index as DataSeriesIndex becomes selected/unselected, but I don’t get why the series with the point also stays selected.

Here’s my “hack” to make it work as I want:

    private void _sciChart_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
    {
        if (SelectedSeries == null) { return; }

        HitTestInfo hitTestPoint = SelectedSeries.HitTest(rawPoint: MousePosition, hitTestRadius: 10);

        if (hitTestPoint.IsHit)
        {
            RenderableSeries[hitTestPoint.DataSeriesIndex].IsSelected = true;
            RenderableSeries[hitTestPoint.DataSeriesIndex].IsSelected = false;
        }
    }

Anyway, it works so that’s great. But I just wanted to let you know about this and maybe give me some insight into why this works or if there’s a “cleaner” way.

Thanks!

  • Greg Knox asked 1 month ago
  • last active 3 weeks ago
0 votes
158 views

Hallo,

I updated to version 4.2.0.9.172 Runtime 4.0.30319. From that point on I receive this error coming from my VerticalLineAnnotationStyle:
System.InvalidOperationException: ‘Unable to Apply the Control Template. PART_LabelsPanel is missing or of the wrong type’

So I added this to the template in my style:

And now I get this error: System.ArgumentOutOfRangeException: ‘Specified argument was out of the range of valid values.’

What should the Template of VerticalLineAnnotation be?

My current syle:

        <Style x:Key="CommentAnnotationStyle" TargetType="pp:CustomCommentAnnotation">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="StrokeThickness" Value="1.0" />
        <Setter Property="LabelTextFormatting" Value="{Binding DefaultTextFormatting, Mode=OneWay, RelativeSource={RelativeSource Self}}" />
        <Setter Property="IsHitTestVisible" Value="True"/>
        <Setter Property="Stroke" Value="Blue"/>
        <Setter Property="StrokeDashArray" Value="1 0 0 1"/>
        <!---->
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="s:VerticalLineAnnotation">
                    <Grid x:Name="PART_LineAnnotationRoot" ShowGridLines="False">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>

                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>

                        <Line x:Name="PART_GhostLine"
                              MouseDown="PART_GhostLine_MouseDown"
                              Grid.Row="1"
                              Grid.Column="1"
                              HorizontalAlignment="Center"
                              Stretch="Fill"
                              Stroke="Transparent"
                              StrokeThickness="8"
                              IsHitTestVisible="True"
                              Cursor="Hand"
                              ToolTip="{Binding Comment, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type pp:CustomCommentAnnotation}}}"
                              X1="0"
                              X2="0"
                              Y1="0"
                              Y2="1" /><!-- after Transparent StrokeThickness="{z:Static Member=visuals:ManipulationMargins.AnnotationLineWidth}"-->

        <Line x:Name="PART_Line"
                              MouseDown="PART_GhostLine_MouseDown"
                              Grid.Row="1"
                              Grid.Column="1"
                              HorizontalAlignment="Center"
                              Stretch="Fill"
                              Stroke="{TemplateBinding Stroke}"
                              StrokeDashArray="{TemplateBinding StrokeDashArray}"
                              StrokeEndLineCap="Square"
                              StrokeStartLineCap="Square"
                              StrokeThickness="{TemplateBinding StrokeThickness}"
                              IsHitTestVisible="True" 
                              Visibility="{Binding LineVisible, Converter={StaticResource BoolToVis},
                                        RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type my:STMainWindow}}}"
                              Cursor="Hand"
                              X1="0"
                              X2="0"
                              Y1="0"
                              Y2="1" />

        <Grid x:Name="PART_LabelsPanel"/>
        <Label></Label>
        </Grid>
        </ControlTemplate>
        </Setter.Value>
        </Setter>
    </Style>

Regards,
Jason

  • bochelie asked 1 month ago
  • last active 1 week ago
0 votes
155 views

Am encountering the following runtime error despite explicitly adding a numeric y-axis with Id “DefaultAxisId” to the AxisCollection in my view model that is bound to YAxes:

Exception thrown: ‘System.InvalidOperationException’ in SciChart.Charting.dll
SciChartSurface didn’t render, because an exception was thrown:
Message: AxisCollection.GetAxisById(‘DefaultAxisId’) returned no axis with ID=DefaultAxisId. Please check you have added an axis with this Id to the AxisCollection

Stack Trace: at SciChart.Charting.Model.AxisCollection.GetAxisById(String axisId, Boolean assertAxisExists)
at A.IJ.M(ISciChartSurface D, RenderPassInfo I, IRenderContext2D J)
at A.IJ.RenderLoop(IRenderContext2D renderContext)
at SciChart.Charting.Visuals.SciChartSurface.DoDrawingLoop()

To test, I added the following Y-Axis within my view model constructor:

YAxes.Add(new NumericAxis()
        {
            Id = "DefaultAxisId",
            Visibility = Visibility.Hidden
        });

Why is this error still thrown?

  • bbmat asked 1 month ago
  • last active 1 month ago
0 votes
121 views

I have two separate view models each representing a chart pane. I explicitly do not share the MouseEventGroup Id, and expected none of the ChartModifiers to be shared. However, the MouseWheelZoomModifier is shared. When I zoom via mouse wheel on one chart the other chart is zoomed instantaneously as well. Visible Range is shared but what bothers me is that MouseWheelZoomModifier syncs but other modifiers do not. Is that intended? Desired is to not have any modifiers sync unless I share an identical MouseEventGroup Id.

Here is the code that produces this problem:

<s:SciChartSurface
                x:Name ="Surface"
                Padding="5"
                YAxes="{Binding YAxes, Mode=OneWay}"
                RenderableSeries="{s:SeriesBinding ChartSeries}"
                s:SciChartGroup.VerticalChartGroup="{Binding VerticalChartGroupId}"
                s:ThemeManager.Theme = "{Binding ChartTheme}">

        <s:SciChartSurface.Style>
            <Style TargetType="{x:Type s:SciChartSurface}">
                <Style.Triggers>
                    <!-- Enable DirectX only when not in designer -->
                    <Trigger Property="componentModel:DesignerProperties.IsInDesignMode" Value="False">
                        <Setter Property="s3D:DirectXHelper.TryApplyDirectXRenderer" Value="True" />
                        <Setter Property="s3D:DirectXHelper.FallbackType" Value="{x:Type s:HighQualityRenderSurface}" />
                    </Trigger>
                </Style.Triggers>
            </Style>
        </s:SciChartSurface.Style>

        <s:SciChartSurface.XAxis>
            <s:CategoryDateTimeAxis Id="XAxisId" Visibility="Visible" AutoRange="Never" GrowBy="0.01, 0.01" VisibleRange="{Binding XAxisVisibleRange, Mode=TwoWay}" VisibleRangeLimitMode="MinMax" LabelProvider="{Binding LabelProvider}"/>
        </s:SciChartSurface.XAxis>

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

                <!--s:MouseManager.MouseEventGroup="{Binding SharedMouseGroupId}"-->

                <s:CursorModifier ReceiveHandledEvents="True" SourceMode="AllSeries" UseInterpolation="True" ShowAxisLabels="True" ShowTooltip="False"/>
                <s:ZoomPanModifier ReceiveHandledEvents="True" ZoomExtentsY="False" XyDirection="XDirection" ClipModeX ="ClipAtExtents" ExecuteOn ="MouseLeftButton" />
                <s:RubberBandXyZoomModifier ReceiveHandledEvents="True" IsAnimated = "False" IsXAxisOnly = "True" ExecuteOn = "MouseRightButton"/>
                <s:MouseWheelZoomModifier ReceiveHandledEvents="True" XyDirection = "XDirection"/>
                <s:ZoomExtentsModifier ReceiveHandledEvents="True" IsAnimated = "False" ExecuteOn = "MouseDoubleClick"/>
                <s:RolloverModifier ReceiveHandledEvents="True" x:Name="RollOverModifier" DrawVerticalLine="False" ShowTooltipOn="Never" SourceMode="AllSeries"/>

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

    </s:SciChartSurface>

Edit:

In addition, I am having an issue with the following as well: I use an x-Axis Visible Range property in the the view model, that serves as data context to the rendering surface, I noticed the following issue: MouseWheelZoomModifier causes “_xAxisVisibleRange != value” inside the property setter to ALWAYS evaluate false even when zooming in and out with the mouse wheel. All other chart modifiers cause the inequality to evaluate true when the visible range changes due to applying the chart modifiers. A workaround would be to instead test for “_xAxisVisibleRange.Min != value.Min || _xAxisVisibleRange.Max != value.Max” but it is nonetheless an inconsistency.

Please see below code snippet to illustrate the issue:

public IRange XAxisVisibleRange
    {
        get { return _xAxisVisibleRange; }
        set
        {
            //this is only invoked by its own pane view model (never by an outside pane view model)
            if (_xAxisVisibleRange != value)
            {
                _xAxisVisibleRange = value;
                RaisePropertyChanged("XAxisVisibleRange");


            }
        }
    }
  • bbmat asked 1 month ago
  • last active 1 month ago
0 votes
133 views

Is there a way to provide custom text for the labels in a PieChartSegment? I want to format the text, but haven’t been able to find a label formatter for the pie charts.

0 votes
126 views

For my chart, I create a TimeSpanAxisViewModel with a VisibleRangeLimit like this…

VisibleRange = new TimeSpanRange(new TimeSpan(0, 0, 0), new TimeSpan(0, 0, 30))    
VisibleRangeLimit = new TimeSpanRange(new TimeSpan(0, 0, 0), new TimeSpan(0, 0, 30))
AutoRange = AutoRange.Never

Which properly shows the chart as having 30 seconds of time. Data is added to the chart and it displays as expected.

However, once that data reaches the 30-second limit I’m trying to increase the range by 30 more seconds.

I have a timer that evaluates the elapsed time of a Stopwatch and when that Stopwatch is greater than the current limit (30 seconds) I add to the maximum limit.

Kind of like this…

// If the stopwatch is greater than current range
if (MyStopwatch.Elapsed.TotalSeconds > VisibleRangeSeconds) {

    VisibleRangeSeconds += 30;

    TimeSpan minimumTime = new TimeSpan(0);
    TimeSpan maximumTime = new TimeSpan(0, 0, VisibleRangeSeconds);

    XAxes[0].VisibleRange = new TimeSpanRange(min: minimumTime, max: maximumTime);
    XAxes[0].VisibleRangeLimit = new TimeSpanRange(min: minimumTime, max: maximumTime);

    MySciChart.ChartModifier.ParentSurface.InvalidateElement();
}

I also noticed that VisibleRangeLimit was being updated after the Stopwatch became longer but VisibleRange was staying the same. It wasn’t being updated and I’m not sure why.

What could I be missing that would make the chart grow to the new maximum time?

  • Greg Knox asked 1 month ago
  • last active 1 month ago
0 votes
125 views

I want to write the X axis vertically, as shown in the following image.
How should I do it?

0 votes
137 views

How can I hide the default segment value label drawn automatically?
I need the solution for both iOS and Android version.

0 votes
117 views

Is it possible to remove the number on the bottom left of the chart seen in he attachment?

0 votes
0 answers
123 views

I’m rebuilding a program to adhere to MVVM and so I’m trying to figure out little tricks to do things I did previously in the code-behind.

I’d like to be able to right-click on a selected series and add a point at that location. I’m doing this in my previous application but I’m not too sure the best route to take with the MVVM application.

I’m currently selecting a series with the SeriesSelectionModifier, but I’m also not sure if there’s a “SelectedSeries” property I can get from the modifier either.

Maybe a Trigger that detects a right mouse click on a selected series that calls a command to add the point?

Or is there just not a way to do this with the chart and I need to rely on subscribing to events?

Thanks!

Answer:

I created a property named SelectedSeries which looks like this…

    public IRenderableSeries SelectedSeries
    {
        get
        {
            if (SciChart.SelectedRenderableSeries.Count > 0)
            {
                return SciChart.SelectedRenderableSeries[0];
            } else
            {
                return null;
            }
        }
    }

Then, I created a MouseRightButtonUp event to see if I right-clicked on SelectedSeries. If so, it adds a point. If I clicked on an existing point, it deletes that point.

    private void _sciChart_MouseRightButtonUp(object sender, MouseButtonEventArgs e)
    {
        if (SelectedSeries != null)
        {
            HitTestInfo hitTestToDelete = SelectedSeries.HitTest(rawPoint: MouseDownPosition, hitTestRadius: 10);

            if (hitTestToDelete.IsHit == true)
            {
                // Do nothing if the first or last point is hit
                if (hitTestToDelete.DataSeriesIndex == 0 || hitTestToDelete.DataSeriesIndex == SelectedSeries.DataSeries.Count - 1)
                {
                    return;
                }

                // Delete point
                DeletePoint(point: hitTestToDelete);
            } else
            {
                // Add point if hitting series
                HitTestInfo hitTestToAdd = SelectedSeries.HitTest(rawPoint: MouseDownPosition, hitTestRadius: 10, interpolate: true);

                if (hitTestToAdd.IsHit == true)
                {
                    // Add point
                    AddPoint(point: hitTestToAdd);
                }
            }
        }
    }
  • Greg Knox asked 1 month ago
  • last active 1 month ago
0 votes
143 views

Is it possible to get a legend for each z-axis line with a waterfall 3d graph. And show/hide each line via the legends?

1 vote
153 views

Hi,

3d Surface Chart
I have read the announcement for 3d charts on iOS and Android. That’s exactly me requirement.
Is a release date already planned or is a beta version available?
What are the limitations for a 3d chart on Android (number of points, memory consumption, time to create the view).
We need a 3d surface chart with x=400 points and y= ~1000point (400’000 points).

  • Is this possible?
  • Can this chart be rotated fluid?

2d Chart
I have a requirement for a 2d chart on Android.
The user must be able to move some points in a line chart. Like “design” a set curve.

  • Is this possible?
  • Exist’s some codes samples?

Best regards
Urs

  • Urs Geser asked 1 month ago
  • last active 1 month ago
0 votes
140 views

I’ve been using this chart for a few months now and yesterday ran into a problem with the Y-axis. I’m sure this is nothing more than my lack of understanding on multiple axes.

I have a need to add a 2nd Y axis and I’m not doing something right. My application is using MVVM to bind series to my chart. So far I have been adding data to my chart using the methods described here…

https://www.scichart.com/documentation/v5.x/webframe.html#Tutorial%2003b%20-%20Adding%20Series%20to%20a%20Chart%20with%20MVVM.html

I’ve read the documentation for adding data on multiple axes and have run into a wall. I have cases where I will need to have data only on one axis and other times when I will have data on both. For now I’m just setting up my 2 series in the XAML but not adding data to the 2nd Y axis yet. When I do this my series doesn’t show on the chart anymore.

Here is what I had when it worked…

            <s:SciChartSurface.YAxes>

            <!-- Dose Axis -->
            <s:NumericAxis AxisTitle="Dose (%)" AutoRange="{Binding Path=YAutoRange}"
                           AxisAlignment="Left"
                           FontFamily="Arial"
                           GrowBy="0.05, 0.05" 
                           Style="{DynamicResource ResourceKey=DoseAxisStyle}"
                           s:CursorModifier.AxisLabelContainerStyle="{StaticResource CursorModAxisLabelStyle}"
                           s:CursorModifier.AxisLabelTemplate="{StaticResource CursorModAxisLabelTemplate}" />


        </s:SciChartSurface.YAxes>

And here is what I have now…

            <s:SciChartSurface.YAxes>

            <!-- Dose Axis -->
            <s:NumericAxis AxisTitle="Dose (%)" AutoRange="{Binding Path=YAutoRange}"
                           AxisAlignment="Left"
                           FontFamily="Arial"
                           GrowBy="0.05, 0.05" 
                           Style="{DynamicResource ResourceKey=DoseAxisStyle}"
                           s:CursorModifier.AxisLabelContainerStyle="{StaticResource CursorModAxisLabelStyle}"
                           s:CursorModifier.AxisLabelTemplate="{StaticResource CursorModAxisLabelTemplate}" />

            <!-- 2nd Y Axis -->
            <s:NumericAxis AxisTitle="{Binding Path=RightAxisTitle}" 
                           Id="YAxis2"
                           AxisAlignment="Right"
                           Visibility="{Binding Path=RightAxisVisibility}"
                           AutoRange="{Binding Path=YAutoRange}"
                           FontFamily="Arial"
                           GrowBy="0.05, 0.05" 
                           Style="{DynamicResource ResourceKey=DoseAxisStyle}"
                           s:CursorModifier.AxisLabelContainerStyle="{StaticResource CursorModAxisLabelStyle}"
                           s:CursorModifier.AxisLabelTemplate="{StaticResource CursorModAxisLabelTemplate}" />

        </s:SciChartSurface.YAxes>

My model includes code such as…

        // data context for the series(s) on the chart
        public ObservableCollection<IRenderableSeriesViewModel> Measurements
        {
            get { return _measurements; }
            set { SetProperty(ref _measurements, value); }
        }

        private void AddMeasurementSync(MeasurementViewModel measurement, bool clear = false)
        {
        if (clear)
            // clear the profiles, we're only showing one at a time.
            Measurements.Clear();

        // add profile points to the data series
        var xyProfile = new XyDataSeries<double, double>();
        var xyLeft = new XyDataSeries<double, double>();
        var xyRight = new XyDataSeries<double, double>();

        xyProfile.AcceptsUnsortedData = true;
        xyLeft.AcceptsUnsortedData = true;
        xyRight.AcceptsUnsortedData = true;

        // loop the measurement points and fill the series
        foreach (MeasurementPointViewModel point in measurement.Points)
        {
            if (null != point)
                // add the point to the series and add IPointMetaData
                // which says whether or not we are in the penumbra
                xyProfile.Append(
                    point.Distance,
                    point.Dose);
        }

        // create series for profile          
        LineRenderableSeriesViewModel series = new LineRenderableSeriesViewModel()
        {
            StrokeThickness = 2,
            Stroke = measurement.MeasurementColor,
            AntiAliasing = true,
            DataSeries = xyProfile,
        };

        // should be showing points?
        if (ShowPoints)
        {
            series.PointMarker = new EllipsePointMarker()
            {
                Stroke = Colors.Black,
                Fill = Colors.White,
                Width = 6,
                Height = 6,
            };
        }

        // bind to the collection
        Measurements.Add(series);
    }
0 votes
132 views

Hello everybody.
Library is really great, but rarely crashes and stack trace is not telling something useful to me.
May be somebody meet that exception and know the reasons?
Thanks.

03-14 12:29:27.390 15937-15937/com.test.livedataperformance E/InputEventReceiver: Exception dispatching input event.
03-14 12:29:27.390 15937-15937/com.test.livedataperformance D/AndroidRuntime: Shutting down VM
03-14 12:29:27.390 15937-15937/com.test.livedataperformance E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.test.livedataperformance, PID: 15937
java.lang.NullPointerException: Attempt to invoke interface method ‘java.lang.Comparable com.scichart.data.model.IRange.getMin()’ on a null object reference
at com.scichart.data.model.RangeBase.clipTo(SourceFile:235)
at com.scichart.charting.visuals.axes.a.clipRange(SourceFile:96)
at com.scichart.charting.visuals.axes.AxisBase.scroll(SourceFile:1019)
at com.scichart.charting.visuals.axes.AxisBase.scroll(SourceFile:992)
at com.scichart.charting.modifiers.ZoomPanModifier.a(SourceFile:196)
at com.scichart.charting.modifiers.ZoomPanModifier.onScroll(SourceFile:176)
at android.view.GestureDetector.onTouchEvent(GestureDetector.java:607)
at com.scichart.charting.modifiers.GestureModifierBase.onTouch(SourceFile:80)
at com.scichart.charting.modifiers.ModifierGroup.onTouch(SourceFile:189)
at com.scichart.core.utility.touch.MotionEventManager.c(SourceFile:140)
at com.scichart.core.utility.touch.MotionEventManager.a(SourceFile:39)
at com.scichart.core.utility.touch.MotionEventManager$a$1.a(SourceFile:224)
at com.scichart.core.utility.touch.MotionEventManager$a$1.execute(SourceFile:221)
at com.scichart.core.utility.touch.MotionEventManager$a.a(SourceFile:211)
at com.scichart.core.utility.touch.MotionEventManager$a.onTouchEvent(SourceFile:183)
at com.scichart.charting.visuals.SciChartSurface.onTouchEvent(SourceFile:1251)
at android.view.View.dispatchTouchEvent(View.java:9300)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2547)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2240)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2553)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2254)
at com.android.internal.policy.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2403)
at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1737)
at android.app.Activity.dispatchTouchEvent(Activity.java:2812)
at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
at com.android.internal.policy.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2364)
at android.view.View.dispatchPointerEvent(View.java:9520)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4242)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4095)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3641)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3694)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3660)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3786)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3668)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3843)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3641)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3694)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3660)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3668)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3641)
at android.view.ViewRootImpl.deliverInputEvent(ViewRo – ***Here stack trace ends in console, so i can’t find where its called

0 votes
0 answers
129 views

I want to visualize Contour in my application and set the Contour Interval.
But the visualization is not as the expected value.
From your Example application: 3D Charts > Create A Surface Mesh Chart > Surface Mesh 3D With Contours. (Screenshot in attachment)
I have set the Contour Interval property slider to the maximum value (30).
But the result is less than 20, about 10.

How to make the Interval 30, and the visualization is really 30?
Are there any interval scaling property?

0 votes
136 views

I’m trying to create a Modifier for a PieChart Surface. I can not figure out how to get a segment for a point on the screen. With SciChartSurface, you can get the axis, and use its calculator to get a datapoint, or pixel point. Is there something similar in SciPieChartSurface?

0 votes
157 views

Hello. I have a chart with multiple YAxes. One of the YAxis, for example, has an initial range of -10 to 10. I’d like to be able to put my cursor over that axis, scroll the wheel, and have that range increase or decrease depending on which way the user scrolls.

Is there an ability to do that within SciChart’s standard feature, or will something custom need to be written?

  • Greg Knox asked 1 month ago
  • last active 1 month ago
0 votes
204 views

I have created a SciChartSurface with the width of 200 px. I have created a data series with data that corresponds to four vertical lines at 0 %, 25 %, 50 % and 75 % of width. When I set the data series’ width to 115 points all four vertical lines are clearly visible. However when I set the width to 116 points or more, the first line (at x == 0) disappears. Data series is still smaller than the renderable series width in px, so there is no reason for any of the vertical lines to go missing. Is this a bug, or did I configure something wrong?

Here is the xml layout:

<com.scichart.charting.visuals.SciChartSurface
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/chart"
    android:layout_width="200px"
    android:layout_height="match_parent"/>

Here is the code for MainActivity:

import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import com.scichart.charting.model.dataSeries.UniformHeatmapDataSeries
import com.scichart.charting.visuals.SciChartSurface
import com.scichart.charting.visuals.renderableSeries.ColorMap
import com.scichart.drawing.utility.ColorUtil
import com.scichart.extensions.builders.SciChartBuilder
import kotlin.math.roundToInt

const val WIDTH = 116
const val HEIGHT = 50

class MainActivity : AppCompatActivity()
{
    override fun onCreate(savedInstanceState: Bundle?)
    {
        super.onCreate(savedInstanceState)

        SciChartSurface.setRuntimeLicenseKey(getString(R.string.sciChart_license))
        SciChartBuilder.init(this)

        setContentView(R.layout.activity_main)

        val chartSurface = findViewById<SciChartSurface>(R.id.chart)
        val chartBuilder = SciChartBuilder.instance()

        val xAxis = chartBuilder.newNumericAxis().build()
        val yAxis = chartBuilder.newNumericAxis().build()

        val dataSeries = UniformHeatmapDataSeries<Int, Int, Int>(Int::class.javaObjectType, Int::class.javaObjectType, Int::class.javaObjectType, WIDTH, HEIGHT)
        for (x in 0 until WIDTH)
        {
            for (y in 0 until HEIGHT)
            {
                val value = when (x)
                {
                    0,
                    (0.25 * WIDTH).roundToInt(),
                    (0.5 * WIDTH).roundToInt(),
                    (0.75 * WIDTH).roundToInt() -> 50
                    else                        -> 0
                }
                dataSeries.updateZAt(x, y, value)
            }
        }

        val series = chartBuilder.newUniformHeatmap()
            .withColorMap(ColorMap(intArrayOf(ColorUtil.DarkBlue, ColorUtil.CornflowerBlue, ColorUtil.DarkGreen, ColorUtil.Chartreuse, ColorUtil.Yellow, ColorUtil.Red), floatArrayOf(0f, 0.2f, 0.4f, 0.6f, 0.8f, 1f)))
            .withDataSeries(dataSeries)
            .build()

        chartSurface.suspendUpdates().use {
            chartSurface.xAxes.add(xAxis)
            chartSurface.yAxes.add(yAxis)
            chartSurface.renderableSeries.add(series)
        }
    }
}
0 votes
179 views

Hello, for my bottom graph on my screenshot below, is it possible to dynamically change the black background to red? Indeed, when the microphone saturates like on the screenshot below I want to change the black background to red for 2 seconds, so I need to do it programmatically.

https://i.ibb.co/7XCLDwf/sature.png

I init my bottom graph like this :

 @Override
    public void initGraph(Context context) {
        Log.d(TAG, "initGraphs");
        SciChartSurface audioStreamSciChart = new SciChartSurface(context);
        mAudiostream.addView(audioStreamSciChart);
        xAxis = new NumericAxis(context);
        xAxis.setVisibleRange(new DoubleRange(startAudioStreamRange, endAudioStreamRange));
        xAxis.setDrawLabels(false);
        xAxis.setDrawMinorTicks(false);
        xAxis.setDrawMajorBands(false);
        xAxis.setDrawMinorGridLines(false);
        audioStreamSciChart.getXAxes().add(xAxis);

        NumericAxis yAxis = new NumericAxis(context);
        yAxis.setVisibleRange(new DoubleRange(-1.0, 1.0));
        yAxis.setDrawLabels(true);
        yAxis.setDrawMinorTicks(false);
        yAxis.setDrawMajorBands(false);
        yAxis.setDrawMinorGridLines(false);
        yAxis.setAxisAlignment(AxisAlignment.Left);

        audioStreamSciChart.getYAxes().add(yAxis);

        float lineThickness = SciChartExtensionsKt.dip(context, 1.0F);

        FastLineRenderableSeries f = new FastLineRenderableSeries();
        f.setDataSeries(scichartTools.getAudioDS());
        f.setStrokeStyle(new SolidPenStyle(ColorUtil.Grey, true, lineThickness, null));
        audioStreamSciChart.getRenderableSeries().add(f);
        scichartLayout = mAudiostream.getChildAt(0);
    }

I can keep a reference of my FastLineRenderableSeries to do it but i didn’t find any method to change his backgroud color.
Can i ?

Thanks,
Wavely

0 votes
211 views

I have created a heatmap chart with values for the data series with four vertical lines of width 1. When the width of data series is smaller than width of SciChartSurface in pixels the four lines are clearly visible. However when I increase the width of data series to be bigger than the width in pixels, then some lines disappear, even though I’ve set the re-sampling mode to ResamplingMode.Max.

I wasn’t able to attach images to the post (got a Forbidden error), so I’ve uploaded them to Imagur:
Missing Lines
Visible lines

Here is the code from which the screen shots were made:

import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import com.scichart.charting.model.dataSeries.UniformHeatmapDataSeries
import com.scichart.charting.visuals.SciChartSurface
import com.scichart.charting.visuals.renderableSeries.ColorMap
import com.scichart.data.numerics.ResamplingMode
import com.scichart.drawing.utility.ColorUtil
import com.scichart.extensions.builders.SciChartBuilder
import kotlin.math.roundToInt

const val WIDTH = 2000
const val HEIGHT = 50

class MainActivity : AppCompatActivity()
{
    override fun onCreate(savedInstanceState: Bundle?)
    {
        super.onCreate(savedInstanceState)

        SciChartSurface.setRuntimeLicenseKey(getString(R.string.sciChart_license))
        SciChartBuilder.init(this)

        setContentView(R.layout.activity_main)

        val chartSurface = findViewById<SciChartSurface>(R.id.chart)
        val chartBuilder = SciChartBuilder.instance()

        val xAxis = chartBuilder.newNumericAxis().build()
        val yAxis = chartBuilder.newNumericAxis().build()

        val dataSeries = UniformHeatmapDataSeries<Int, Int, Int>(Int::class.javaObjectType, Int::class.javaObjectType, Int::class.javaObjectType, WIDTH, HEIGHT)
        for (x in 0 until WIDTH)
        {
            for (y in 0 until HEIGHT)
            {
                val value = when (x)
                {
                    0,
                    (0.25 * WIDTH).roundToInt(),
                    (0.5 * WIDTH).roundToInt(),
                    (0.75 * WIDTH).roundToInt() -> 50
                    else                        -> 0
                }
                dataSeries.updateZAt(x, y, value)
            }
        }

        val series = chartBuilder.newUniformHeatmap()
            .withDataSeries(dataSeries)
            .withColorMap(ColorMap(intArrayOf(ColorUtil.DarkBlue, ColorUtil.CornflowerBlue, ColorUtil.DarkGreen, ColorUtil.Chartreuse, ColorUtil.Yellow, ColorUtil.Red), floatArrayOf(0f, 0.2f, 0.4f, 0.6f, 0.8f, 1f)))
            .withResamplingMode(ResamplingMode.Max)
            .build()

        chartSurface.suspendUpdates().use {
            chartSurface.xAxes.add(xAxis)
            chartSurface.yAxes.add(yAxis)
            chartSurface.renderableSeries.add(series)
        }
    }
}
1 vote
195 views

I am using a PinchZoomModifier with my chart and I would like to execute some code when the user stops the zooming action (stops touching the screen). Is it possible to do? Are there any listeners I could attach to the PinchZoomModifier? I couldn’t find any in the docs.

1 vote
195 views

Hi all,

Bit of a weird question here again – sorry.

I’m not sure if this is possible, but I’m looking to have an android device take pictures every x minutes, and I’d like to display them in a chart with a shared axis with a few other charts. A user will ideally be able to see each of these snapshots associated with the time that they’re taken, and on press expand them into a carousel view with the selected image as the current.

The on press and carousel bit will be straight android code, but I was wondering about displaying images on charts – is it possible? I poked around a little bit, and for WPF, I saw

https://www.scichart.com/questions/question/rendering-2d-camera-images

I was wondering if the android libraries can do similar, and if so, do you have any examples/code snippets?

The other potential approach I found was using the Sprite point marker API, although I’m not sure the scope of images it can render?

Would either of these approaches be feasible, and do you have any examples/tips? Attached is the current status of my charts, and I’m hoping to put images in the red boxes on the second chart (I just put a column chart as a placeholder there for the moment).

Also, I just wanted to say thanks for all the fantastic support your team has provided.

Thanks,
-Andy

Showing 1 - 50 of 3k results