Pre loader

Category: iOS

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

1 vote
5k 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?

1 vote
10k views

Stacked Bar chat: If we give 0 values, there are Black lines showing at middle of screen. please see attached screen.

1 vote
4k views

SciChart 3.1.0.5175 running on iOS 13.6

Please see this short video which demonstrates the issue: https://youtu.be/HjtWZDZeyXM

I have a chart showing a single Spline data series. The data series never drops below zero, yet the chart shows multiple points where the line drops below zero as you zoom in and out. This behavior changes as the zoom level changes.

Is this expected behavior for the spline chart? Is there a way to change the behavior so the chart does not show these sub-zero points?

private func drawChart()
{
    createChartSurface()

    let series = self.getPositionSeries( name: name, color: color, results: resultsSession.rearResults )
    self.sciChartSurface?.renderableSeries.add(series)


}


private func createChartSurface()
{
    // If we created a chart surface previously then we need to remove it from the superview
    sciChartSurface?.removeFromSuperview()

    // Create a SCIChartSurface. This is a UIView so can be added directly to the UI
    sciChartSurface = SCIChartSurface()
    sciChartSurface?.translatesAutoresizingMaskIntoConstraints = false
    self.view.addSubview(sciChartSurface!)

    //sciChartSurface?.autoresizingMask = [.flexibleHeight, .flexibleWidth] // chart bottom falls off the view without this
    sciChartSurface?.topAnchor.constraint(equalTo: self.view.safeAreaLayoutGuide.topAnchor).isActive = true
    sciChartSurface?.bottomAnchor.constraint(equalTo: self.view.safeAreaLayoutGuide.bottomAnchor).isActive = true
    sciChartSurface?.leftAnchor.constraint(equalTo: self.view.leftAnchor).isActive = true
    sciChartSurface?.rightAnchor.constraint(equalTo: self.view.rightAnchor).isActive = true

    // Create an XAxis and YAxis. This step is mandatory before creating series
    let xaxis = SCINumericAxis()
    xaxis.axisTitle = "Seconds"
    sciChartSurface?.xAxes.add(xaxis)

    let yaxis = SCINumericAxis()
    yaxis.axisTitle = "Position (mm)"
    yaxis.axisId = "p" // position
    yaxis.axisAlignment = .right
    sciChartSurface?.yAxes.add(yaxis)

    let yaxis = SCINumericAxis()
    yaxis.axisTitle = "Speed mm/s"
    yaxis.axisId = "s" // speed
    yaxis.axisAlignment = .left
    sciChartSurface?.yAxes.add(yaxis)


    addModifiers()
}


private func getPositionSeries( name: String, color: UIColor, results: ResultData ) -> SCISplineLineRenderableSeries
{
    let positionData = SCIXyDataSeries(xType: .double, yType: .double)
    positionData.seriesName = name
    let start = resultsSession.indexStart + 1
    let last = resultsSession.indexEnd

    for index in start ... last {
        let t1 = resultsSession.sensorData[index-1].time
        let t2 = resultsSession.sensorData[index].time
        if ((t2-t1) == 1) {
            let x = Double(t2) / resultsSession.sampleRate
            let y = results.axleData[index].position
            positionData.append(x: x, y: y)
        } else {
            // There was a gap in the data.  Fill in the gap with a horizontal line.
            let y = results.axleData[index-1].position
            for tx in (t1 + 1) ... t2 {
                let x = Double(tx) / resultsSession.sampleRate
                positionData.append(x:x, y:y)
            }
        }
    }

    let positionSeries = SCISplineLineRenderableSeries()  // SCIFastLineRenderableSeries()
    positionSeries.dataSeries = positionData
    positionSeries.yAxisId = "p"
    positionSeries.strokeStyle = SCISolidPenStyle(color: color, thickness: 1.0)
    return positionSeries
}
1 vote
0 answers
3k views

Hello, I tried to copy an example to run in Xcode, when I changed it to SCIChartSurface3D, it show that “Type ‘SurfaceView’ does not conform to protocol ‘UIViewRepresentable'”, it is even I want to make a 3D chart I don’t need to change the ‘SCIChartSurface’ to ‘SCIChartSurface3D’ ?

and in the SCIUpdateSuspender.usingWith(self.surface), it said ‘Value of type ‘SurfaceView’ has no member ‘surface” ? did I do anything wrong ?

Thank you

1 vote
7k views

Hi,

I’m attempting to plot on a mountain graph with a DateTimeAxis for the x-axis and I noticed that the plotted time is inaccurate.

The data that am attempting to put in has the following NSDate value: 2017-01-06T10:09:25+0000
Correct me if am wrong, but I believe the time on the axis that ought to be displayed should follow the device’s system timezone? In my case, it is +0800, setting the time to be about 6:09:25 pm

However, the plotted time ends up showing the point to be plotted at 2:09:25 instead.

I’ve tested with a date formatter and it displays the time as it should (6:09:25 pm).
I don’t think I configured anything regarding the axis’s time format, and the insertion of data was done as below:

[self.mountainSeries appendX:SCIGeneric(m.timestamp) Y:SCIGeneric(m.mid)];
[self.chartSurface invalidateElement];

