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

Welcome to the SciChart Community Forums!

Please note, for the month of May we are trialling a switch to Stackoverflow.com for ad-hoc support of our chart controls. Please create an account and ask questions with the Tag=SciChart on Stackoverflow.

We welcome your feedback on this move as well, contact us to voice your opinion!

0 votes
122 views

our app is about Futures. we will buy license for IOS and Android.

we found some question.

so we need show very small values, like Euro exchange’s values will be from 1.1981 to 1.2008.
its Tick Size is 0.0001 .

but we use LogarithmicNumericAxis with OhlcDataSeries<Date, Double> , surface still linear scale.

other question.
how to custom LogarithmicNumericAxis’s “TextFormatting” like “$0.0000”

  • Rey Liang asked 3 weeks ago
  • last active 3 weeks ago
0 votes
102 views

In Xamarin.IOS when you set the legend to Horizontal and Top it will create a legend at the top then allow you to scroll horizontally to see all your LineSeries. In Xamarin.Android when you have more Series than can originally fit on the screen, the legend malfunctions and takes up the entire screen. Picture will be attached.

0 votes
0 answers
86 views

Hi All,

I’ve been trying to get SciCharts and the IOS UIScrollview to work together and have been running into a couple of issues.

The main storyboard has 7 SciChart surfaces plotting realtime data embedded inside a single UI scrollview controller.

1) Charts don’t render when scrollview is actively scrolling

Everything works fine during normal operation and we don’t try to scroll.

Once a finger is placed on the screen, the SciCharts surface stops redrawing. This could be due to the fact that the ‘Scroll’ thread is handled in the UITouch thread and perhaps has higher priority. I don’t know if there is anyway to change the priority of the render routine. I can confirm that everything until ‘Update Data’ and Chart.InvalidateElement() is being called during a scroll action.

2) Scrolling is disallowed when Chart surface is as large as scrollview

This may not be exactly due to scichart but if anyone faced this problem before it would help. If you attempt to scroll when the SciChartSurface is as large as the parent UIScrollView, it doesn’t scroll. Almost like the SciChart surface has the priority of touch and doesn’t let the scroll view see the scroll.

I would greatly appreciate if anyone successfully got UIScrollview and Scicharts working well together. I might be doing a bunch of rookie mistakes.

Cheers,
Mithrandir

Adding a quick update,

I could fix (2) by disable User Interactions of the Chart.

Note that you can’t simply disable this in the Main Storyboard, this has to be done programmatically by calling

ChartName.isUserInteractionEnabled = false

So the only real issue is (1), getting the chart to render while scrollview is active.

0 votes
105 views

I have just learned how to use sci-chart framework with tutorials.
And I tried to add values from bluetooth as realtime chart as shown in tutorials.
I have finished receiving data from a Bluetooth connection.
However, using scichart to represent this data in real time is hard to solve by looking at the tutorial alone.
Does anyone have any idea how to use real-time tutorials to teach you how to represent your own data, not the example sine graph?

The code below is what I tried and is wrong.

import UIKit
import CoreBluetooth
import SciChart

let maestroServiceCBUUID = CBUUID(string:”495sdfd3-FE7D-4AE5-8FA9-9FAFD205E455″)
let maestroBrainDataCBUUID = CBUUID(string: “4953sdf3-1E4D-4BD9-BA61-23C647249616”)
class HRMViewController: UIViewController {
var sciChartSurface: SCIChartSurface?

var lineDataSeries: SCIXyDataSeries!
var scatterDataSeries: SCIXyDataSeries!

var lineRenderableSeries: SCIFastLineRenderableSeries!
var scatterRenderableSeries: SCIXyScatterRenderableSeries!

var timer: Timer?
var phase = 0.0
var i = 0

@IBOutlet weak var brainRateLabel: UILabel!

var centralManager: CBCentralManager!
var maestroPeripheral:CBPeripheral!
override func viewDidLoad() {
super.viewDidLoad()

sciChartSurface = SCIChartSurface(frame: self.view.bounds)
sciChartSurface?.autoresizingMask = [.flexibleHeight, .flexibleWidth]
sciChartSurface?.translatesAutoresizingMaskIntoConstraints = true

self.view.addSubview(sciChartSurface!)


let xAxis = SCINumericAxis()
xAxis.growBy = SCIDoubleRange(min: SCIGeneric(0.1), max: SCIGeneric(0.1))
sciChartSurface?.xAxes.add(xAxis)

let yAxis = SCINumericAxis()
yAxis.growBy = SCIDoubleRange(min: SCIGeneric(0.1), max: SCIGeneric(0.1))
sciChartSurface?.yAxes.add(yAxis)

createRenderableSeries()
addModifiers()


centralManager = CBCentralManager(delegate: self , queue: nil)

// Make the digits monospaces to avoid shifting when the numbers change

}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)

if nil == timer{
  timer = Timer.scheduledTimer(withTimeInterval: 0.01, repeats: true, block: updatingDataPoints)
}

}

