Pre loader

Forums

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
14k 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
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 6 years ago
2 votes
11k 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 7 years ago
1 vote
5k 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
1k 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 2 months ago
  • last active 1 month ago
1 vote
7k 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
2k 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 7 years ago
  • last active 7 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
3k 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
5k 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
7k 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
1k 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
4k 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
3k views

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

1 vote
4k 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 12 months 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
6k 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
7k 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
4k 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
10k 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
2k 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
4k 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 4 years ago
  • last active 4 years ago
1 vote
4k views

I work on a SwiftUI project that has integrated SciCharts.

What I’ve noticed is that while there are SwiftUI examples available, they are rather basic and when I replicate the example code over in my project, it does not run as we expect and in some cases does not run at all.

Currently there seems to be issues with the SwiftUI run loop, SwiftUI’s use of structs, and SciCharts use of pointers that make building complex charts within complex user interfaces rather challenging.

I needed to do a lot of work to get the SwiftUI example code to work in my project, and we’re still facing some challenges. Can we expect better SwiftUI support in the future, such as SwiftUI views included in the SDK or if this work has been done can the documentation be linked?

1 vote
8k views

I found the example for spline drawing, but it’s still missing the gradient brush that mountain series have, how can I add it? thanks

1 vote
3k views

What’s the new (Swift) signature for V2’s updateDataContext(withContext label: SCIDefaultTickLabel!, data dataValue: SCIGenericType, style: SCITextFormattingStyle!) -> SCITickLabelProtocol!? Obviously the SciGenericType is different.

My searches aren’t pulling up anything except hits on the V2 documentation, and all of those now 404.

I’m using that call to put gesture recognizers on some tick labels. I want those gesture recognizers to be different than the one I’m putting on the entire chart. And I need to update the locations every time theX axis changes. An alternate way to achieve this would also be welcome.

1 vote
10k views

I’m trying to create a horizontal bar chart, with bars starting at 0 point on the left then going to the right. I do this by putting the X axis at the left and the Y Axis on the bottom. However, setting the X Axis in the Left or Right area still produces a bar chart with the bars starting at 0 on the right and going left.

I thought I could make the Y Axis flipped and this might help. For example, there’s a property called ‘isAxisFlipped’ in SciAxis2D protocol. However, calling has no effect because is says the SciNumericAxis hasn’t implemented this method. I tried subclassing SciNumericAxis and overriding the isAxisFlipped method myself to return true. However, this has no effect as I don’t see this method ever getting called by anyone else.

So, is there a way to do horizontal columns/bar that go left to right?

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

We are using stacked bar chart, and showing only 6 bars visible at a time.
In the X-Axis, the month labels are missing for alternate months & only displays all month label as a flash when graph is being scrolled. Is there any way to fix this.

1 vote
3k views

Trying to install SciChart using the PodSpecs-Nightly repo:

source ‘https://github.com/ABTSoftware/PodSpecs-Nightly.git’

Running pod install results in this error:

[!] Error installing SciChart
[!] /usr/bin/curl -f -L -o /var/folders/mr/0skn4y5d1t99bcvzd09g_wdr0000gn/T/d20221220-30745-gfzfrf/file.zip https://github.com/ABTSoftware/PodSpecs-Nightly/releases/download/v4.4.1-nightly.5867/SciChart_iOS_4.4.1-nightly.5867.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

Notice the word “SDK” is missing from the URL above. The correct URL should be:

https://github.com/ABTSoftware/PodSpecs-Nightly/releases/download/v4.4.1-nightly.5867/SciChart_iOS_SDK_4.4.1-nightly.5867.zip

1 vote
5k views

I have been trying to find a tutorial for ViewPortManagers for IOS and Xamarin.ios. Has anyone been able to pull this off and willing to share an example?

1 vote
6k views

I’m having difficulty determining the easiest method of placing the legend outside of the chart surface in iOS. I’ve done a ton of trial and error and have run into several issues. I understand that the SCIChartLegend class is just a subclass of UICollectionView. The problem seems to be these two things:

— When adding a legend via SCILegendModifier it only allows for custom placement if using SCILegendModifier’s initializer which also requires you assign an SCILegendDataSource. Or at least that’s required for the initializer with the useAutoPlacement parameter that I can then set to false (not even sure if that would work once I got that far).

— Placing the SCIChartLegend view manually without first initializing an SCILegendModifier with it results in none of the legend cells being loaded. I would imagine this is due to a missing SCILegendDataSource.

It seems like these could be overcome if I could somehow construct a default instance of SCILegendDataSource. Unfortunately, SCILegendDataSource only exposes one initializer which requires I pass it a xib name for the legend items. But I do not want to customize the legend items- I simply want to be able to construct the default SCILegendDataSource because that is apparently required to get the SCIChartLegend working.

Am I making this more complicated than it needs to be? What’s the simplest path to placing the chart legend where I want in iOS?

  • Sean Young asked 5 years ago
  • last active 5 years ago
1 vote
2k views

Greetings! I see you have support Xamarin.iOS and Xamarin.Android, however, I’m not sure about support status: do you support .NET 7 iOS and Android?

1 vote
4k views

Try to integrate new SciChart.xcframework 4.2.0 instead of SciChart.framework 2.0 to the project and build failed in Xcode 12.4 with the next errors:
RNSciCandlestickChart.swift:
1) 335th line: Editor placeholder in source file
dates.add(date!))
2) 549th line: Cannot convert value of type ‘Bundle.Type’ to expected argument type ‘Bundle’ SCIThemeManager.addTheme(byThemeKey: theme, from: Bundle)
3) 768th line: Method does not override any method from its superclass
override func internalHandleGesture(_ gestureRecognizer: UIGestureRecognizer)
AnnotationDragListener.swift:
1) 4th line: Cannot find type ‘SCIAnnotationDragListener’ in scope
class AnnotationDragListener: SCIAnnotationDragListener
RNSciLineChart.swift:
1) 475th line: Editor placeholder in source file
SCIThemeManager.addTheme(byThemeKey: theme, from: Bundle)
Can you tell me please can I launch SciChart.xcframework 4.2.0 in Xcode 12.4? Any how to solve this issues?

1 vote
6k views

I want to style one of the data point bars in a column chart to be a different color. Is there any way to do this?

  • doughill asked 8 years ago
  • last active 8 years ago
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
3k 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
2k 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
9k 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
Showing 1 - 50 of 312 results