Also, to add on, if I were to extract the XMax value from the axis (in this case, is the timestamp as above), it returns me as such: 2017-01-06 18:09:25 +0000

Thank you.

1 vote
10k views

Hi everyone,

What would be the easiest way of shading all vertical bands for weekend days? I’ve got two ideas:

  1. Setting major band brush won’t work because there’s no way of setting only weekend bands to be major bands (as far as I know).
  2. Using box annotations.

Problem with 2nd option is that annotations are rendered over the chart (screenshot attached). Is there a way of sending them behind columns?

Thanks,
Igor

  • Igor Peric asked 7 years ago
  • last active 7 years ago
1 vote
6k views

We have created graph for x axis string and y axis double. we have create object like this XyDataSeries<string,double> if run app getting exception error .

How to declare and how to use it .

1 vote
10k views

Hi!

I have 2 solutions of xamarin forms using scichart: one of them is the demo from github repo of scichart (2.2.1.839), and the other is my own solution using scichart 2.5.0.946.

The problem is when I attach a labelprovider (the same as the github example) to one of my numerical axes, the app automatically closes on the device (both), neither of the two solutions shows an error or exception.

1 vote
3k views

Hi, I’m looking for a way to programmatically dismiss a RolloverModifier from a chart. I’ve been tasked with creating a user experience that does two things: 1. when a user stops scrubbing on the chart, the rollover modifier should persist, and 2. when the user taps outside of the chart the rollover modifier should disappear.

I’ve accomplished the first part of the problem by implementing a subclass of SCIRolloverModifier and overriding the onEvent(args:) function, but I cannot figure out how to dismiss the rollover modifier when the user taps outside the chart surface.

Is there a way to accomplish this?

1 vote
0 answers
6k views

I am following the MultiPaneStockChart example. I want to sync multiple chart and I want to sync it on x axis. but it’s not happening although zoom and pinch is working.
Can anyone point me what am I missing?

1 vote
4k views

SciChart 3.1.0.5175
iOS 13.5
Xcode 10.15.5

If I am using the API incorrectly please let me know. I am not aware of any requirement to wait after using the SciChart API.

It appears the SCILegendModifier has some kind of timing bug. If you draw a chart on a surface with a legend, then clear the chart, then add another plot to the same surface you will notice the legend has stale data. However, if you clear the surface and wait a second before you add the new plot it will work as expected.

I created a sample Xcode project to demonstrate the issue. See the attachment chart.zip

I also created a video to demonstrate the issue: https://youtu.be/1JBTd1sfVgI

I have a workaround so this is not urgent, but I would like to remove the delay for my production release.

1 vote
6k views

I want to modify the tooltip for data points. For example, I’d like to not show the line that goes down to the X Axis, and the associated tooltip that shows the X cursor location in the X axis area.

Is there a way to do this?

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

iPhone 6, OS 12.4.3., X-axis, Y-axis texts are shown in inverted text. We can see this issue if we download the AppStore version of SciChart app

1 vote
4k views

Hi,

I’m trying to convert Java code to swift and I need the RolloverModifier class’s updateCurrentPoint method. I create CustomRolloverModifier class inherits from SCIRolloverModifier class and import SciChart.Protected.SCIRolloverModifier extension too. But i can’t find updateCurrentPoint method. What is the updateCurrentPoint equivalent method on swift?

Thanks.

1 vote
4k views

I am trying to listen changes in pie chart segment selections. I am adding the listener like so:

piesegment.addChangeListener { changedSegment in
    print("changed selection \(changedSegment.isSelected)")
 } 

The closure is never called however. My first question is: Is this the right way of doing this? In Android I implement the PieSegmentChangeListener interface and do an addIsSelectedChangeListener on the segment. In ios the SCIPieSegmentChangeListener is not a protocol. My second question is: How can I create a my own listener like in android and add it to the segment?

By the way support should not be exired!!!!

1 vote
9k views

I want a transparent background of SCI Chart so that view below the chart are visible. I have tried various solutions but it is still turning out to be black. Below is my code for the same. Can anyone please help me out ? I am setting SCIChartSurface backgroundColor property to achieve it but it doesnt seem to work.