override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)

if nil != timer{
  timer?.invalidate()
  timer = nil
}

}

func updatingDataPoints(timer:Timer){

i += 1

lineDataSeries.appendX(SCIGeneric(i), y: SCIGeneric(cos(Double(i)*0.1 + phase)))
scatterDataSeries.appendX(SCIGeneric(i), y: SCIGeneric(cos(Double(i)*0.1 + phase)))

phase += 0.01

sciChartSurface?.zoomExtents()
sciChartSurface?.invalidateElement()

}

func createDataSeries(_brainwave2:Double){
// Init line data series
lineDataSeries = SCIXyDataSeries(xType: .double, yType: .double)
lineDataSeries.fifoCapacity = 500
lineDataSeries.seriesName = “line series”

// Init scatter data series

// scatterDataSeries = SCIXyDataSeries(xType: .double, yType: .double)
// scatterDataSeries.fifoCapacity = 500
// scatterDataSeries.seriesName = “scatter series”

for i in 0...500{
  lineDataSeries.appendX(SCIGeneric(i), y: SCIGeneric(_brainwave2))

// scatterDataSeries.appendX(SCIGeneric(i), y: SCIGeneric(cos(Double(i)*0.1)))
}

i = Int(lineDataSeries.count())

}

func createRenderableSeries(){
lineRenderableSeries = SCIFastLineRenderableSeries()
lineRenderableSeries.dataSeries = lineDataSeries

scatterRenderableSeries = SCIXyScatterRenderableSeries()
scatterRenderableSeries.dataSeries = scatterDataSeries

sciChartSurface?.renderableSeries.add(lineRenderableSeries)
sciChartSurface?.renderableSeries.add(scatterRenderableSeries)

}

func addModifiers(){
let xAxisDragmodifier = SCIXAxisDragModifier()
xAxisDragmodifier.dragMode = .pan
xAxisDragmodifier.clipModeX = .none

let yAxisDragmodifier = SCIYAxisDragModifier()
yAxisDragmodifier.dragMode = .pan

let extendZoomModifier = SCIZoomExtentsModifier()
let pinchZoomModifier = SCIPinchZoomModifier()

let rolloverModifier = SCIRolloverModifier()
let legend = SCILegendModifier()

let groupModifier = SCIChartModifierCollection(childModifiers: [xAxisDragmodifier, yAxisDragmodifier, pinchZoomModifier, extendZoomModifier, legend, rolloverModifier])

sciChartSurface?.chartModifiers = groupModifier

}

func brainwaveReceived(_ brainWave:Double){
let brainWave = brainWave * 3.3 / 65536
brainRateLabel.text = String(brainWave)
print(“brainwave: (brainWave)”)
}

}

extension HRMViewController: CBCentralManagerDelegate {
func centralManagerDidUpdateState(_ central: CBCentralManager) {
switch central.state {

case .unknown:
  print("central.state is . unknown")
case .resetting:
  print("central.state is . resetting")
case .unsupported:
  print("central.state is . unsupported")
case .unauthorized:
  print("central.state is . unauthorized")
case .poweredOff:
  print("central.state is . poweredOff")
case .poweredOn:
  print("central.state is . poweredOn")
  centralManager.scanForPeripherals(withServices:nil)
}

}

func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) {
print(peripheral)
if peripheral.name == “MAESTRO1” {
// maestroPeripheral = peripheral
centralManager.stopScan()
maestroPeripheral = peripheral
maestroPeripheral.delegate = self
central.connect(maestroPeripheral)
}

}
func centralManager(_ central: CBCentralManager, didConnect peripheral: CBPeripheral) {
print(“Connected!”)
maestroPeripheral.discoverServices([maestroServiceCBUUID])
}
}

extension HRMViewController:CBPeripheralDelegate{
func peripheral(_ peripheral: CBPeripheral, didDiscoverServices error: Error?) {
guard let services = peripheral.services else {return}
for service in services {
print(service)
peripheral.discoverCharacteristics(nil, for: service)
}
}
func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsFor service: CBService, error: Error?) {
guard let characteristics = service.characteristics else {return}

for characteristic in characteristics {
  print(characteristic)
  if characteristic.properties.contains(.read){
    print("\(characteristic.uuid): properties contain .read")
  }
  if characteristic.properties.contains(.notify){
    print("\(characteristic.uuid): properties contain .notify")
    peripheral.setNotifyValue(true , for: characteristic)
  }
}

}

func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic,
error: Error?) {
switch characteristic.uuid {
case maestroBrainDataCBUUID:
let wave = Double(brainData(from: characteristic))*3.3/65536
createDataSeries(_brainwave2:wave)

  default:
  print("Unhandled Characteristic UUID: \(characteristic.uuid)")
}

}
private func brainData(from characteristic: CBCharacteristic) -> Int {
guard let characteristicData = characteristic.value else { return -1 }
let byteArray = UInt8

let firstBitValue = byteArray[0] & 0x01
if firstBitValue == 0 {
  // Heart Rate Value Format is in the 2nd byte
  return Int(byteArray[1])
} else {
  // Heart Rate Value Format is in the 2nd and 3rd bytes
  return (Int(byteArray[1]) << 8) + Int(byteArray[2])
}

}

}

