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

4 votes
15k views

I will continue to this question here, but with more details. So I need to be able to drag axis annotations separately. Is there any possible way to achieve this in iOS? Basically I subclassed SCIAxisMarkerAnnotation and implemented my own -onPanGesture:At: but it does not separate instances of the class when I try to drag one of the annoation. All moves to same place. How can I detect which annotation is being dragged?

CDAxisMarkerAnnotation.h

#import <SciChart/SciChart.h>
@class CDAxisMarkerAnnotation;

@protocol CDAxisMarkerAnnotationDelegate <NSObject>

- (void)axisMarkerAnnotation:(CDAxisMarkerAnnotation *)axisMarkerAnnotation
           didPanToAxisValue:(double)axisValue;

@end

@interface CDAxisMarkerAnnotation : SCIAxisMarkerAnnotation

@property (weak, nonatomic) id<CDAxisMarkerAnnotationDelegate> delegate;

@end

CDAxisMarkerAnnotation.m

#import "CDAxisMarkerAnnotation.h"

@implementation CDAxisMarkerAnnotation

- (BOOL)onPanGesture:(UIPanGestureRecognizer *)gesture At:(UIView *)view
{
    if (![view isKindOfClass:[SCIChartSurfaceView class]]) {
        return [super onPanGesture:gesture At:view];
    }

    switch (gesture.state) {
        case UIGestureRecognizerStateBegan:
        case UIGestureRecognizerStateChanged:
        case UIGestureRecognizerStateEnded: {
            CGPoint location = [gesture locationInView:view];
            id<SCIRenderSurface> renderSurface = [self.parentSurface renderSurface];
            CGPoint pointInChart = [renderSurface pointInChartFrame:location];
            id<SCICoordinateCalculator> yCalculator = [self.yAxis getCurrentCoordinateCalculator];
            double valueForYAxis = [yCalculator getDataValueFrom:pointInChart.y];
            [self.delegate axisMarkerAnnotation:self didPanToAxisValue:valueForYAxis];
            break;
        }
        default: {
            break;
        }
    }
    return YES;
}

@end

Thanks,
Irmak

2 votes
13k views

Hi,
I am currently trying the iOS Charting Library and want to implement a Column series with the drill-down functionality (when touching one of column points by end user). Does the charting component supports the hit-testing or selection feature to determine which point has been clicked at runtime?
Thanks!
Liza

  • liza yudup asked 8 years ago
  • last active 8 years ago
2 votes
8k views

I’m trying to create a spectrum viewer with your library. One important feature is a cursor supporting both automatic mode and manual mode. In automatic mode, it stays at the maximum value. In manual mode, it moves with finger panning. It’s close to the SCICursorModifier with the cross lines, but it should always stay on the plot even without touch. Also it should reside on real data points instead of anywhere in between like the SCIRolloverModifier instead of the SCICursorModifier.

Could you give me some advices about how to achieve it? Thanks.

EDIT: after reading more of your documents, I believe HorizontalLineAnnotation and VerticalLineAnnotation are the way to go. I have already added them as the automatic mode cursor. For the manual mode, I still need your help to achieve either:
1) a callback function for the VerticalLineAnnotation drag event, so that I could move both lines to the corresponding data point
or
2) a custom ZoomPanModifier to allow me to distinguish one point or two points touch: one point panning to move the whole plot and two points panning to determine the new cursor location and redraw the two annotations there

EDIT2: I was able to create a custom VerticalLineAnnotation class to handle the panning event. There is one more question left. Right now in order to update the verticallineannotation and horizontallineannotation on the graph, I remove them from sciChartSurface.annotations, change x/y locations and add them back. Is there a redraw or refresh or update function to call directly?

Thanks

  • Haoran Xie asked 5 years ago
  • last active 5 years ago
2 votes
9k views

From your documentation:

4.9 Annotations

SciChart features a rich Annotations API, that allows you to place UIKit UIElements over the chart.
SciChat provides a number of built-in annotations, but you can also create your own.

SCIBoxAnnotation, SCILineAnnotation and SCITextAnnotation are cool, but sometimes it’s not enough.

Is it possible to render UIView on the chart (at least UIImage)?
Is it possible to draw dashed line annotation?
Could you provide an example of creating custom annotation class?