func initColumnChart() {

    let xAxis = SCINumericAxis()
    let yAxis = SCINumericAxis()
    //self.surface.xAxes.add(xAxis)
    //self.surface.yAxes.add(yAxis)
    self.surface.backgroundColor = UIColor.clear
    self.surface.isOpaque = false
    self.surface.renderableSeriesAreaFill = SCISolidBrushStyle(color: UIColor.clear)
    self.surface.renderableSeriesAreaBorder = SCISolidPenStyle(color: UIColor.clear, withThickness: 0)


    let xAxisGridBandBrush = SCISolidBrushStyle(color: UIColor.clear)
    xAxis.style.gridBandBrush = xAxisGridBandBrush

    xAxis.visibleRange = SCIDoubleRange(min: SCIGeneric(-0.6), max: SCIGeneric(8.0))
    xAxis.style.majorTickBrush = SCISolidPenStyle(color: UIColor.white, withThickness: 1)
    xAxis.style.majorTickSize = 5
    xAxis.autoTicks = false
    xAxis.majorDelta = SCIGeneric(1.0)
    xAxis.minorDelta = SCIGeneric(1.0)
    xAxis.labelProvider = UsageXLabelProvider()
    xAxis.style.labelStyle.color = UIColor.white
    xAxis.style.labelStyle.fontName = "Helvetica"
    xAxis.style.labelStyle.fontSize = 14
    xAxis.style.drawLabels = true
    xAxis.style.drawMajorGridLines = false
    xAxis.style.drawMinorGridLines = false
    xAxis.style.drawMajorTicks = true
    xAxis.style.drawMinorTicks = false
    xAxis.tickProvider = YAxisTickProvider(minorTicks: [], majorTicks: [0,1,2,3,4,5,6])



    let yAxisGridBandBrush = SCISolidBrushStyle(color: UIColor.clear)
    yAxis.style.gridBandBrush = yAxisGridBandBrush

    yAxis.style.labelStyle.color = UIColor.white
    yAxis.style.labelStyle.fontName = "Helvetica"
    yAxis.style.labelStyle.fontSize = 14
    yAxis.style.drawLabels = true
    yAxis.visibleRange = SCIDoubleRange(min: SCIGeneric(-1.0), max: SCIGeneric(65))
    yAxis.autoTicks = false
    yAxis.majorDelta = SCIGeneric(1.0)
    yAxis.minorDelta = SCIGeneric(0.2)
    yAxis.style.majorGridLineBrush = SCISolidPenStyle(color: UIColor.white, withThickness: 0.5, andStrokeDash: [5.0,6.0])
    // Style the Minor Gridlines on the YAxis (vertical lines)
    yAxis.style.minorGridLineBrush = SCISolidPenStyle(color: UIColor.white, withThickness: 0.5, andStrokeDash: [5.0, 6.0])
    yAxis.style.drawMajorGridLines = true
    yAxis.style.drawMinorGridLines = true
    yAxis.style.drawMajorTicks = false
    yAxis.style.drawMinorTicks = false
    yAxis.axisAlignment = .left
    //yAxis.labelProvider = DailyFlowrateLabelProvider()
    yAxis.tickProvider = YAxisTickProvider(minorTicks: [0,8,16,24,31,40,48,56], majorTicks: [0,31,62])

    let dataSeries = SCIXyDataSeries(xType: .float, yType: .float)
    dataSeries.appendRangeX([0,1,2,3,4,5,6], y: [52,40,15,48,25,36,20])

    let rSeries = SCIFastColumnRenderableSeries()
    rSeries.dataSeries = dataSeries
    rSeries.paletteProvider = BarsColorPalette()

    SCIUpdateSuspender.usingWithSuspendable(surface) {
        self.surface.xAxes.add(xAxis)
        self.surface.yAxes.add(yAxis)
        self.surface.renderableSeries.add(rSeries)
        //self.surface.chartModifiers = SCIChartModifierCollection(childModifiers: [SCIPinchZoomModifier(), SCIZoomExtentsModifier(), SCIRolloverModifier()])

        //rSeries.addAnimation(SCIWaveRenderableSeriesAnimation(duration: 3, curveAnimation: .easeOut))
    }
}
  • Ayush Jain asked 5 years ago
  • last active 5 years ago
1 vote
0 answers
4k views

I was not able to find any sample code for macOS swift on gitHub to I tried to convert the iOS one for Mac and I grabbed the key from Scichart Licensing Wizard then initialised it in app delegates didFinishLaunchingWithOptions but I am facing this issue of invalid License token.

grab the code from here:

https://drive.google.com/file/d/1POIiKuEXaa7zNlbdcwruzIEyuN5QjkMq/view?usp=sharing

1 vote
9k views

Hello,
I’ve been looking for the documentation of how to customize the look of the chart. I have a black/dark gray checker pattern that seems to be the default. I would like to:
1. Change the background to white, no checkerboard pattern
here is the documentation for chart background but it does not show me how to change it to white. https://www.scichart.com/documentation/ios/v2.x/webframe.html#The%20SciChartSurface%20Type.html
I have found through experimentation the I can call

surface.backgroundColor

But that just changes the axis background color

2. Make the text larger on the axis.
here is the documentation for the axis https://www.scichart.com/documentation/ios/v2.x/webframe.html#Adding%20an%20Axis%20to%20a%20SciChartSurface.html
I see these lines that were provided but they won’t compile because Xcode doesn’t know what defaultFontSize is and there are no other references to it and I still don’t see a way to set the size.

textFormat.fontName = SCSFontsName.defaultFontName
textFormat.fontSize = SCSFontSizes.defaultFontSize

I think it would be helpful to create a walkthrough for iOS that shows how to customize the background and axis. I’ve looked through the samples provided but the files are huge and I get lost trying to figure it out.
Thanks,
Warren

1 vote
4k views

See the screen shot (attached)

To dupe this start on the SciChart home page, select documentation, select iOS, then enter anything into the search box.

I get the same results with Chrome and Safari.

1 vote
4k views