0 votes
0 answers
89 views

When i go to zoom on my YAxis while a YAxis VisibleRangeLimit is baing set, the zoom does not work correctly. Once the zooming is finished it will reset back to the range limit. If i remove the range limit, the zooming then works as expected.

0 votes
0 answers
104 views

I’m using the YAxes property of the chart to data bind to a collection of NumericAxisViewModels. Is there a way to rotate the tick labels in this scenario. I can’t define a style in XAML and then assign it to the Axis because the axis is created in scichart somewhere. All I have is the axis view model. I have a LabelProvider but it doesn’t seem to support rotation unless I access the ParentAxis. Ultimately I would like to rotate some vertical axis and not other but I might be able to live with rotating all of them.

I have tried defining a style in xaml that applies to all numeric axis but it didn’t work:

<Style TargetType="{x:Type s:DefaultTickLabel}">
        <Setter Property="LayoutTransform">
            <Setter.Value>
                <RotateTransform Angle="-90"/>
            </Setter.Value>
        </Setter>
    </Style>

Adding a LabelProvider sort of works but seems a little hacky and doesn’t set the scale appropriately ( I have to zoom to extends to see the labels). Is this the way I am supposed to do it?

public override string FormatLabel(IComparable dataValue) {
        var style = new Style(typeof(DefaultTickLabel));
        style.Setters.Add(new Setter(DefaultTickLabel.LayoutTransformProperty, new  RotateTransform(-90.0)));
        ParentAxis.TickLabelStyle = style;
0 votes
134 views

Hi,

I’m working on the iOS and android version. I’m trying to implemented an animated visible range change on Y axis when zooming/panning X axis.

On iOS, I just have to do:
yAxis.autoRange = .always
yAxis.animateVisibleRangeChanges = true
yAxis.animatedChangeDuration = 0.5

But I can’t find a way to do that on Android, is it hidden somewhere else?

Kind Regards,
Alexis

0 votes
116 views

Hi

I’m trying to use SciChart in my Xamarin Visual Studio Cross platform application. After installing the SciChart package in the Package Manager console I got the dependency reference error:

Package SciChart 5.1.0.11405 was restored using '.NETFramework, Version=v4.6.1' instead of the project target framework 'NETStandard,Version=v2.0'. This papckage may not be fully compatible with your project .

I know that .NET framework 4.6.1 is different from .NETStandard2.0.

I’ve read some articles about how to target multiple .NET versions in the same application by modifying the .csproj file, but I can’t get it work anyway.
https://medium.com/@SicknoteSteve/nuget-targeting-both-net-standard-and-the-net-framework-326a16266ca4
I’ve modified the csproj file like this

<PropertyGroup>
  <TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)'=='netstandard2.0'">
  <PackageReference Include="Xamarin.Forms" Version="2.5.0.280555" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
  <PackageReference Include="SciChart" Version="5.1.0.11405" />
  <PackageReference Include="Xamarin.Forms" Version="2.5.0.280555" />
</ItemGroup>

This action removes all dependency errors, but I still can’t use the libraries.

Does anyone know how to solve this issue?

Thanks in advance!

0 votes
0 answers
116 views

Hi!

My goal is to allow the user to mark an x-axis range in the chart. For this, I use BoxAnnotation. The boxes cover the whole chart height and can only be moved/resized in horizontal direction.
The annotation is created via AnnotationCreationModifier.

The problem is that the user cannot select this range everywhere, but only within a certain interval of the x-axis. So it would be necessary to limit the drag range for the AnnotationCreationModifier and for the Annotation resize/move action. With other words, the drawn rectangles should stop following the mouse when the mouse if moved out of the allowed x-axis range.
Is this possible?

Best regards,
ChartIt

0 votes
128 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
104 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
101 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
94 views

Hi

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

/Flemming

0 votes
114 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
108 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
114 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
115 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 1 month ago
  • last active 3 weeks ago
0 votes
118 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
92 views

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

/Flemming

0 votes
120 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
125 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
111 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
121 views

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

0 votes
126 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
115 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
101 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
96 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
124 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
139 views

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

0 votes
138 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
112 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
128 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 months ago
  • last active 1 month ago
0 votes
0 answers
131 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
123 views

How performance can be improved?

0 votes
0 answers
135 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
151 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
102 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
128 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
146 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 2 months ago
  • last active 1 month ago
0 votes
241 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
134 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
138 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
164 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
175 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
132 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
121 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
131 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
174 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 2 months ago
  • last active 2 months ago
0 votes
150 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 2 months ago
  • last active 2 months ago
Showing 1 - 50 of 2k results