2 votes
8k views

Trying to install SciChart.iOS NuGet package for Xamarin.iOS project results the following error:

Package SciChart.iOS 2.0.1.527 is not compatible with xamarinios10 (Xamarin.iOS,Version=v1.0). Package SciChart.iOS 2.0.1.527 supports: xamarinios (xamarin-ios,Version=v0.0)

Wondering what the heck is “xamarin-ios,Version=v0.0”? It must be xamarinios10. We’re considering to buy SciChart but right now our build server is stuck on this error. As a workaround, we raname xamarin-ios to xamarinios10 in the lib directory but this not an option for a cloud build server.

  • rubs00 asked 7 years ago
  • last active 7 years 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
4k 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
6k 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 3 months ago
1 vote
5k views

In Android we are using initPlacementStrategy with HorizontalLineAnnotations to hide the axis label of annotation when the annotation is scrolled out of the view. So what is the equivalent way in iOS

1 vote
3k views

Ran “pod update” this morning and got a 404 error with SciChart 4.4.0.5839 (see below)

So I changed my podspec to specify an earlier version of SciChart (4.4.0.5778) and ran update again and it was successful. This is just an FYI to report the problem, it is not blocking the team.

My environment: MacOS 12.4, Xcode 13.4, cocoapods 1.11.3

[!] Error installing SciChart
[!] /Users/mjc/opt/anaconda3/bin/curl -f -L -o /var/folders/mr/0skn4y5d1t99bcvzd09g_wdr0000gn/T/d20220713-25489-xbnbcz/file.zip https://github.com/ABTSoftware/PodSpecs/releases/download/v4.4.0.5839/SciChart_iOS_4.4.0.5839.zip –create-dirs –netrc-optional –retry 2 -A ‘CocoaPods/1.11.3 cocoapods-downloader/1.5.1’

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 9 0 0 0 0 0 0 –:–:– –:–:– –:–:– 0
curl: (22) The requested URL returned error: 404

1 vote
8k views

Hello

is there a way to set the padding (aka reduce the gap) between bars in a SCIFastColumnRenderableSeries?

I attach a screenshot of my current situation: I would like to have zero margin between columns.

I tried searching in the knowledge base but all the answers I found seem to refer to APIs not available in the iOS SDK

.

There is not such class method in the iOS SDK called SciChartSurface.Padding

Thanks for your help

1 vote
6k views

We are having an issue which is preventing us from upgrading to a newer version of Xamarin iOS SciChart.

With Xamarin iOS SciChart v3, the UpdateTicks method from SCINumericTickProvider cannot be overridden, because it doesn’t exist (at least not public).

In Xamarin Android SciChart v3, it works with overriding the UpdateTicks method.

In Xamarin iOS SciChart v2, it was possible to customize the ticks by overriding the method GetMajorTicksFromAxis from the class SCINumericTickProvider.

It looks like the types generation from iOS to Xamarin C# has missed to correctly export the UpdateTicks method as public overridable. (Because the docs say it should be there and it is there on Android Xamarin.)

  • Jens Stolz asked 4 years ago
  • last active 4 years ago
1 vote
4k views

Hi,

I’d like to update the iOS version to the latest stable one (4.1.0), but after following the steps here: https://www.scichart.com/documentation/ios/current/integrating-scichart-libraries.html
Xcode keeps complaining:

framework not found SciChart.xcframework
clang: error: linker command failed with exit code 1

If I downgrade back to 3.1.1 everything works again. Any idea why the version 4.1.0 is not working? I’m using Pods to manage all dependencies.

1 vote
4k views

I am trying to place a legend outside a Piechart without success. When I create the legend modifier like below everything works as expected:

    let legendModifier = SCIPieChartLegendModifier()
    legendModifier.sourceSeries = renderableSeries
    legendModifier.margins = UIEdgeInsets(top: 17, left: 17, bottom: 17, right: 17)
    legendModifier.position = [.bottom, .centerHorizontal]