After seeing some strange behavior in my application, I have a simple repro case where hiding a renderable series that’s in a vertically stacked columns collection causes the entire screen to go black. I’ll attach a full viewDidLoad() below, but here’s the basic setup:

    let rsLeftSingle = SCIStackedColumnRenderableSeries()
    rsLeftSingle.dataSeries = dataSeriesLeftSingle
    rsLeftSingle.yAxisId = yAxisLeft.axisId
    rsLeftSingle.fillBrushStyle = SCISolidBrushStyle(color: UIColor.yellow)
    rsLeftSingle.strokeStyle = SCISolidPenStyle(color: UIColor.yellow, thickness: 2.0)

    let rsLeftDouble = SCIStackedColumnRenderableSeries()
    rsLeftDouble.dataSeries = dataSeriesLeftDouble
    rsLeftDouble.yAxisId = yAxisLeft.axisId
    rsLeftDouble.fillBrushStyle = SCISolidBrushStyle(color: UIColor.blue)
    rsLeftDouble.strokeStyle = SCISolidPenStyle(color: UIColor.blue, thickness: 2.0)

    let stacks = SCIVerticallyStackedColumnsCollection()
    stacks.add(rsLeftSingle)
    stacks.add(rsLeftDouble)
    surface.renderableSeries.add(stacks)

    let legendModifier = SCILegendModifier()
    surface.chartModifiers.add(legendModifier)

That code displays a stack of yellow and blue bars, with a legend and checkboxes (both checkboxes selected). When I tap a checkbox to deselect it, the SCIChartSurface() goes blank, the legend remains on screen, and I see this message in the console:

Exception raised with reason: All stacked series in on collection should have the same amount of X Values

When I reselect that checkbox, I get my plot back.

There are no changes being made to the underlying data. Hiding/showing works correctly for horizontally stacked collection and for other renderable series types.

What’s your recommended workaround?

1 vote
2k views

Hello, I’m new to Swift and macOS, but I’m tasked to research SciChart. I have started my macOS trial, got my trial code from the wizard app. I’m following the Creating your first SciChart macOS App tutorial but I get Sorry! Your license token appears to be invalid error.

Here is what I’ve tried:

import Cocoa
import SciChart
import AppKit

@main
class AppDelegate: NSObject, NSApplicationDelegate {

//    override init() {
//        SCIChartSurface.setRuntimeLicenseKey("XXX")
//    }

    func applicationDidFinishLaunching(_ aNotification: Notification) {
        let licenseKey = "XXX"
        SCIChartSurface.setRuntimeLicenseKey(licenseKey)
    }

    func applicationWillTerminate(_ aNotification: Notification) {
        // Insert code here to tear down your application
    }

    func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
        return true
    }
}

Using override init() leads to Terminating app due to uncaught exception 'License Exception', reason: ''
Using SCIChartSurface.setRuntimeLicenseKey() in applicationDidFinishLaunching leads to Sorry! Your license token appears to be invalid. Please contact support with your OrderID if you believe this to be incorrect.

What am I doing wrong?

1 vote
18k views

Hello,

Out team have several question about the framework:

  1. Is there a way to make SCIChartSurfaceView background transparent so that the user could see underlying views? We tried using background brush of clear color on SCIChartSurface and making SCIChartSurfaceView backgroundColor transparent but no avail.

  2. Is it possible to add translate/rotate/scale animation to markers/annotations from code?

  3. When using gradient brush with mountain renderable series we found a strange visual artifact (“Gradient artifact” image). Is there a way to fix it?

Best regards,
Vasiliy

1 vote
5k views

Hello, I’m having an issue when I put multiple surfaces in an iOS view. Only the one made first is shown and there is a black space in place of the other. I swapped the order of creation and now the other is visible instead. Does anyone know why this is happening or have suggestions for putting multiple surfaces in an iOS view? Thanks

1 vote
3k views

Hi,

I’m using SciChart for macOS (v4.4.2.5871 installed via CocoaPods) and one thing that I tried was to implement the an axis to show full extent of data, as described in the first bullet of https://www.scichart.com/documentation/ios/current/axis-ranging—get-or-set-visiblerange.html#zooming-to-fit-all-the-data

However, what I’m getting is that after setting the visibleRange to match the dataRange, the dataRange no longer reflects the “true” range, but something else. Also “zoom to extent” no longer works

Attached is a super basic example (project) for this. To reproduce, do the following:

  1. Do a zoom (via pinch)
  2. Click the button titled “Set visibleRange to dataRange” -> this step works as expected
  3. Do a zoom
  4. Click again the button -> “zoom to extent” no longer works, dataRange is messed up
  • Vlad Badea asked 8 months ago
  • last active 8 months ago
1 vote
8k views

I was doing a bit of thinking about how I would be adding a horizontal line to my financial data series because my x-axis was in Date format. So I wrote this walkthrough with 2 functions to help any devs that come along after me.

My example is a bar chart with prices on the vertical y-axis and dates on the x-axis. the final product is posted below as a pic. All that is needed is to count the items in your date data series and you can position your bar relative to that.

my dates were in this object array and I just counted the array to get my bearings.

let totalBars = lastPriceList.count        //  holds number of bars in my price object
let startBar = totalBars - 100             //  this will make my line 100 bars long
let sellPrice = lastBar?.shortEntryPrice   //  here is the price level of the line I want to plot

then I passed that to this function to get a horizontal line

addTradeEntry(SignalLine: sellPrice!, StartBar: startBar, EndBar: totalBars)

here are the 2 functions that do all of the work

