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

0 votes
7k views

When I create a SCIChartSurface programmatically, following the Quick Start guide:
https://www.scichart.com/documentation/ios/current/creating-your-first-scichart-ios-app.html#adding-scichartsurface-purely-from-code

Functionally everything works as expected, but I see a series of these messages in the log:

   [CAMetalLayer nextDrawable] returning nil because allocation failed.

I do not see these messages when the SCIChartSurface is instantiated via a storyboard.

0 votes
11k views

I am using an SCINumericAxis for my y-axis. I am setting the visibleRange to (Min = 28, Max = 76). I am leaving the minorsPerMajor to the default of 5. However when looking at my graph (attached) you can see that the major tick labels are actually every 6 minors, e.g. 30, 36, 42, etc. when they should be 30, 35, 40, etc for minorsPerMajor set to 5.

Please advise on how to fix this issue as my major tick labels should be every 5, not every 6.

  • Brad Taber asked 4 years ago
  • last active 4 years ago
0 votes
5k views

I have followed the example at: https://www.scichart.com/documentation/ios/current/legend-modifier.html for creating a legend with a custom item.

The initial problem I am trying to solve is that the default legend has a black background but my chart is white. If I set the background of the legend to white, this is a problem because the series text is white, so you can’t read it any longer. Therefore in order to have a legend with a white background to match my chart, I needed custom legend items to be able to set the series text color to black.

I have created my ChartLegendCell.swift file based on the example and my ChartLegendCell.xib which has a UIView and a UILabel. I incorporate these into my code exactly as in the example. However the legend does not show up upon render. I added a breakpoint inside the ChartLegendCell.swift class and I see bindSeriesInfo method called twice per series. What I noticed is that the first time it is called, printing out self.bounds shows (0,0,230,35) which is correct, but the second time it is called self.bounds is (0,0,0,0).

Is there more code which needs to be added in the ChartLegendCell.swift to make sure the width and height aren’t 0?

  • Brad Taber asked 4 years ago
  • last active 4 years ago
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

0 votes
4k views

Hello, I’ve been trying to create a SCIUniformHeatMap, but I only get a blank, black screen.
Can anyone recommend why colors and the graph aren’t showing up? Thanks

var ecmSurface: SCIChartSurface = SCIChartSurface()
var ecmDataSeries = SCIUniformHeatmapDataSeries(xType: .double, yType: .double, zType: .double, xSize: ReviewModeData.MATRIX_COLUMNS, ySize:ReviewModeData.MATRIX_ROWS)
var heatmapRenderableSeries: SCIFastUniformHeatmapRenderableSeries = SCIFastUniformHeatmapRenderableSeries()
private let countColors = 6
private var colorRGBArray: [UIColor] = [
UIColor(red: 0.0/255.0, green: 0.0/255.0, blue: 131.0/255.0, alpha: 1),
UIColor(red: 0.0/255.0, green: 0.0/255.0, blue: 255.0/255.0, alpha: 1),
UIColor(red: 0.0/255.0, green: 255.0/255.0, blue: 255.0/255.0, alpha: 1),
UIColor(red: 255.0/255.0, green: 255.0/255.0, blue: 0.0/255.0, alpha: 1),
UIColor(red: 255.0/255.0, green: 0.0/255.0, blue: 0.0/255.0, alpha: 1),
UIColor(red: 128.0/255.0, green: 0.0/255.0, blue: 0.0/255.0, alpha: 1)
]
for i in 0..<ReviewModeData.MATRIX_COLUMNS {
for j in 0 ..< ReviewModeData.MATRIX_ROWS {
ecmDataSeries.update(z: ecm2DMatrix[i][j], atX: i, y: j)
}
}
var colorZValueArray: [Double] = determineColorMapValues(clim1: 0, clim2: 1);
var colorMap = SCIColorMap(colors: colorRGBArray, andStops: colorZValueArray as [NSNumber])

//configure ECM heatmap
heatmapRenderableSeries.minimum = ReviewModeData.ECM_CLIM1
heatmapRenderableSeries.maximum = ReviewModeData.ECM_CLIM2
heatmapRenderableSeries.dataSeries = ecmDataSeries
heatmapRenderableSeries.colorMap = colorMap!

0 votes
9k views

Hi,

There is a strange displaying behavior of custom annotation. I added custom annotation using the code below.

let imageView = UIImageView(image: UIImage(named: imageName))
imageView.frame = CGRect(origin: .zero, size: CGSize(width: 10, height: 10))