However when I try to place it outside like below the app crashes with:
NSInvalidArgumentException’, reason: ‘-[SCIPieSegment seriesName]: unrecognized selector sent to instance 0x281881500

    legend = SCIChartLegend()
    legend.backgroundColor = SCIColor(.red)
    let dataSource = SCISeriesInfoLegendDataSource(legend: legend)
    legendModifier = SCIPieChartLegendModifier(legend: legend, dataSource: dataSource, useAutoPlacement: false)
    legendModifier.sourceSeries = renderableSeries.series
    legendModifier.margins = UIEdgeInsets(top: 17, left: 17, bottom: 17, right: 17)
    legendModifier.position = [.left, .top]

Note: I am using SwiftIUI and add the legend container to the swiftui view wrapped in an UIViewRepresentable

UIViewRepresentable(container: legend.container!)

if i comment out legendModifier.sourceSeries = renderableSeries.series the crash does not appear but the legend does not show.

1 vote
6k views

Hi SciChart team,

there is a working example that implement a Polar Chart type for iOS?
I was unable to find anything in the documentation. Only for WPF platform.
If not, there is a plan to support this kind of chart in next release of the library?

Thanks for the help.

1 vote
3k views

I’m developing chart with sci chart. And I current make candle stick chart.

I want to get correct center coordinate from user’s touch location.

so, I tried this way.

  1. get touch location
  2. get axis data from touch location like this
  3. get coordinate from data

let location = gestureRecognizer.location(in: self) // type is CGPoint
let selectedDate = xAxis.getDataValue(Float(location.x)) // xAxis's type is ISCIAxis
let selectedPoint = xAxis.getCoordinate(selectedData)

If I do that, no matter how far to the right you touch from the center line of the candlestick, you will get the position of the left candlestick.

If the candlestick center line is not crossed, the left data is unconditionally obtained.

I want to get the data closest to the touch, how do I do that?

  • jay han asked 3 months ago
  • last active 2 months ago
1 vote
8k views

Hello!

Great work, thanks a lot for this framework!

Could you provide an example of animated inserting of a new point? My goal is to implement interpolation between previous retrieved and last point on the real-time line chart.

1 vote
4k views

Hello,

I need to display realtime chart with 20 series of data. My data is arriving at 500Hz. When I’m displaying this data, I find that after a while SciChart hangs with what appears to be a deadlock.