private func addTradeEntry(SignalLine: Double, StartBar: Int, EndBar: Int) {

    let horizontalLine1 = SCIHorizontalLineAnnotation()
    horizontalLine1.coordinateMode = .absolute;

// lower number pushes to left side of x axis
    horizontalLine1.x1 = SCIGeneric(StartBar)   
// higher number pushes bar right of x axis
    horizontalLine1.x2 = SCIGeneric(EndBar)    

// the position on y (price) axis
    horizontalLine1.y1 = SCIGeneric(SignalLine) 
    horizontalLine1.horizontalAlignment = .center

    horizontalLine1.isEditable = false
    horizontalLine1.style.linePen = SCISolidPenStyle.init(color: UIColor.red, withThickness: 2.0)
    horizontalLine1.add(self.buildLineTextLabel("Sell \(SignalLine)", alignment: .left, backColor: UIColor.clear, textColor: UIColor.red))
    surface.annotations.add(horizontalLine1)
}

this one formats the text

private func buildLineTextLabel(_ text: String, alignment: SCILabelPlacement, backColor: UIColor, textColor: UIColor) -> SCILineAnnotationLabel {
    let lineText = SCILineAnnotationLabel()
    lineText.text = text
    lineText.style.labelPlacement = alignment
    lineText.style.backgroundColor = backColor
    lineText.style.textStyle.color = textColor
    return lineText
}
1 vote
0 answers
4k views

I wan to have a view that is outside of the chart that is updated whenever the chart modifier selection is changed. Is there a way to get notified when the selection changes?

Also, is it possible to get rid of the data views. I guess I could just add a custom view to the rollover modifier that is empty?

What I want to achieve is that when the user is using the rollover modifier to view datapoint the values for that datapoint is shown above the chart. It should also be possible to drill down by clicking on this information.

1 vote
6k views

Hello!
I tried to draw relative line annotations but can’t get expected behavior.

I have a chart with date x axis and numeric y axis. I want to draw line from (x1, y1) to (x2, y2) where:
x1 = deal.startQuoteDate
y1 = deal.startQuoteRate
x2 = deal.endQuoteDate
y2 = deal.startQuoteRate

func activeDealAnnotations() -> [SCILineAnnotation] {
    return bnd_activeDeals.map { deal in
        let lineAnnotation = SCILineAnnotation()
        lineAnnotation.xAxisId = self.xAxisId
        lineAnnotation.yAxisId = self.yAxisId
        lineAnnotation.coordMode = .Relative
        lineAnnotation.style.linePen = SCIPenSolid(color: UIColor.whiteColor(), width: 0.5)
        lineAnnotation.xStart = SCIGeneric(deal.startQuoteDate)
        lineAnnotation.xEnd = SCIGeneric(deal.endQuoteDate)
        lineAnnotation.yStart = SCIGeneric(deal.startQuoteRate)
        lineAnnotation.yEnd = SCIGeneric(deal.startQuoteRate)
        return lineAnnotation
    }
}

I also tried different configurations of the line annotation to check the validity of x and y values.

lineAnnotation.coordMode = .RelativeX
lineAnnotation.xStart = SCIGeneric(0)
lineAnnotation.xEnd = SCIGeneric(1)
lineAnnotation.yStart = SCIGeneric(deal.startQuoteRate)
lineAnnotation.yEnd = SCIGeneric(deal.startQuoteRate)

lineAnnotation.coordMode = .RelativeY
lineAnnotation.xStart = SCIGeneric(deal.startQuoteDate)
lineAnnotation.xEnd = SCIGeneric(deal.startQuoteDate)
lineAnnotation.yStart = SCIGeneric(0)
lineAnnotation.yEnd = SCIGeneric(1)

lineAnnotation.coordMode = .RelativeY
lineAnnotation.xStart = SCIGeneric(deal.endQuoteDate)
lineAnnotation.xEnd = SCIGeneric(deal.endQuoteDate)
lineAnnotation.yStart = SCIGeneric(0)
lineAnnotation.yEnd = SCIGeneric(1)

The lines draws at expected parts of the chart. Now I’m sure that the values are valid and the problem is in the configuration.

Could you help me to do it right?

1 vote
12k views

When I embed my view controller in a navigation controller the top of the chart is hidden behind the navigation bar. So I went to the storyboard and found the view controller attributes section called “extend edges” and turned off the option called “under top bars”. This fixes the top of the chart. Now the bottom of the chart drops off the bottom of the screen. The x-axis is completely missing. Does SciChart support this case?

1 vote
3k views

Hello,

One thing I can’t figure out is why I don’t see the axis tooltips when using SCIRolloverModifier or SCICursorModifier? If I use xAxis.axisTitleMargins = NSEdgeInsets(top: 1000, left: 0, bottom: 10, right: 0) I can see tooltips on x axis but only until some point and from there moving the cursor to the right leads to some sort of overlay and tooltip disappears. See the photos.

Is this a bug or I’m doing something wrong?

1 vote
11k views

I’m attempting to integrate some of the tutorial swift code into my app and I’m getting stuck on this error. Seems like some macro isn’t running.

“Use of unresolved identifier ‘SCIGeneric'”

Code is like this: lineDataSeries.appendX(SCIGeneric(i), y: SCIGeneric(sin(Double(i))*0.01))