let customAnnotation = SCICustomAnnotation()
customAnnotation.customView = imageView
customAnnotation.verticalAnchorPoint = .bottom
customAnnotation.horizontalAnchorPoint = .center
customAnnotation.set(x1: xCoordinate)
customAnnotation.set(y1: yCoordinate)
sciChartSurface?.annotations.add(items: customAnnotation)

The result looks good, but when I move surface left and right, custom annotation would go outside of bounds. Like the image I uploaded.

Please help me solve the issue.

Thanks.

0 votes
7k views

I am trying to add a legend to my chart similar to how is done in the LegendChartView.swift code in the sample app. However the legend does not show and I get several NSLayoutConstraints conflicts such as this one:

[LayoutConstraints] Unable to simultaneously satisfy constraints.   Probably at least one of the constraints in the following list is one you don't want.   Try this:       (1) look at each constraint and try to figure out which you don't expect;       (2) find the code that added the unwanted constraint or constraints and fix it.  (
    "<NSLayoutConstraint:0x283528af0 UIButton:0x13c52d840.height == 25   (active)>",
    "<NSLayoutConstraint:0x2835285f0 UIButton:0x13c52d840.bottom == UIView:0x13c545060.bottom - 4   (active)>",
    "<NSLayoutConstraint:0x2835285a0 V:|-(4)-[UIButton:0x13c52d840]   (active, names: '|':UIView:0x13c545060 )>",
    "<NSLayoutConstraint:0x283528b40 'UIIBSystemGenerated' SCIDefaultLegendItem:0x13c543f90.top == UIView:0x13c545060.top   (active)>",
    "<NSLayoutConstraint:0x283528b90 'UIIBSystemGenerated' V:[UIView:0x13c545060]-(0)-|   (active, names: '|':SCIDefaultLegendItem:0x13c543f90 )>",
    "<NSLayoutConstraint:0x283529c20 'UIView-Encapsulated-Layout-Height' SCIDefaultLegendItem:0x13c543f90.height == 0   (active)>" )

Will attempt to recover by breaking constraint  <NSLayoutConstraint:0x283528af0 UIButton:0x13c52d840.height == 25   (active)>

The internal SCIDefaultLegendItems look to keep setting their width and height to 0 which causes conflicts with the underlying UIButton and UILabel components.

Any thoughts on how to get around this? My chart has four series. I have seen the article on drawing the legend outside the chart surface area however I do not want to do that.

Thank you!

  • Brad Taber asked 4 years ago
  • last active 4 years ago
0 votes
4k views

I have a question about the font of the label text. When the screen is captured and enlarged, the character has an outline border. Is there a way to get rid of this border? Japanese Kanji font is used.
Thank you.

var yAxisLeft = new SCINumericAxis();
yAxisLeft.AxisTitle = syAxLeft;
yAxisLeft.AxisId = "Primary Y-Axis";
yAxisLeft.AxisAlignment = SCIAxisAlignment.Left;
yAxisLeft.TitleStyle = new SCIFontStyle(14, UIColor.Green);
yAxisLeft.TickLabelStyle = new SCIFontStyle(14, UIColor.Green);
yAxisLeft.DrawMajorBands = false;
yAxisLeft.DrawMinorGridLines = false;
0 votes
4k views

When I add CursorModifier programmatically on long tap I have to remove my finger from screen and press it again In order to CursorModifier become visible

Is it possible to do the following?


1) scroll chart horizontally

2) long tap on screen

3) add CursorModifier programmatically and show it immediately

4) move CursorModifier(finger is still touching the screen)

5) remove finger from screen and remove CursorModifier so I can scroll again

Thank you for reply in advance!

  • Dok God asked 4 years ago
  • last active 4 years ago
0 votes
10k views

Hello,

Would it be possible to receive some information on how to take the legend outside of the chart surface area? We are having an issue when the user selects more axis’ to be shown in the chart. The chart then shrinks horizontally making the legend difficult to access for removing the axis’.

A quick how to with some code example would be highly appreciated. To further highlight, this is Xamarin.iOS project we are talking about.

Thank you and have a nice day.

Best Regards

0 votes
6k views