I’ve read as much as I can find about realtime graphing with SciChart and I started with tutorial 4 – Adding Realtime Updates. This article (https://www.scichart.com/questions/wpf/is-xydataseries-safe-to-being-changed-in-a-separate-thread) suggests that SciChart is thread safe so I tried using a second thread to feed data into a graph. My only change was to move from the main thread timer in the example to a GCD timer running at 500Hz. With this, I’m easily able to reproduce the deadlock in around 1.5 seconds.

Here is the main thread which is attempting to render:

Thread 1 Queue : com.apple.main-thread (serial)
#0  0x0000000192bc8c20 in __psynch_rw_rdlock ()
#1  0x0000000192ae4864 in _pthread_rwlock_lock_wait ()
#2  0x0000000192ae47fc in _pthread_rwlock_lock_slow$VARIANT$mp ()
#3  0x0000000104a93828 in -[SCIRenderableSeriesLock initWithRenderableSeries:] ()
#4  0x0000000104ab742c in -[SCIRenderSurfaceRenderer p_SCI_updateCoreData:renderPassState:viewportSize:] ()
#5  0x0000000104ab6f4c in -[SCIRenderSurfaceRenderer p_SCI_renderLoop:assetManager:renderPassState:] ()
#6  0x0000000104ab6dc4 in -[SCIRenderSurfaceRenderer onDrawWithContext:andAssetManager:] ()
#7  0x00000001049c50c0 in -[SCIRenderSurfaceDrawable2D drawFrameIn:withDrawableSize:] ()
#8  0x0000000104ad4db8 in -[SCITwisterRendererBase drawFrameIn:withDrawableSize:] ()
#9  0x00000001049e56c8 in -[SCIMetalRenderer drawFrameIn:withDrawableSize:] ()
#10 0x0000000104a25b70 in -[SCIMetalRenderSurfaceBase draw] ()
#11 0x00000001999861ec in -[CALayer display] ()
#12 0x00000001999984d4 in CA::Layer::layout_and_display_if_needed(CA::Transaction*) ()
#13 0x00000001998e11d8 in CA::Context::commit_transaction(CA::Transaction*, double) ()
#14 0x000000019990ab78 in CA::Transaction::commit() ()
#15 0x000000019990b58c in CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) ()
#16 0x0000000192d50fbc in __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ ()
#17 0x0000000192d4beb0 in __CFRunLoopDoObservers ()
#18 0x0000000192d4c32c in __CFRunLoopRun ()
#19 0x0000000192d4bc38 in CFRunLoopRunSpecific ()
#20 0x000000019d39a38c in GSEventRunModal ()
#21 0x0000000196e7c444 in UIApplicationMain ()
#22 0x00000001042cc478 in main at /Users/mall/Downloads/SciChart.iOS.Examples-SciChart_v3_Release/tutorials/tutorials-2d/Tutorial 04 - Adding Realtime Updates/Tutorial 04 - Adding Realtime Updates/AppDelegate.swift:5
#23 0x0000000192bd38f0 in start ()

and here is my worker thread adding data to a series:

Thread 11 Queue : com.apple.root.default-qos.overcommit (concurrent)
#0  0x0000000192bc8c20 in __psynch_rw_rdlock ()
#1  0x0000000192ae4864 in _pthread_rwlock_lock_wait ()
#2  0x0000000192ae47fc in _pthread_rwlock_lock_slow$VARIANT$mp ()
#3  0x0000000104ac1518 in -[SCIXDataSeries p_SCI_searchDataIndexOn:xMinAsDouble:xMaxAsDouble:downSearchMode:upSearchMode:] ()
#4  0x0000000104ac1368 in -[SCIXDataSeries getIndicesXRange:xMinAsDouble:xMaxAsDouble:isCategoryAxis:] ()
#5  0x0000000104ac1b34 in -[SCIXDataSeries getWindowYRangeWithXCoordCalc:getPositiveRange:] ()
#6  0x0000000104aceddc in -[SCIRenderableSeriesBase getYRange:positive:] ()
#7  0x00000001049b25ac in -[SCIRangeCalculationHelper2DBase getWindowedYRangeWithXCalculators:] ()
#8  0x0000000104a05f84 in -[SCIAxisBase getWindowedYRangeWithXRanges:] ()
#9  0x00000001049f4184 in -[SCIChartSurface p_SCI_zoomExtentsYWithCalculators:andDuration:] ()
#10 0x00000001049f3d14 in -[SCIChartSurface p_SCI_zoomExtentsWithDuration:] ()
#11 0x00000001042c79e8 in closure #1 in ViewController.handleTimer() at /Users/mall/Downloads/SciChart.iOS.Examples-SciChart_v3_Release/tutorials/tutorials-2d/Tutorial 04 - Adding Realtime Updates/Tutorial 04 - Adding Realtime Updates/ViewController.swift:84
#12 0x00000001042c7500 in thunk for @escaping @callee_guaranteed () -> () ()
#13 0x0000000104abdae0 in +[SCIUpdateSuspender usingWithSuspendable:withBlock:] ()
#14 0x00000001042c7824 in ViewController.handleTimer() at /Users/mall/Downloads/SciChart.iOS.Examples-SciChart_v3_Release/tutorials/tutorials-2d/Tutorial 04 - Adding Realtime Updates/Tutorial 04 - Adding Realtime Updates/ViewController.swift:79
#15 0x00000001042c9250 in partial apply ()
#16 0x00000001042cb1e4 in closure #1 in closure #1 in RepeatingTimer.timer.getter at /Users/mall/Downloads/SciChart.iOS.Examples-SciChart_v3_Release/tutorials/tutorials-2d/Tutorial 04 - Adding Realtime Updates/Tutorial 04 - Adding Realtime Updates/RepeatingTimer.swift:26
#17 0x00000001042c7500 in thunk for @escaping @callee_guaranteed () -> () ()
#18 0x0000000107093730 in _dispatch_client_callout ()
#19 0x0000000107096390 in _dispatch_continuation_pop ()
#20 0x00000001070a9614 in _dispatch_source_invoke ()
#21 0x00000001070a4d74 in _dispatch_root_queue_drain ()
#22 0x00000001070a5698 in _dispatch_worker_thread2 ()
#23 0x0000000192aeab38 in _pthread_wqthread ()

Here is my version of the ViewController class from Tutorial 4 with the GCD timer (note that it uses RepeatingTimer class found here: https://gist.github.com/danielgalasko/1da90276f23ea24cb3467c33d2c05768) – my changes are marked with the //MALL comment:

import UIKit
import SciChart

class ViewController: UIViewController {

    //MALL
    private var timer = RepeatingTimer(timeInterval: 1.0/500.0)

    private let pointsCount = 200
    private var count: Int = 0

    private let lineData = SCIDoubleValues()
    private lazy var lineDataSeries: SCIXyDataSeries = {
        let lineDataSeries = SCIXyDataSeries(xType: .int, yType: .double)
        lineDataSeries.seriesName = "Line Series"
        lineDataSeries.fifoCapacity = 300
        return lineDataSeries
    }()
    private let scatterData = SCIDoubleValues()
    private lazy var scatterDataSeries: SCIXyDataSeries = {
        let scatterDataSeries = SCIXyDataSeries(xType: .int, yType: .double)
        scatterDataSeries.seriesName = "Scatter Series"
        scatterDataSeries.fifoCapacity = 300
        return scatterDataSeries
    }()

    private var surface: SCIChartSurface {
        return view as! SCIChartSurface
    }

    override func loadView() {
        viewRespectsSystemMinimumLayoutMargins = false
        view = SCIChartSurface()
    }

    override func viewDidLoad() {
        super.viewDidLoad()

        let xValues = SCIIntegerValues()
        for i in 0 ..< pointsCount {
            xValues.add(Int32(i))
            lineData.add(sin(Double(i) * 0.1))
            scatterData.add(cos(Double(i) * 0.1))
            count += 1
        }
        lineDataSeries.append(x: xValues, y: lineData)
        scatterDataSeries.append(x: xValues, y: scatterData)

        let lineSeries = SCIFastLineRenderableSeries()
        lineSeries.dataSeries = lineDataSeries

        let pointMarker = SCIEllipsePointMarker()
        pointMarker.fillStyle = SCISolidBrushStyle(colorCode: 0xFF32CD32)
        pointMarker.size = CGSize(width: 10, height: 10)

        let scatterSeries = SCIXyScatterRenderableSeries()
        scatterSeries.dataSeries = scatterDataSeries
        scatterSeries.pointMarker = pointMarker

        let legendModifier = SCILegendModifier()
        legendModifier.orientation = .horizontal
        legendModifier.position = [.bottom, .centerHorizontal]
        legendModifier.margins = UIEdgeInsets(top: 0, left: 0, bottom: 10, right: 0)

        SCIUpdateSuspender.usingWith(self.surface) {
            self.surface.xAxes.add(items: SCINumericAxis())
            self.surface.yAxes.add(items: SCINumericAxis())
            self.surface.renderableSeries.add(items: lineSeries, scatterSeries)
            self.surface.chartModifiers.add(items: SCIPinchZoomModifier(), SCIZoomExtentsModifier())
            self.surface.chartModifiers.add(items: SCIRolloverModifier(), legendModifier)
        }

        //  MALL
        timer.eventHandler = handleTimer
        timer.resume()
    }

    //  MALL
    private func handleTimer() {
        let x = count
        SCIUpdateSuspender.usingWith(surface) {
            self.lineDataSeries.append(x: x, y: sin(Double(x) * 0.1))
            self.scatterDataSeries.append(x: x, y: cos(Double(x) * 0.1))

            // zoom series to fit viewport size into X-Axis direction
            self.surface.zoomExtents()
            self.count += 1
        }
    }
}

Thanks in advance for any help you can offer.

1 vote
3k views

I am considering applying server-side licensing for my javerScript application.

In the document below, there is a phrase “Our server-side licensing component is written in C++.”
(https://support.scichart.com/index.php?/Knowledgebase/Article/View/17256/42/)

However, there is only asp.net sample code on the provided github.
(https://github.com/ABTSoftware/SciChart.JS.Examples/tree/master/Sandbox/demo-dotnet-server-licensing)

I wonder if there is a sample code implemented in C++ for server-side licensing.

Can you provide c++ sample code?
Also, are there any examples to run on Ubuntu?

1 vote
7k views

Hi,

Am trying to limit the depth in which the user can zoom into and out of the graph. I came across the property minimalZoomConstrain in the header file and also the documentation and had attempted to use it.

The axis in question is a DateTimeAxis and I would want to limit the zoom in depth to 30 seconds and the zoom out the about 3 months. I understand that the type it takes is the GenericType, where I will have to use the SCIGeneric(x) to assign the value, but what value x am I required to use in this case?

I’ve tried the values ’30′(assuming it takes NSTimeInterval) and even attempted to pass in a NSDate value but nothing seems to work.

Thank you.

  • Elle Yeoh asked 8 years ago
  • last active 8 years ago
1 vote
6k views

We’d like to customize the look of our legends. We have 4 legends displaying different data, but right now the only thing we can change is the Theme. Is there any way to customize the legend items, like add some icons, change the point marker shape and size, change the check box icon etc…

P.S.: I’m not a trial user. We have an iOS, Android and WPF licenses purchased.

Project info:
Xamarin.iOS
SciChart.iOS 2.2.2.854

1 vote
4k views

I was trying to test SciChart on simulator, but I have a problem: I added chart surface on my view, and after I launch an app, SciChart is showing me this text on the screen :
“Hardware rendering performance of SciChart in simulator is SLOW. Please use an actual device to feel the real-world performance”
How do I remove this text and test my charts on the simulator?

1 vote
6k views

How can I format the percentage values in the pie chart segments to omit the decimals? e.g i want it to show 20% instead of 20.00%. The values I pass in are always rounded

1 vote
0 answers
9k 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.

1 vote
3k views

I want to make label on yAxis.
SCIChart provides AxisMarkerAnnotation, but I want to use CustomAnnotation because I need something custom.
So I tried drawing a CustomAnnotation on the yAxis but failed.
Android succeeds in drawing CustomAnnotation on the yAxis using the method below, but iOS doesn’t provide it?
On iOS, Can’t customAnnotation only set the value of the yAxis like AxisMarkerAnnotation?
Android was possible…

error message like this
Exception raised with reason: CALayer position contains NaN: [nan 248.71]. Layer: <CALayer:0x280c10bc0; position = CGPoint (0 0); bounds = CGRect (0 0; 0 0); delegate = <BTChart.CurrentPriceAnnotationView: 0x13d74d8f0; frame = (0 0; 0 0); layer = <CALayer: 0x280c10bc0>>; sublayers = (<_UILabelLayer: 0x282d15860>); opaque = YES; allowsGroupOpacity = YES; >

1 vote
12k views

Hello!

Please take a look at the attached screenshot first.

I have a chart configured to draw real-time trading data. X axis type is DateTime. Y axis type is Float. I need to draw vertical expiration time line.

I tried to draw coordinate relative line annotation as follows:

var date: NSDate = NSDate()

let lineAnnotation = SCILineAnnotation()
lineAnnotation.xAxisId = self.axisXId
lineAnnotation.yAxisId = self.axisYId
lineAnnotation.coordMode = .SCIAnnotationCoord_RelativeX
lineAnnotation.style.linePen = SCIPenSolid(color: Style.Chart.ExpirationDateLine.Color, width: Style.Chart.ExpirationDateLine.Width
lineAnnotation.xStart = SCI_constructGenericTypeWithInfo(&date, .DateTime)
lineAnnotation.xEnd = SCI_constructGenericTypeWithInfo(&date, .DateT            

self.chartSurface.annotation = lineAnnotation
self.chartSurface.invalidateElement()

I tried to play with different coordMode values. Line does not appear. Could you help me with this task?

1 vote
0 answers
5k views

I’m always getting an Unsorted Data Error when I’m running the Xamarin on iOS simulators, but it doesn’t happen if I run the app on a real iOS device. Does anyone have any idea what could the problem be?

Thanks,
Lazar Nikolov
[email protected]

1 vote
4k views

On clicking any where on stacked bar chart it shows the x axis value. How can we disable the highlight ?

1 vote
5k views

Hello,

I recently updated 2 different apps that both use SciChart with XCode14 and uploaded the archives to the App Store via Organizer. They both generated the warning/error:

“The app references non-public selectors in …/Frameworks/SciChart.framework/SciChart: moveToX:y:”

This did not occur with Xcode 13.

Any advice on how best to handle this?

Thank you.

  • C Bolton asked 2 years ago
  • last active 1 year ago
1 vote
7k views

I’m trying to render a column chart with multiple series. I want the two series to show side-by-side. See the reference image attachment for how I want it to look.

However, when I add a second series to a surface, the two series overlap and draw over each other, such that you can ‘t see some of the column data points.

Is there a way to draw multiple series that don’t overlap?

While I’m here, a have a couple of more questions:

• Is there a way to show more of the values on the time/date series X-axis . Notice in the SciChart column chart that is attached it shows every third value on the X-axis (Jan, April, July, October). It would be great if I could show every two, or all for each data point.

• For a time/date series X-axis, can I show a different representation of the time/date values? Specifically, I want to show, e.g.

Jan 17

rather than

01-2017

Presumably one would specify a different date formatter but I only see how to do variations of “MM-dd-yyy”. I want to show values as textual rather than numeric.

• Is there a way to extend the Y-axis to go higher?
In the SciChart column chart attachment, the Y-axis goes up to 100, but the values go higher. I would like to show the the Y-axis going up to 120.

• Is there a way to change the interval of the Y-axis?
Instead of showing every 20 values, can I show every 25 values?

Thanks.

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

I didn’t see anything in any docs, so I am just wanting to verify this info…

Is this correct that you have to link in and ship the libSwiftCore (+ other swift libs) with an app using SciCharts on iOS? When I added the chart library to my app; the app crashed at startup with missing dynamic load of libSwiftCore.dylib on a real device (emulators run fine).

Enabling ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES in the build settings fixed this issue. But this surprised me that the SciChart library would actually require Swift.

Was this intentional; or did the library somehow pickup an unintentional reference somewhere….

1 vote
8k views

We’re trying to make multiple legends on the screen, for example, 1 for the left axis and its data series, 1 for the right axis and its data series. I can see it’s possible in the WPF documentation, but in the iOS documentation it says “Coming soon!”. Do we need to wait for a future release of the Xamarin.iOS library or is it possible somehow now?

By the way, I’m not a trial user. We’ve just purchased a license today.

Thanks,
Lazar Nikolov

1 vote
0 answers
8k views

Hello,

When I apply the cross marker type to a scatter plot, it’s not centered correctly. It gets more off-center the thicker the stroke becomes. This tends to be the case for any mark that uses the strokeStyle parameter.

This is actually visible in the example app under “Using PointMarkers”. In the attached screenshot of the example app, I increased the cross marker thickness to 15 to show how off-center the cross is to the line. This becomes a bigger issue in a scatter series as there’s no line to reference of where the point should actually be.

Hopefully there’s a way to fix this, but if not, any help on how to apply a corrective offset would be great.

Thanks in advance for any guidance!

1 vote
8k views

Hi,

Is there any possible way to get axis value for a point in chart view? I use pan gesture to get the touch location and convert it to its context point but cannot find the value for that CGPoint.

Thanks,
Irmak

1 vote
2k views

Hello there,

I am new to SciChart and trying to implement custom SCICursorModifiers tooltip,

It’s almost done, except one issue, i.e I am not able to hide the X axis (or) Horizontal line which is in green colour, it is showing up in the background whenever I am trying to use the tooltip.

The line which needs to be hidden

I tried with following below code but it is not working

extension SCIChartTheme {
    static let berryBlue: SCIChartTheme = SCIChartTheme(rawValue: "SciChart_SciChartv4DarkStyle")
}

SCIThemeManager.addTheme(.berryBlue, from: Bundle.main)

Is there any way to achieve this

Thanks in Advance

1 vote
8k views

Originally my chart would
– create the surface
– setup the chart modifiers
– setup the axis
– add the data (SCIFastLineRenderableSeries).

However, it appears that when you .add(new SCIFastLineRenderableSeries) it recreates all the tooltips on each add, and finally on the very last SCIFastLineRenderableSeries that is inserted will get two duplicate tooltips. This happens both with the default tooltips or custom tooltips.

I finally noticed that some of your examples you setup the modifiers at the end after adding the data. So I moved all the chart modifiers into a separate function and called it after the data is setup, and now the proper number of tooltips appears.

This might either need to be noted somewhere prominent in the iOS docs; or even better the order shouldn’t matter.

1 vote
5k views

In Scichart 2, we had some code that added some annotations in the SCIAnimation completion block. Here’s a snippet. We need the self.renderAnnotations() to happen AFTER the chart data range is set, because we only draw annotations that will fit within the individual bar stack elements.

        SCIUpdateSuspender.usingWithSuspendable(sciChartSurface) {
            if hasBarData {  
                self.sciChartSurface?.renderableSeries.add(columnCollection)
                let animation = SCIWaveRenderableSeriesAnimation(duration: 1, curveAnimation: .easeOut)
                animation.completionHandler = {
                    self.renderAnnotations()
                    self.configurationButtons?.forEach { $0.isUserInteractionEnabled = true }
                }
                columnCollection.addAnimation(animation)
            }

Here’s the current rewrite to run under Scichart 4. With this code, yAxisLeft.visibleRange has not been updated to the correct data range when renderAnnotations() is called.

Uncommenting the 3 animator-related lines near the bottom doesn’t make a difference, and my listener function is never called.

I’ve also tried wrapping the renderAnnotations() call in a DispatchQueue.main.asyncAfter() call. That sometimes works, and sometimes results in renderAnnotations() not being called at all.

How do I get renderAnnotations() (and the following line looping on configurationButtons) to run, reliably, after the axis range setup is complete?

How do I get my wave animation back?

        SCIUpdateSuspender.usingWith(sciChartSurface) {
            if hasBarData { 
                self.sciChartSurface?.renderableSeries.add(columnCollection)
                    self.renderAnnotations()
                self.configurationButtons?.forEach { $0.isUserInteractionEnabled = true }
//                let animator = SCIAnimations.createWaveAnimator(for: columnCollection)
//                animator.add(self)
//                animator.start()
            }
1 vote
11k views

I’ve got error message during compilation:

 ld: bitcode bundle could not be generated because '.../Frameworks/SciChart.framework/SciChart' was built without full bitcode. All frameworks and dylibs for bitcode must be generated from Xcode Archive or Install build for architecture armv7

I temporary disabled bitcode for target. Will you fix it in the next build?

1 vote
4k views

I download the iOS library via cocoapods. Today running ‘pod update’ results in the error below. It seems the ZIP file is not available on the server.

Installing SciChart 4.4.1.5847 (was 4.4.1.5840)
[!] Error installing SciChart
[!] /usr/bin/curl -f -L -o /var/folders/mr/0skn4y5d1t99bcvzd09g_wdr0000gn/T/d20221217-6770-1dkgzs/file.zip https://github.com/ABTSoftware/PodSpecs/releases/download/v4.4.1.5847/SciChart_iOS_4.4.1.5847.zip --create-dirs --netrc-optional --retry 2 -A 'CocoaPods/1.11.3 cocoapods-downloader/1.6.3'

curl: (22) The requested URL returned error: 404

I tried to download the zip file manually and it failed. When I modified the URL to download the previous release (4.4.1.5840) it worked.

1 vote
6k views

i want to insert 500 data on the left of chart.
then, it freezes slightly.
so, i want to present indicator.
how can i listen to start and end of drawing?

1 vote
5k views

Hi,

i am Swift Language

=>Senario
i am plotting live ECG Data on SciChart Surface. I have added 9 Graph on Storyboard in a UIScrollView for the Following things
-ECGI
-ECGII
-ECGaVL
-ECGV
-ECGIII
-ECGaVF
-ECGaVR
-Pleth
-RESP
Each of the above has data = [Int]
i had written a custom Class for Plotting Live Data

=>Class Specification
Inherited From UIView in a seperate xib which contains
– A Label For Name of the chart,
– A chart to draw data and a label
– for displaying frame buffer speed

=>Requirement a Single Chart (Chart have no modifier added onit)

=> ISSUE
Everything Works Fine until the scroll start, On Scrolling The chart stop Plotting Data Until the Scroll stops

  • Atiq Tahir asked 5 years ago
  • last active 4 years ago
Showing 1 - 50 of 314 results