I’ve done “import SciChart” and most things seem to work fine except this. Any ideas? Thanks

1 vote
7k views

Is it possible to disable editing annotations via user drag?

1 vote
5k views

Can SciChart be used in UITableviewCell? Is it possible to use Software rendering on iOS?

The OpenGL/Metal charts are great, but I suspect Software rendering would be a better for displaying data in UITableViewCells. There are many mobile apps out there that use charts in tableviews and I’d love to be able to use SciChart here too.

1 vote
2k views

Hello,

I found a bug where the SCILegendModifier doesn’t display the full series name. If I add 5 spaces to the series name string, I’m able to see the full series name.

Also, when using margins on the legend modifier instance, the legend fills all available space. Manually resizing the window fixes this bug.

See the photos.

1 vote
5k views

I’m updating from Xamarin iOS SciChart v2 to v3 and just hit the issue that i can not use a custom TickProvider because there is no overridable UpdateTicks method.

I could not find any TickProvider code in the v3 Examples so the docs are my only source:
https://www.scichart.com/documentation/ios/current/axis-ticks—tickprovider-and-deltacalculator-api.html

According to the docs, I should override SCINumericTickProvider or SCIDateTickProvider

class CustomNumericTickProvider: SCINumericTickProvider
{
    public override void UpdateTicks(SCIDoubleValues minorTicks, SCIDoubleValues majorTicks)
    {
       //...
    }
}

But there is no UpdateTicks method to override.
I tried to override the Update() method instead:

public override void Update()
{
    Ticks.Clear();

    Ticks.MajorTicks.Add(5);
    //...
}

But that is just causing a freeze/crash at runtime.

It’s worth noting that it works well on Android because there is a UpdateTicks method to override.

What should I do?

  • Wil O asked 4 years ago
  • last active 4 years ago
1 vote
1k views

Hi. I’m currently working with sci chart iOS.

I create a custom crosshair modifier and get satisfactory results for most movements.

That crosshair by referring to your finance app, and one problem is that when the finger dragging the crosshair moves to the axis surface area, the crosshair movement stops.

It is true that the crosshair is only drawn on the chart surface, but I think I should continue to receive events even if it crosses the axis surface while dragging. How do I do that?


And another Q2. how to pause crosshair dragging event?

When I have multiple chart(vertical group), If I turn on crosshair and I start resizing dragging, crosshair is update according to dragging.

I hope just stop crosshair, but visible state. How can I do that?

  • jay han asked 3 months ago
  • last active 2 months ago
0 votes
5k 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

-1 votes
0 answers
4k views

Hi I am using pod ‘SciChart’, ‘3.0.1-nightly.5114’.

Q1)How get selected series instance, index. How to change the color of the selected series.(Using UITapGestureRecognizer and HitTest).

Q2)How to show only Min and Max tick label value of Y Axis. Just want to hide the intermediate tick labels in between Min and Max of Y Axis.

Q3)How to give some spaces at beginning and end of the series in Scichart.

Q4)How to hide the square gray stroke around the Scichart.

-1 votes
8k views

Hello Team,

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

donutSeries.segmentSpacing = 10

Thanks

-2 votes
0 answers
5k views

I don’t find limit line
How can I implement limit line without using Fast Line series?

0 votes
10k views

Hi!

I tried implementing pinch zooming for real time chart in the demo project(FIFO Performance Demo and ECG Monitor Demo) and found that it’s not possible.

I used the following code:

self.surface = [[SCIChartSurface alloc] initWithView: self.sciChartSurfaceView];
SCIPinchZoomModifier * pzm = [[SCIPinchZoomModifier alloc] init];
[pzm setModifierName:@”PinchZoom Modifier”];
self.surface.chartModifier = pzm;

If it is so, then how can I achieve it ?

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

Hi!
I am going through the showcase example for the spectrogram and I had a confusion on the sizeX and Y parameter of SCIUniformHeatmapDataSeries. Are these sizes as per the width and height of the surfaceChart ? I am going to plot an array of data. How do I determine the correct sizes for X and Y.
Moreover, is it necessary that the size array used for updating the dataSeries has to be (xSize*ySize)?

0 votes
7k views

Have recently converted to xcode 10 and swift 4.2.

Am now receiving this error message on build.

SciChart.framework/SciChart
Reason: no suitable image found. Did find:
/usr/lib/libstdc++.6.dylib: mach-o, but not built for iOS simulator

Any ideas?

0 votes
7k views

We have a graph surface with some point markers on it and we want to show a custom tooltip every time the user taps on a point marker. So far I’ve used a UITapGestureRecognizer, convert the touchpoint in the chart frame and for each of the renderable series perform a HitTestAtX with a radius (I’ve tried 1, 5 and 30) but it always returns true, even if I tap on an area where there’s a gap in the chart. Here’s some sample code:

SCIHitTestInfo hitTestInfo = renderableSeries.HitTestProvider.HitTestInterpolateModeAtX(touchPoint.X, touchPoint.Y, 30, renderableSeries.CurrentRenderPassData);