Hello everyone.
We are trying to migrate to V3 in our iOS project and we have many issues.
One of the most important is the implementation of vertically-draggable horizontal lines.
I have a nice working code for SCICharts V2 but I cannot find any similar example of how we can implement a custom modifier for moving an SCIHorizontalLineAnnotation vertically in V3.
We have done it already with the V2 but now that we have to migrate to V3 there is a huge missing part in your documentation.
Our code was using-overiding onPanGesture() in order to figure out if the modifier should handle the touching event, then we were using the touch point in order to find the closer horizontal lines and choose the closest one in order to change the vertical value depending on the touching-changing point.
The only similar example that I found in your documentation (https://www.scichart.com/example/ios-custom-modifier/) is using SCIGestureModifier which is not accesible by the V3.
I am trying to use your SCIChartModifierBase class but cannot find anywhere a similar example of what we need.
I already tried to understand how you want us to use the ” override func onEvent(_ args: SCIModifierEventArgs!) ” function of the
SCIChartModifierBase but still no luck, it is impossible to figure out without any kind of a similar example.
The reason of needing an example is that this task needs much more information like these:
1. How to decide if the modifier should handle the touch event and how it should be ignored or handled by the next modifier in the same group ?
2. How to handle the touch started, changed, cancelled events ?
3. How to say in realtime to other modifiers in the same group that we need to to handle the same event simultaneously with this custom modifier ?
4. How to say to the group of modifiers that after the first modifer is taken the touch event then the rest should not use it ?

I will paste here our current implementation that we have done for V2 and needs to be transformed to V3 in case you need more details.

An important part is how we add the modifiers on the chart and this is how we are doing it right now:
let zoom = SCIPinchZoomModifier()
zoom.direction = .xDirection
let group = SCIChartModifierCollection(collection: [CustomModifier(chart: self),
PanModifier(),
zoom])
//group.handleGestureFirstOnly = true // Not existing in V3 anymore ! How should we do it in V3 ?
chart.chartModifiers = group

I believe that this code will be really useful for many people out there even for V2 or for migrating to V3.

Swift iOs code using SCICharts V2:

class Modifier: SCIGestureModifier {
private weak var control: ChartView?
private var editingProperty: ChartView.BindableProperty?
private var calculator: SCICoordinateCalculatorProtocol?

    init(chart: ChartView?) {
        self.control = chart
    }

    override func onPanGesture(_ gesture: UIPanGestureRecognizer?, at view: UIView?) -> Bool {

        guard let chart = view as? SCIChartSurface,
            let gesture_ = gesture
            else { return super.onPanGesture(gesture, at: view) }

        let location = gesture_.location(in: chart)
        switch gesture_.state {
        case .began:
            control?.sendActions(for: .touchDown)
            editingProperty = testForDraggableLine(location: location, in: chart)
            calculator = yAxis().getCurrentCoordinateCalculator()
            if editingProperty != nil {
                // Annotations on SciChart don't have Zindex and we want current line to be on the top
                let draggableLines = control?.chart.annotations.array.compactMap { $0 as? DraggableLine }
                if let myLine = draggableLines?.first(where: { $0.bindingKeyValue == editingProperty }) {
                    control?.chart.annotations.remove(myLine)
                    control?.chart.annotations.add(myLine)
                }
                control?.isTouchingLine(isTouching: editingProperty != nil)
            }
            return editingProperty != nil
        case .changed:
            if editingProperty != nil {
                handleDraggingLines(location: location, in: chart)
                return true
            }
        case UIGestureRecognizer.State.ended:
            if editingProperty != nil {
                control?.sendActions(for: .editingDidEnd)
                editingProperty = nil
                _ = control?.adjustYRange(force: true)
                control?.sendActions(for: .valueChanged)
                control?.refreshPositions()
                control?.isNotTouchingLine()
                return true
            }
        case UIGestureRecognizer.State.cancelled:
            if editingProperty != nil {
                control?.sendActions(for: .editingDidEnd)
                editingProperty = nil
                _ = control?.adjustYRange(force: true)
                control?.sendActions(for: .valueChanged)
                control?.refreshPositions()
                control?.isNotTouchingLine()
                return true
            }
        default:
            break
        }

        return false
    }

    private func handleDraggingLines(location: CGPoint, in chart: SCIChartSurface) {
        guard let renderSurface = chart.renderSurface,
            let yCalculator = self.calculator,
            let editingProperty = editingProperty else { return }

        let pointInChart = renderSurface.point(inChartFrame: location)
        let valueForYAxis = yCalculator.getDataValue(from: Double(pointInChart.y))
        control?.setValue(Decimal(valueForYAxis), forKey: editingProperty.rawValue)
    }

    // SOS: Filter possible properties that can be returned. We want to always avoid return - and then - dragging the current price bid or ask !
    private func testForDraggableLine(location: CGPoint, in chart: SCIChartSurface) -> ChartView.BindableProperty? {
        let hitTestDistance: Double = 30 // Pixels !
        let nearItems = chart.annotations.array
            .compactMap { $0 as? DraggableLine }
            .filter { item in
                return item.bindingKeyValue != ChartView.BindableProperty.ask &&
                    item.bindingKeyValue != ChartView.BindableProperty.bid &&
                    !item.isHidden &&
                    item.yDistance(from: location) <= hitTestDistance
            }
        return nearItems
            .sorted { $0.yDistance(from: location) < $1.yDistance(from: location) }
            .first?.bindingKeyValue
    }
}
  • Dxat asked 4 years ago
  • last active 3 years ago
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
0 votes
5k views

When search this forum, I found that we can achieve it by adding point marker. But I am getting this error when trying to add point marker :
‘Operation: setPointMarker: is not avaliable on type: SCIHorizontallyStackedColumnsCollection’

let me know this feature(round top corners of bars) is availble or not ! Or is there any way to do this ?

0 votes
4k views

If we set ClipMode.None we can pan infinitely to the uncharted space of left and right. this is fine.
But I want to do panning infinitely only to the left side. So I set ‘clipAtMax’. This is stop panning at right. But instead of panning infinity to the left, it is stretching the left part.
Any solution ?

0 votes
4k views

Dear SCICharts support:
We have a very large project that must be migrated to version 3 because right it uses version 2.
I am stuck in the following issues:

1/ I cannot convert Double or Date to ISCIComparable.

Our x axis contains Date-timestamp values and I am trying to find the index of the dataseries.xValues of a specific Date having as parameter my Date value which is Date type and not ISCIComparable.
How can I do this ?

When I try my attempt 1:

let x: Double = <DoubleValue>
let index = dataSeries.xValues.findIndex(of: x, searchMode: .nearest, isSorted: true) 

I am getting the build error: “Cannot convert value of type ‘Date?’ to expected argument type ‘ISCIComparable?'”

When I try my attempt 2:

If I also try to iterate the xValues and find the ISCIComparable value which has doubleValue equal the x then I get the error “Type ‘ISCIList?’ does not conform to protocol ‘Sequence'”
I mean something like this:

let x: Date = Date()
var comparableValue: ISCIComparable? = nil
for val in dataSeries.xValues {
    if val.toDate() == x {
        comparableValue = val
    }
}

So any solution please ?

2/ I am trying to update the last point of dataSeries using this code:

let lastPoint = dataSeries.count - 1
if let open = dataSeries.openValues.value(at: lastPoint) {
        dataSeries.update( open: open,
                                    high: max(dataSeries.highValues().value(at: lastPoint).toDouble(), mbidPrice),
                                    low: min(dataSeries.lowValues().value(at: lastPoint).toDouble(), mbidPrice),
                                    close: mbidPrice,
                                    at: lastPoint)     }

and I get the error “Cannot convert value of type ‘ISCIComparable’ to expected argument type ‘ISCIValues?’ “
Why ? How should I do this ?

Thanks a lot in advance

  • Dxat asked 4 years ago
  • last active 4 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
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
6k 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.

0 votes
5k views

We need to generate adhoc ipa file for review purpose and we are using the trial version, but its fails. Can you help us on the same?

0 votes
4k views

How can we restrict stacked graph chart scrolling to future date ?

1 vote
4k views

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

0 votes
4k views

I’ve received this crash report for a long time since I use this SDK.
But now it’s the largest amount of crash report in the newest version.
Do you have any idea about this?
I use the SDK to show meter temperature and humidity data. It’s about 10k to 30k data show in the chart and every time the user has download the data or the user zoom, drag the chart will recalculate the min, max, avg number in the visible time range.
Thank you~

  • Switch Bot asked 4 years ago
  • last active 4 years ago
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
5k views

Hi,

I am using SciChart_iOS_SDK_3.0.0.5074 with Swift 5.

I want to show string type on X-axis. I am using below code snippet.

class YearsLabelProvider: SCILabelProviderBase<SCINumericAxis> {

   var xLabels: [String] = ["Test", "Test", "Test", "Test", "Test", "Test", "Test", "Test",     "Test", "Test", "Test", "Test", "Test", "Test"]

   func update(_ axis: ISCIAxisCore!) { }

   override func formatLabel(_ dataValue: ISCIComparable!) -> ISCIString! {
        let index = Int(dataValue.toDouble())
        return NSString(string: index >= 0 && index < xLabels.count ? xLabels[index] : "")
    }

    override func formatCursorLabel(_ dataValue: ISCIComparable!) -> ISCIString! {
        let index = Int(dataValue.toDouble())

        var result: String?

        if (index >= 0 && index < xLabels.count) {
            result = xLabels[index]
        }
        return NSString(string: result!)
    }
}

Application crashes while loading with the following error –

” *** Terminating app due to uncaught exception ‘Initializer not allowed Exception’, reason: ‘Parameterless initializer of Chart.YearsLabelProvider class shouldn’t be used. Please use one of the designated initializers instead'”

Kindly help us resolving this issue since this is a showstopper issue.
I would also like to know about what data SCIXyDataSeries accepts when we are working with strings.

0 votes
0 answers
8k views

Hi,

i want to disable the pan effect when user long press on chart and allow the user to scroll only in the currently visible range to view the rollover tooltip so that user can see the reading in the current visible range. Once the long press is release, then enable the pan effect again.

Currently when user try to see the reading using rollover tooltip, the whole chart is moving. I have tried removing and adding the zoompanmodifier on long press gesture in ios. But it is not working.

Thank you in advance.

-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.

0 votes
5k views

I’m getting the following crash:

2020-02-14 16:45:43.902812-0500 CommonStock Development[2425:710225] -[SCIRolloverModifier onTouchesCancelled:]: unrecognized selector sent to instance 0x282ffe080
2020-02-14 16:45:43.904098-0500 CommonStock Development[2425:710225] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[SCIRolloverModifier onTouchesCancelled:]: unrecognized selector sent to instance 0x282ffe080’

whenever I try to scrub my chart, I must also note that in order for the legend to show, I have to tap really hard on the surface.

This is my code:

func set(data set: SimpleChartDataSet, alternate: SimpleChartDataSet) {

    let lineDataSeries = SCIXyDataSeries(xType: .double, yType: .double)
    let dashedDataSeries = SCIXyDataSeries(xType: .double, yType: .double)

    let group = DispatchGroup()
    group.enter()

    DispatchQueue.global(qos: .userInteractive).async {
        for (index, i) in set.enumerated() {
            lineDataSeries.append(x: Double(index), y: Double(i))
        }

        for (index, i) in alternate.enumerated() {
            dashedDataSeries.append(x: Double(index), y: Double(i))
        }

        group.leave()
    }

    group.notify(queue: .main) {

        let lineSeries = SCIFastMountainRenderableSeries()
        lineSeries.zeroLineY = set.min() ?? 0.0
        lineSeries.dataSeries = lineDataSeries
        lineSeries.strokeStyle = SCISolidPenStyle(color: UIColor.green, thickness: 2.0)
        lineSeries.areaStyle =  SCILinearGradientBrushStyle(start: CGPoint(x: 0, y: 1), end: CGPoint(x: 0, y: 0), start: UIColor.green, end: UIColor.clear)

        let dashedSeries = SCIFastLineRenderableSeries()
        dashedSeries.zeroLineY = set.min() ?? 0.0
        dashedSeries.dataSeries = dashedDataSeries
        dashedSeries.strokeStyle = SCISolidPenStyle(color: UIColor.white, thickness: 2.0, strokeDashArray: [2.0,2.0,2.0,2.0])

        SCIUpdateSuspender.usingWith(self.surface) {

            self.surface.xAxes.clear()
            self.surface.yAxes.clear()
            self.surface.renderableSeries.clear()

            let xAxis = SCINumericAxis()
            xAxis.drawLabels = false
            xAxis.drawMajorBands = false
            xAxis.drawMajorGridLines = false
            xAxis.drawMinorGridLines = false
            xAxis.drawMinorTicks = false
            xAxis.drawMajorTicks = false
            xAxis.drawLabels = false

            let yAxis = SCINumericAxis()
            yAxis.drawLabels = false
            yAxis.drawMajorBands = false
            yAxis.drawMajorGridLines = false
            yAxis.drawMinorGridLines = false
            yAxis.drawMinorTicks = false
            yAxis.drawMajorTicks = false
            yAxis.drawLabels = false

            self.surface.xAxes.add(items: xAxis)
            self.surface.yAxes.add(items: yAxis)
            self.surface.renderableSeries.add(items: lineSeries, dashedSeries )
            self.surface.chartModifiers.add(SCIRolloverModifier())
        }
    }
}
0 votes
8k views

I was testing my charts on a simulator and when I naved away and then back to the chart screen the Simulator’s chart was totally black screen; I could move the mouse over the points and the popouts would occur; and your license notice showed in the center of the chart. So it was almost like it thought all the drawing for the chart itself needed to be black on black.

It was always broken on the 2nd or later chart. Restarting the app fixed it. I tried removing all custom settings, and calling the invalidate; and nothing caused it to redraw correctly… Fortunately, when deploying to real devices everything worked correctly. Is this an expected side effect of testing on a simulator, or is their something that I can do to force a hard refresh of the chart…

FYI: The additional debug diagnostics don’t seem to do anything on a simulator, or at least I couldn’t find anywhere it was logged.

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
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

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….

0 votes
4k views

I don’t know if this affects any earlier versions; but the version my app is using is the 5098.

I created a surface with the following modifiers:
– SCIZoomPanModifier
– SCIZoomExtentsModifier
– SCIPinchZoomModifier

On the SCIZoomExtentsModifier I have **SCIDirection2D_XyDirection ** (also tried YDirection alone)
And when you double tap on the display; only the X direction resizes back down to the proper size. The Y direction is 100% ignored.

Seems to have to do with using a SCILogarithmicNumericAxis on the Y axis. I have tried commenting out all settings applied to the SCILogarithmicNumericAxis; and no change in the ability to re-zoom back to normal size. If I use a SCINumericAxis instead; the Y zooms back out properly…

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
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
0 votes
8k views

I’m using Xamarin.iOS and the SciChart.iOS NuGet. When adding a LabelProvider to an axis the iPhoneSimulator with iOS 13.2 crashes without warning or exception back to the phone menu. This issue is not present on Android using the same API usage pattern.

This effect is not just in my own apps but can be replicated by running the latest Examples app on the same simulator. Examples which demonstrate the same behaviour include “Custom Theme”, Stacked Column Side by Side Chart”, “Using Theme Manager”, all of which set the LabelProvider in the source code.

Is this a known bug? Maybe an incompatibility with the latest version of Xamarin.iOS.

I noticed that this issue has been reported before.

This is a deal breaker for us at the moment as formatting axis labels is pretty crucial.

0 votes
8k views

When calling SCIThemeManager.ApplyTheme(Surface, SCIThemeManager.SCIChart_Bright_SparkStyleKey); within a the code-behind running on the iPhoneSimulator running iOS 13.2, the iOS system throws an Objective-C exception with the following details:

Foundation.MonoTouchException: 'Objective-C exception thrown.  Name: NSInternalInconsistencyException Reason: applyThemeProvider: must be implemented in subclass

Although the exact same pattern works without issue on the corresponding Xamarin.Android project and the examples that call this line seem to be OK too, it is not clear from any documentation what this issue could be. Any advice would be appreciated.

0 votes
4k views

Hi,

I wanted to try the V3 beta for iOS in objective-c but I don’t know how to format the string with the new license key.

Neither this (as found here: https://www.scichart.com/beta-edition-of-scichart-mobile-sdk-v3-now-available/):

[SCIChartSurface setRuntimeLicenseKey:@""
 "{"
   "\"ActivatedBy\": null,"
   "\"Customer\": \"Anyone\","
   "\"DeveloperCount\": null,"
   "\"ExpiryDate\": \"2019-12-21\","
   "\"Features\": ["
     "\"WPF-2D\","
     "\"AND-2D\","
     "\"iOS-2D\","
     "\"WPF-3D\","
     "\"AND-3D\","
     "\"iOS-3D\""
   "],"
   "\"IsTrialLicense\": true,"
   "\"KeyCode\":" "gRPFuMCiB0otJzffhGFJO09BtH3drfoDZV5pAkQNv9hyHJsfBsCr42BHRJ/oz2ib2uEgT33IYW3fGKExB4KPUbrNOeKazYrMI8pD5OJVlDoRXuJdY97iUZU2jNHRnXN0cgpBdqcQTWgW/afd9pYwcYT5P22sklCSrtTdwcuyepiLE9Ap9B2ixMVpoB43Yj79g1/yKzgPQaAmW38hjDyByQwxCQ9R88Jt4JqQRVQUhYxj31CFoX7Upm36oP32WGbEEex4E1qHTY+KALouRnA9JQZej13V4MjwF45xuQNiUDbk3RHtyJwWEjwGS9jHh24WiTj1aOaw8PAfBmKZl2FKfKSL7Q7Nu9jtUgZdGUbpZTKYrASpoVQiVk2/+1xAA8dB/7RdsjXVVrXf1RnMg8dNXsY7gcJJ25SF4QmZwqa82Dl+PnXGq0BSvfLaSrSl8uWkimTt0D/FwvaVqvpzomORpStboVNroTAcbaBJRIOK6tZDFwBj3qQV1N470/XW3aKHckN7GrNOpS7xpZ/EM9k=,"
   "\"MachineId\": null,"
   "\"OrderId\": \"BETA trial key\","
   "\"ProductCode\": \"SC-BUNDLE-SDK-PRO\","
   "\"SerialKey\": null,"
   "\"TicketQuantity\": null"
 "}"
 ""];

or this (old format style):

  [SCIChartSurface setRuntimeLicenseKey:@""
   "<LicenseContract>"
   "<Customer>Anyone</Customer>"
   "<OrderId>BETA trial key</OrderId>"
   "<LicenseCount>1</LicenseCount>"
   "<IsTrialLicense>true</IsTrialLicense>"
   "<SupportExpires>2019-12-21</SupportExpires>"
   "<ProductCode>SC-BUNDLE-SDK-PRO</ProductCode>"
 "<DeveloperCount>null</DeveloperCount>"
 "<MachineID>null</MachineID>"
 "<SerialKey>null</SerialKey>"
"TicketQuantity>null</TicketQuantity>"
"<Features>[WPF-2D, AND-2D, iOS-2D, WPF-3D, AND-3D, iOS-3D]</Features>" "<KeyCode>gRPFuMCiB0otJzffhGFJO09BtH3drfoDZV5pAkQNv9hyHJsfBsCr42BHRJ/oz2ib2uEgT33IYW3fGKExB4KPUbrNOeKazYrMI8pD5OJVlDoRXuJdY97iUZU2jNHRnXN0cgpBdqcQTWgW/afd9pYwcYT5P22sklCSrtTdwcuyepiLE9Ap9B2ixMVpoB43Yj79g1/yKzgPQaAmW38hjDyByQwxCQ9R88Jt4JqQRVQUhYxj31CFoX7Upm36oP32WGbEEex4E1qHTY+KALouRnA9JQZej13V4MjwF45xuQNiUDbk3RHtyJwWEjwGS9jHh24WiTj1aOaw8PAfBmKZl2FKfKSL7Q7Nu9jtUgZdGUbpZTKYrASpoVQiVk2/+1xAA8dB/7RdsjXVVrXf1RnMg8dNXsY7gcJJ25SF4QmZwqa82Dl+PnXGq0BSvfLaSrSl8uWkimTt0D/FwvaVqvpzomORpStboVNroTAcbaBJRIOK6tZDFwBj3qQV1N470/XW3aKHckN7GrNOpS7xpZ/EM9k=</KeyCode>"
   "</LicenseContract>"

   ];

worked.

I always get the message “Sorry! Your license token appears to be invalid. etc.”
What’s the right way?

Best regards,

Johannes

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.

0 votes
8k views

I cannot get SCILinearGradientBrushStyle working on a donut chart. Only radial gradients work

Here is my code sample:

let segment = SCIPieSegment()
segment.fillStyle = SCILinearGradientBrushStyle(colorCodeStart: 0xff007aff, finish: 0x4D007aff, direction: .horizontal)
segment.value = 100.0
segment.title = "Segment"
donutSeries.segments.add(segment)

The segment just renders a flat color

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
0 votes
4k views

i am Swift Language
let dragmodifier = SCIZoomPanModifier()
dragmodifier.clipModeY = .clipAtExtents

-OR-

How can i acheive this?

  • Atiq Tahir asked 5 years ago
  • last active 4 years ago
0 votes
4k views

Using Following Code to Construct Sync Multiple Graphs

   let _rangeSync = SCIAxisRangeSynchronization()
    let _zoomExtentsModifierSync = SCIMultiSurfaceModifier(modifierType: SCIZoomExtentsModifier.self)
    let _pinchZoomModifierSync = SCIMultiSurfaceModifier(modifierType: SCIPinchZoomModifier.self)
    let _xDragModifierSync = SCIMultiSurfaceModifier(modifierType: SCIXAxisDragModifier.self)
    let _yDragModifierSync = SCIMultiSurfaceModifier(modifierType: SCIYAxisDragModifier.self)
    let _rolloverModifierSync = SCIMultiSurfaceModifier(modifierType: SCIRolloverModifier.self)

func getGraphs() -> [(String,CustomClassThatHoldsData)] {

    let keys = Array(historicChats!.data!.keys)
    var arrayOfTuples = [(String,CustomClassThatHoldsData)]()
    //
    for key in keys {
    arrayOfTuples.append((key, (self.historicChats?.data![key])!))
    }
    return arrayOfTuples
}



 func drawMultichartWithDefault() {

        for data in arrayOfGraphs {
        let chart = SCIChartSurface(frame: CGRect(x: 0, y: 0, width: self.stkCharts.frame.width-50, height: 200))
        initChart(chart, data.1)
        self.stkCharts.addArrangedSubview(chart)
        }

    }

fileprivate func initChart(_ chart: SCIChartSurface, _ data: VitalHistoryData) {
    SCIUpdateSuspender.usingWithSuspendable(chart) {
    let xAxis = SCIDateTimeAxis()
    xAxis.growBy = SCIDoubleRange(min: SCIGeneric(0.1), max: SCIGeneric(0.1))

    let yAxis = SCINumericAxis()
    yAxis.growBy = SCIDoubleRange(min: SCIGeneric(0.1), max: SCIGeneric(0.1))

    let dataSeries = SCIXyDataSeries(xType: .dateTime, yType: .double)
    let dataArray = data.getDataArray()
    for tuple in dataArray {
    dataSeries.appendX(SCIGeneric(tuple.1), y: SCIGeneric((tuple.0)))
    }

    let rSeries = SCIFastLineRenderableSeries()
    rSeries.dataSeries = dataSeries
    rSeries.strokeStyle = SCISolidPenStyle(color: UIColor.green, withThickness: 1.0)

    chart.xAxes.add(xAxis)
    chart.yAxes.add(yAxis)
    chart.renderableSeries.add(rSeries)
    chart.chartModifiers = SCIChartModifierCollection(childModifiers: [self._xDragModifierSync, self._yDragModifierSync, self._pinchZoomModifierSync, self._zoomExtentsModifierSync, self._rolloverModifierSync])

    self._rangeSync.attachAxis(xAxis)
    }
}

On 2 graphs it works quite fine but with the more then 2 graphs it starts lagging

  • Atiq Tahir asked 5 years ago
  • last active 4 years ago
0 votes
8k views

I would like to add scrollBar to SCINumericAxis for example xAxis.

I did find documentation:
https://www.scichart.com/documentation/v5.x/webframe.html#Scrollbars.html

But on iOS version, I can’t find numericAxis.Scrollbar is missing

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
0 votes
0 answers
8k views

Hello.

I have previously asked a question regarding Android and Xamarin (https://www.scichart.com/questions/android/legend-outside-of-chart-area).

Now, I have the same question, but for iOS. Do you have any examples available for taking chart legend outside of chart area on iOS?

Thank you and have a nice day!

Regards,
Paul.

0 votes
4k views

Hello,

I am trying to round the corners of the bars produced by a SCIFastImpulseRenderableSeries (pointMarker is hidden). Any suggestions how to do that?

Thanks!

0 votes
5k views

Hello,

The problem is how to sign the X-axis (the time axis).
How can I change the date and time format on the x axis?
Is this possible when I use the SCICategoryDateTimeAxis?
We use the code from example to set the time format

0 votes
7k views

How can I create CustomCategoryLabelProvider?
How can i do this?
This example does not work for me

0 votes
13k views

Hey all,

is there a way on iOS to export a SciChartSurface to a vector format in order to embed the exported chart into a PDF document? Right now the only thing I can find in the Documentation is exportToUIImage(). If not – any ideas for a workaround until such feature is implemented?

0 votes
5k views

Hello,

I am using mountain chart to draw some data. First time open the chart screen, the graph plots properly. If we do scroll forward the graph x-axis last label is missing. If we do scroll backward the graph x-axis first label is missing.

Here I have attached working .swift file.

Note: We are using mountain chart with multiple line series. We are not using stacked mountain chart.

Showing 101 - 150 of 314 results