if (hitTestInfo.match)
{
       Console.WriteLine($"Tapped {hitTestInfo.xValue} {hitTestInfo.yValue} with index {hitTestInfo.index} of the series {renderableSeries.DataSeries.SeriesName}");

       var elementSeries = Model.BottomRightLegendList.FirstOrDefault(tup => tup.DataSeries.SeriesName == renderableSeries.DataSeries.SeriesName);

       var element = elementSeries.GraphElement;

       if (element != null)
       {
            matchedElements.Add(element);
       }
}

Why is the “match” property always true, even if there are no Point Markers in the radius?

0 votes
4k views

After upgraded SciChart to SciChart_iOS_SDK_3.0.0.5074, using rollover modifier on a SciChart surface which was embedded into a scroll view will crash the app. It crashed when user scroll horizontally on a SciChart surface inside a horizontal scrollable scrollview. It is the same with the vertically scrollable scrollview.

2020-03-09 10:14:15.489302+0800 ******[4835:62890] -[SCIRolloverModifier onTouchesCancelled:]: unrecognized selector sent to instance 0x60000ba28500

2020-03-09 10:14:15.503967+0800 *******[4835:62890] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[SCIRolloverModifier onTouchesCancelled:]: unrecognized selector sent to instance 0x60000ba28500’
*** First throw call stack:
(
0 CoreFoundation 0x00007fff23c7127e exceptionPreprocess + 350
1 libobjc.A.dylib 0x00007fff513fbb20 objc_exception_throw + 48
2 CoreFoundation 0x00007fff23c91fd4 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x00007fff23c75c4c
forwarding + 1436
4 CoreFoundation 0x00007fff23c77f78 _CF_forwarding_prep_0 + 120
5 SciChart 0x000000011139aaba -[SCITouchModifierBase onEvent:] + 186
6 SciChart 0x000000011135dfd8 +[SCIEventManager raiseOnEvent:toTarget:isMaster:] + 267
7 SciChart 0x000000011132d03f __38-[SCIEventDispatcher p_SCI_commonInit]_block_invoke + 165
8 SciChart 0x000000011132d45d -[SCIEventDispatcher raiseOnEvent:withAction:] + 569
9 SciChart 0x000000011133fa94 -[SCIChartSurfaceBase p_SCI_onTouchEvent:] + 233
10 SciChart 0x000000011133f996 -[SCIChartSurfaceBase touchesCancelled:withEvent:] + 209
11 UIKitCore 0x00007fff480bf863 forwardTouchMethod + 340
12 UIKitCore 0x00007fff480bf974 -[UIResponder touchesCancelled:withEvent:] + 49
13 UIKitCore 0x00007fff480bf863 forwardTouchMethod + 340
14 UIKitCore 0x00007fff480bf974 -[UIResponder touchesCancelled:withEvent:] + 49
15 UIKitCore 0x00007fff480a4a43 __106-[UIApplication _cancelViewProcessingOfTouchesOrPresses:withEvent:sendingCancelToViewsOfTouchesOrPresses:]_block_invoke + 609
16 UIKitCore 0x00007fff480a429e -[UIApplication _cancelTouchesOrPresses:withEvent:includingGestures:notificationBlock:] + 1163
17 UIKitCore 0x00007fff480a47ac -[UIApplication _cancelViewProcessingOfTouchesOrPresses:withEvent:sendingCancelToViewsOfTouchesOrPresses:] + 158
18 UIKitCore 0x00007fff47c37f2f -[UIGestureEnvironment _cancelTouches:event:] + 707
19 UIKitCore 0x00007fff47c40115 -[UIGestureRecognizer _updateGestureForActiveEvents] + 1779
20 UIKitCore 0x00007fff47c31eda _UIGestureEnvironmentUpdate + 2706
21 UIKitCore 0x00007fff47c3140a -[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:] + 467
22 UIKitCore 0x00007fff47c3117f -[UIGestureEnvironment _updateForEvent:window:] + 200
23 UIKitCore 0x00007fff480d04b0 -[UIWindow sendEvent:] + 4574
24 UIKitCore 0x00007fff480ab53b -[UIApplication sendEvent:] + 356
25 UIKit 0x0000000114ad2bd4 -[UIApplicationAccessibility sendEvent:] + 85
26 UIKitCore 0x00007fff4812c71a __dispatchPreprocessedEventFromEventQueue + 6847
27 UIKitCore 0x00007fff4812f1e0 __handleEventQueueInternal + 5980
28 CoreFoundation 0x00007fff23bd4471 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
29 CoreFoundation 0x00007fff23bd439c __CFRunLoopDoSource0 + 76
30 CoreFoundation 0x00007fff23bd3b74 __CFRunLoopDoSources0 + 180
31 CoreFoundation 0x00007fff23bce87f __CFRunLoopRun + 1263
32 CoreFoundation 0x00007fff23bce066 CFRunLoopRunSpecific + 438
33 GraphicsServices 0x00007fff384c0bb0 GSEventRunModal + 65
34 UIKitCore 0x00007fff48092d4d UIApplicationMain + 1621
35 ****** 0x000000010b51505f main + 143
36 libdyld.dylib 0x00007fff5227ec25 start + 1
37 ??? 0x0000000000000001 0x0 + 1
)

  • Gary Chan asked 4 years ago
  • last active 4 years ago
0 votes
8k views

Hello

In the real-time line chart, I want an animation like the video(link below).
Can you be provided with animations such as a point where a point drawn in real time continues to blink?

https://drive.google.com/file/d/1tcSFNPwSR4XEZqMX_t8GK2vzV5NUQUcn/view?usp=sharing

  • Jinsu Park asked 4 years ago
  • last active 4 years ago
0 votes
3k views

Hi all,
I am using the iOS SciCharts version to implement a heatmap series in my application. I am testing out the heatmap by providing a test series of random 100 zValues that range from 1-200. The Heatmap with the stops below just appears blue (see image). My suspicion is that either I am not updating the zValues correctly or the andStops is too low. Can anyone provide insights on what could be the issue?

//Test zValues
let SpectTestArray: [Double] = [ 12,  14, 68, 137, 164, 124, 124, 122, 162, 128, 45, 129,  40,  91,  53, 159,  77,  59,   0,  91, 92,  73,  77,  67, 163,  69, 149, 115,  17,  85, 119, 129, 186,  93,  80,  34, 159, 115,  65, 181, 159,  67, 152,  29,   6, 162,  51, 196, 186, 122, 114, 171, 159, 116,  20, 102,   4, 174, 144, 160, 89,  51,  89, 130, 172, 186,  40, 174,  20, 120, 88, 151, 127, 167,  10,  49, 198,  67, 184, 197, 152, 193, 196, 163,  18,  77,  17, 143, 124, 115, 1, 115, 126,  22,  35,   6,  58, 121,  77,   5]

let colors = [UIColor.fromARGBColorCode(0xFF00008B)!, UIColor.fromARGBColorCode(0xFF6495ED)!, UIColor.fromARGBColorCode(0xFF006400)!, UIColor.fromARGBColorCode(0xFF7FFF00)!, UIColor.yellow, UIColor.red]

CH1HeatMapRenderableSeries = SCIFastUniformHeatmapRenderableSeries()
        CH1HeatMapRenderableSeries.dataSeries = CH1SpectDataSeries
        CH1HeatMapRenderableSeries.minimum = 0.0
        CH1HeatMapRenderableSeries.maximum = 200.0
        CH1HeatMapRenderableSeries.colorMap = SCIColorMap(colors: colors, andStops: [0.0, 0.2, 0.4, 0.6, 0.8, 1.0])
        spectchartsurface?.renderableSeries.add(CH1HeatMapRenderableSeries)

        var Spectvalues = SCIDoubleValues(capacity: 100)

        for n in 0...SpectTestArray.count-1 {
            Spectvalues.add(SpectTestArray[n])
        }
//        print(Spectvalues)
        CH1SpectDataSeries.update(z: Spectvalues)
0 votes
7k views

Hi, guys

I want to show two renderableSeries on one chart view. These series have common x-axis (SCICategoryDateTimeAxis) and separate y-axes(SCINumericAxis). Only one of y-axis is visible at chart view. Also the data series of visible renderable series updated by scrolling to left or to right. So for displaying on one view i’m using:

[y1Axis setGrowBy: [[SCIDoubleRange alloc] initWithMin:SCIGeneric(0.3) Max:SCIGeneric(0.07)]];
[y2Axis setGrowBy: [[SCIDoubleRange alloc] initWithMin:SCIGeneric(0.0) Max:SCIGeneric(5)]];

So it’s look good at start (Correct_zooming.png). But after some scrolling it decrease axis extents of invisible y-axis (decrease.png).
Or even breaks down (broken.png)

For test i’m using SCIFastOhlcRenderableSeries and SCIHorizontallyStackedColumnsCollection readerable series.
Data series for SCIHorizontallyStackedColumnsCollection is initializated like:

    [volumeSerie1 updateAt:index Y:SCIGeneric(100000 / [multiplier doubleValue])];
    [volumeSerie2 updateAt:index Y:SCIGeneric(500000 / [multiplier doubleValue])];

So can you look at it?
Or what way i should implement this behavior?

Best regards,
Sushynski Andrei

0 votes
0 answers
12k views

iOS 11.2 with xCode 9.2

I have a chart with two data series and a legend. The chart lives in a view controller that is embedded in a navigation controller. I configured the navigation bar to hide itself when the phone it tilted into landscape mode: navigationController.hidesBarsWhenVerticallyCompact = true

When I tilt the phone the navigation bar is hidden as expected. However when I tap on the chart legend to turn off one of the data series I see the navigation bar re-appears. Screen shots attached.

0 votes
4k views

Andrew required swift code so I attach the code.
Please answer my question again.

https://www.scichart.com/questions/question/customize-chart-designwith-pic
https://www.scichart.com/questions/question/cannnot-remove-weird-square-areas

Andrew answered second question, but it didn’t work.
There is no drawAxisBands.

  • Minsub Kim asked 5 years ago
  • last active 5 years ago
0 votes
4k views

I need to do some calculation for data in visible range after zoom. Is there any notification when gesture ends in SCIPinchZoomModifier? If not, then that means I have to build a custom zoom gesture modifier? If so could you show me how pinch zoom is done in SCIPinchZoomModifier so that I don’t need to build everything from scratch? Thanks

  • Haoran Xie asked 5 years ago
  • last active 4 years ago
Showing 51 - 100 of 314 results

Try SciChart Today

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

Start TrialCase Studies