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
3k views

Hello,

I need to modify iOS SCIChart tooltip behavior. I’ve been trying to follow the example at “https://www.scichart.com/example/ios-using-tooltip-modifier/“.

Using SCIChart 4.4.0.5778 I’ve noticed some class methods and parameters don’t match, but I’ve figured out most of them I think. However, I cannot determine the method to use that is equivalent to:
“override func internalUpdate(with seriesInfo: SCIXySeriesInfo)” when subclassing “SCIXySeriesTooltip”.

I did take look at the example code that is packed with the SDK. I got compiler errors in the tooltip code in the file “TooltipCustomizationChartView” when I included the framework bundled with the SDK.

Thank you for the assistance.

  • C Bolton asked 2 years ago
  • last active 2 years ago
0 votes
3k views

Is the styleFor function of SCIPaletteProvider that was in Version 2.0 not implemented in Version 4.8?
Also, are there any plans to implement it?

I am upgrading from SciCharts 2.0.1 to SciCharts 4.3.
When the color was set using SCI Palatt Provider in Version 2.0, the memory used was 200M, but in Version 4.3, the memory used may consume as much as 1G.
I tried to devise it by setting the Sampleing Mode, but it is not very effective.

SCI Charts is used to display the spectrum data of audio data while playing the sound.

0 votes
3k views

Good day!
I need to determine the value of the visible graph y from the x value and the problem is that I can’t calculate the y value outside of the data I’m rendering
example data:
[
{ x:1, y: 10 },
{ x:5, y: -5 },
{ x: 9, y: 15}
]

I use SCISplineMountainRenderableSeries and I need to show the intersection of the graph at point 3.5
I need a point but I have only one coordinate value

how can i get this y value?

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

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

grab the code from here:

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

0 votes
3k views

I just requested a trial key and notice that it say I have to put a license call into my app.

Does this mean my app will require internet so it can verify a license when the user starts the app?

Will it do this all the time?

I do not like this at all. I don’t want my customers asking why my app requires internet and is contacting some server when they start the app.

0 votes
2k views

Hello

Is it possible do detect taps/selection/click over Axis Titles?

Thanks!

0 votes
6k views

Hello

Is it possible do detect taps/selection/click over the PointMarkers?

Thanks!

0 votes
3k views

I am adding a SCICustomAnnotation on a particular graph bar click. But the annotation always gets added to a fixed location and is not varying according to the selection. Whereas if I am adding the annotation during the init(), it’s getting added on the correct location point.
Ex:
if let annotationValue = viewModel.categoryModel?.value, annotationValue > 0 {
let customAnnotationGreen = SCICustomAnnotation()
customAnnotationGreen.horizontalAnchorPoint = .center
let imageView = UIImageView(image: #imageLiteral(resourceName: “Triangle”))
imageView.frame = CGRect(origin: .zero, size: CGSize(width: 10, height: 10))

                    customAnnotationGreen.customView = imageView// UIImageView(image: #imageLiteral(resourceName: "Triangle"))
                    if let value = viewModel.categoryModel?.graphDataPoints.values[hitTestInfo.dataSeriesIndex].toDouble() {
                        customAnnotationGreen.set(x1: hitTestInfo.dataSeriesIndex)
                        customAnnotationGreen.set(y1: value)
                        self.columnChart.annotations.add(customAnnotationGreen)
                    }
                }
  • Anupriya V asked 2 years ago
  • last active 2 years ago
0 votes
3k views

Hello, I’ve been trying to setup an Ellispe Point Marker graph which shows a linear regression line within the graph, I’ve copied the demo code into another project and it seems to show Ellispe Point Markers, but when I try it out using another project, it doesn’t seem to show up. The issue is that the graph shows up, along with the axis and the linear regression lines, but the Ellispe point markers don’t show up.

When I run the code, the linear regression line changes from new data that is being pushed, but the Ellispe pointer markers don’t show which I’m assuming means that the data is being pushed through/into the chart, but the point markers are specially not showing up for some reason. I’m wondering if anyone can help me regarding this situation, and I’ve looked through the code several times and I can’t seem to find what is causing my point markers to not show.

Unfortunately I can’t completely share the project due to confidentiality reason within my workplace, therefore I shared some screenshots which outline the code that is being used to for the SciChart Graph.

Any help would be greatly appreciated, and if there are any more questions regarding this issue, please let me know and I’ll try my best to answer them and provide more information. Thank you.

  • Sri Amin asked 2 years ago
  • last active 2 years ago
0 votes
0 answers
3k views

Was created react-native-charts-sci wrapper for Scichart with the structure – [Screenshot _1]. And now need to publish this package to npm private repo, but Scichart.framework folder is vast (~100 MB) and its connect in current podspec file – [Screenshot_2] like a local directory:

spec.public_header_files = “ios/SciChart.frameworks/Headers/*”
spec.vendored_frameworks = “ios/SciChart.framework”

Need to connect Scichart.framework in wrapper library like subspec that it could be taken during the installation process from vendor’s podspec repo: https://github.com/ABTSoftware/PodSpecs/tree/master/SciChart. The goal is to decrease of wrapper library folder size that would be possible to publish it to npm repo.

After adding Scichart.framework like subspec – [Screenshot_4] to podspec, get the errors after pod install – [Screenshot_3]:
– ERROR | [iOS] attributes: Can’t set version attribute for subspecs (in react-native-charts-sci/SciChart).
– ERROR | [iOS] attributes: Can’t set authors attribute for subspecs (in react-native-charts-sci/SciChart).
– ERROR | [iOS] attributes: Can’t set license attribute for subspecs (in react-native-charts-sci/SciChart).
– ERROR | [iOS] attributes: Can’t set homepage attribute for subspecs (in react-native-charts-sci/SciChart).
– ERROR | [iOS] attributes: Can’t set source attribute for subspecs (in react-native-charts-sci/SciChart).
– ERROR | [iOS] attributes: Can’t set summary attribute for subspecs (in react-native-charts-sci/SciChart).
– ERROR | [iOS] attributes: Can’t set documentation_url attribute for subspecs (in react-native-charts-sci/SciChart).

Can you tell me please is it possible to get Scichart.framework from vendor’s podspec repo: https://github.com/ABTSoftware/PodSpecs/tree/master/SciChart and connect it like a subspec in podspec file? Need to create LICENSE.txt with the licence and write the pass of it in podspec file? Can you provide some examples with the correct way to do it? Why get this errors? What’s wrong with the current framework connection?

0 votes
6k views

When i try to run the simple Example from the Documentation ( with my trial License Key ) :

class AppDelegate: NSResponder, NSApplicationDelegate {
override init(){
// Set this code once in AppDelegate or application startup
SCIChartSurface.setRuntimeLicenseKey(“XXXXXX”);
super.init()

}

i receive this error and the application builds but fails to start :

libc++abi: terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception ‘License Exception’, reason: ”
terminating with uncaught exception of type NSException

0 votes
3k views

I am planning to have a graph like in attached image. Just to have only X values and additional Label provider on it and an indication to point the value like black arrow.
Need your inputs. Thanks in advance.

0 votes
8k views

Hi,

Using the ZoomExtentsModifier on multiple axis used to work in an earlier version of SciCharts, but is broken in 4.3.0. I have two y-axes set up, left and right on my chart, with the right-hand-side just mirroring the left. When I double-tap to zoom to the x/y range of the graph, only the x range is modified. If I disable the change listener that mirrors the range change on the primary y axis, double tap works as expected, but my right hand side y-axis no longer mirrors the primary axis range. This is how I’ve set up the dual axes:

        let yAxis = SCINumericAxis()
        yAxis.axisTitle = "Acceleration (g)"
        yAxis.axisAlignment = .left
        yAxis.visibleRangeLimitMode = .minMax
        chart?.yAxes.add( yAxis )

        // Add an additional visible yAxis to the right without label
        let yAxisRight = SCINumericAxis()
        yAxisRight.axisAlignment = .right
        yAxisRight.axisId = "yAxisRight"
        chart?.yAxes.add( yAxisRight )

        // Sync values with left (primary) axis
        yAxis.visibleRangeChangeListener = { (axis, oldRange, newRange, isAnimating) in
            yAxisRight.visibleRange = newRange
        }

Commenting out the listener at the bottom fixes the ZoomExtentsModifier problem, but is obviously not a workable solution. Any help would be appreciated. Thanks

0 votes
4k views

There are no simple macOS tutorial projects, so I transplant ios “Tutorial 01 Create Simple 2D Chart” to macOS one. (Attached file.)

Build and Run successfully. But no appear the coded chart. It seems that only SCIChartSurface is being displayed. (without axis and line series)
I enabled SciChart Console Debugging and got like this.

2021-09-17 20:48:06.077950+0900 StoryboardTest[75014:920684] [INFO] - [SCIAxisBase] isSuspended = YES. Ignoring `invalidateElement:` call
2021-09-17 20:48:06.078006+0900 StoryboardTest[75014:920684] [INFO] - [SciChartSurfaceBase] IsSuspended=YES. Ignoring `invalidateElement:` call

Why doesn’t the chart show up? Would you mind giving me some advice?

P.S.
It seems that the file was not attached properly.
Please download the file from here.
https://drive.google.com/file/d/1YfJIf0G14QOxA0fzmEQXyAEbPrfMx4CU/view?usp=sharing

0 votes
3k views

Hello,

We need to add a label with the value of the yAxis on top of all Point Markers. There is an example on WPF, but found nothing on iOS.

How can we achieve that?

0 votes
3k views

I am using sci charts to show live graphs of some devices. While displaying a graph on IPhone X or iPhone 6s it sometimes lags and lines started overlapping. It’s working fine on devices iPhone XSMax, iPhone 11. I have attached a 3 screenshots. Once when graph starts lagging, 2nd when graph is in middle, 3 when graph completes. please have a look. It starts lagging and overlapping lines when a new graph starts and when it ends it shows a complete graph shown and then again same issue repeats. It also started working correctly after some time. I need information about this issue. How to fix it and why it’s happening like this…

0 votes
3k views

Hello,

I was overriding the performZoom(at mousePoint: CGPoint, xValue: Double, yValue: Double) method of SCIPinchZoomModifier but it is not accessible anymore.

My Code:

import Foundation
import SciChart

public class FixedToCenterPinchZoomModifier : SCIPinchZoomModifier {

override func performZoom(at mousePoint: CGPoint, xValue: Double, yValue: Double) {
    let middle = CGPoint(x: parentSurface?.frame.midX ?? 0,
                         y: parentSurface?.frame.midY ?? 0)
    super.performZoom(at: middle, xValue: xValue, yValue: yValue)
}

}

I get the error: Method does not override any method from its superclass

Is there a way to access the protected method?

0 votes
3k views

Just trying to run the demo using these instructions: https://github.com/abtsoftware/scichart.ios.examples.

It doesn’t work I’m getting “Failed to emit precompiled header” and “SciChart/SciChart.h file not found”

0 votes
4k views

SplineLineRenderableSeries doesn’t render curved graph line properly in Swift , it renders stepped line for the data series .For reference please check the Screenshot attached ,ECG line(Green) rendered as stepped line (Marked by rectangle). Let me know anything I need to update in my code

Please find below the code for initialisation go the graph and updating the graph same. I am updating graph realtime with same DataSeries.

  1. Graph initialisation code

    func init_ECG_Chart()
    {
    //Remove Theme From Chart By Apply & Remove & Change Border color
    SCIThemeManager.applyTheme(to: self.ecg_Chart_Surface, withThemeKey: SCIChart_Bright_SparkStyleKey)
    SCIThemeManager.removeTheme(byThemeKey: SCIChart_Bright_SparkStyleKey)

    self.ecg_Chart_Surface.isOpaque = false
    self.ecg_Chart_Surface.backgroundColor = .clear
    self.ecg_Chart_Surface.renderableSeriesAreaBorderStyle = SCISolidPenStyle(color: .clear, thickness: 0)
    
    //Line
    let lineSeries = SCISplineLineRenderableSeries()
    
    lineSeries.strokeStyle = SCISolidPenStyle(color: ecgSelectedColor, thickness: 2.0)
    lineSeries.dataSeries = ecgLineDataSeries
    

    // lineSeries.resamplingMode = SCIResamplingMode_None //Resampling off
    // lineSeries.resamplingMode = SCIResamplingMode_Auto //Resampling off

    let xAxis = SCINumericAxis()
    xAxis.axisAlignment = .bottom
    xAxis.drawLabels = false
    xAxis.drawMajorGridLines = false
    xAxis.drawMinorGridLines = false
    xAxis.drawMajorTicks = false
    xAxis.drawMinorTicks = false
    
    let yAxis = SCINumericAxis()
    yAxis.axisAlignment = .left
    yAxis.drawLabels = false
    yAxis.drawMajorGridLines = false
    yAxis.drawMinorGridLines = false
    yAxis.drawMajorTicks = false
    yAxis.drawMinorTicks = false
    yAxis.autoRange = .never   //Stop auto ranging axis
    yAxis.visibleRange = SCIDoubleRange(min: -32, max: 96)
    

    // yAxis.visibleRangeLimit = SCIDoubleRange(min: -32, max: 96)

    yAxis.growBy = SCIDoubleRange(min: 0.2, max: 0.2)
    
    SCIUpdateSuspender.usingWith(self.ecg_Chart_Surface) {
    
        self.ecg_Chart_Surface.xAxes.add(items: xAxis)
        self.ecg_Chart_Surface.yAxes.add(items: yAxis)
        self.ecg_Chart_Surface.renderableSeries.add(items: lineSeries)
    
        //self.ecg_Chart_Surface.chartModifiers.add(items: SCIZoomExtentsModifier(),SCIPinchZoomModifier())
    }
    

    } //Init ECG

  2. Graph updation code

    func update_ECG_Chart(xValues:SCIDoubleValues,yValues:SCIDoubleValues)
    {

    SCIUpdateSuspender.usingWith(self.ecg_Chart_Surface) {
    
        self.ecgLineDataSeries.append(x: xValues, y: yValues)
      //  self.ecg_Chart_Surface.zoomExtents()
    
        self.ecg_Chart_Surface.zoomExtentsX()
    
    }
    

    } //Update ECG

0 votes
3k views

We’re using Xamarin.Forms. We were using iOS build 5019 and Android build 4441 and we had a custom DatelabelProvider set on our X axis in both platforms which worked fine.

However after updating to latest builds (5022 and 4459), the provider’s FormatLabel (FormatLabelFormatted on Android) isn’t being called and the default label formatting is applied.

0 votes
3k views

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

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

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

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

        var Spectvalues = SCIDoubleValues(capacity: 100)

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

Hi everyone!

I have a candlestick chart that uses SCIZoomPanModifier() so i can zoom and pan in the chart. I added a SCITooltipModifier() so i can inspect the individual data points. I noticed that by adding the toolTipModifier, that my pan and zoom stops working. I can’t figure out why. Would really appreciate if someone could tell me why or if i am missing some variable i need to set

0 votes
3k views

Hi guys,

I just started using SCICHART. I am working my way through the provided tutorials and i noticed that when i add a SCITooltipModifier to the chart, all my other modifiers (zoom and pan and pinchzoom) stopped working. Is this normal? Because i want my chart to have zoom functions and show what datapoints are touched by a user.

Thanks in advance!

1 vote
3k views

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

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

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

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

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

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

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

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

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

What’s your recommended workaround?

0 votes
3k views

Hi,

We have an issue where the graph grid lines and tick markers do not show on iOS 10. Everything works on iOS 11 and up. Any idea why this is happening?

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
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()
            }
0 votes
7k views

Good day guys. I have download SciChart_iOS_SDK_4.2.0.5533 on Macbook M1. And try to integrate ios-arm64_armv7 verions to my project. I have added SciChart.xcframework to frameworks in Xcode 12.4. But the build is failed with a few errors:

  1. unable to load standard library for target arm-64-apple-ios9.0
  2. Failed to build module ‘SciChart’ from its module interface, it may have been damaged or it may have triggered a bug in Swift compiler when it was produced.

Can you tell me please did I use the right version of SciChart.xcframework for apple silicone? And how to solve this errors?

0 votes
5k views

Guys can you tell me please why I get this error after build on new `mac M1 chip and how to solve it:

error: unable to load standard library for target ‘arm64-apple-ios8.0’
/Users/nameuser/Projects/pojectname/ios/SciChart.framework/Modules/SciChart.swiftmodule/arm64.swiftinterface:1:1: error: failed to build module ‘SciChart’ from its module interface; the compiler that produced it, ‘Apple Swift version 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15)’, may have used features that aren’t supported by this compiler, ‘Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28)’
// swift-interface-format-version: 1.0`

0 votes
3k views

Good day! I have download this zip archive SciChart_iOS_SDK_4.2.0.5533.zip, on my laptop. Opened it and can not find the file SciChart.xcframework, according description from this article. I need to add library to Xcode frameworks, but I can not do it. Please can you tell me where can I get this file.

0 votes
3k views

Please tell me how to add the ability to use multiple touch. The goal is that when the user touches the screen in two places at the same time, two lines appear on the graph. I would like to understand whether this is possible?

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
12k views

Hi there,

I’m trying to display little icons as axis labels using the LabelProvider API and NSAttributedString (with NSTextAttachmet). Is this supported? Here’s a minimal example:

import UIKit
import Foundation
import SciChart
import SciChart.Protected.SCILabelProviderBase

class ViewController: UIViewController {

    private lazy var chart: SCIChartSurface = {
        let c = SCIChartSurface(frame: .zero)
        c.xAxes.add(items: SCINumericAxis())

        let yAxis = SCINumericAxis()
        yAxis.labelProvider = SymbolLabelProvider()
        c.yAxes.add(items: yAxis)
        return c
    }()

    override func viewDidLoad() {
        super.viewDidLoad()

        SCIChartSurface.setRuntimeLicenseKey(myLicenseKey)

        view.addSubview(chart)
        chart.translatesAutoresizingMaskIntoConstraints = false
        let guide = self.view.safeAreaLayoutGuide
        NSLayoutConstraint.activate([
            chart.leadingAnchor.constraint(equalTo: guide.leadingAnchor),
            chart.trailingAnchor.constraint(equalTo: guide.trailingAnchor),
            chart.topAnchor.constraint(equalTo: guide.topAnchor),
            chart.bottomAnchor.constraint(equalTo: guide.bottomAnchor),
        ])
    }
}

class SymbolLabelProvider: SCILabelProviderBase<SCINumericAxis> {

    lazy var numberFormatter: NumberFormatter = {
        let f = NumberFormatter()
        f.allowsFloats = true
        f.maximumFractionDigits = 2
        return f
    }()

    init() {
        super.init(axisType: ISCINumericAxis.self)
    }

    override func formatLabel(_ dataValue: ISCIComparable!) -> ISCIString! {

        let intValue = Int(dataValue.toDouble())
        let font = UIFont.init(descriptor: axis.tickLabelStyle.fontDescriptor, size: UIFont.systemFontSize * 4)

        if intValue.isMultiple(of: 2) {
            let i = UIImage(systemName: "circle", withConfiguration: UIImage.SymbolConfiguration(font: font))
            return NSAttributedString(attachment: NSTextAttachment(image: i!))
        } else {
            let attributes: [NSAttributedString.Key: Any] = [
                .font: font,
                .foregroundColor: UIColor.yellow,
            ]
            return NSAttributedString(string: numberFormatter.string(for: dataValue.toDouble())!, attributes: attributes)
        }
    }
}

See attached screenshot for the result.

If this is not supported: any suggestions / ideas for a workaround?

Thanks
—Matthias

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

Hi, I want to set yaxis labels outside the chart but unable to find any solution please help.

0 votes
3k views

Hi guys,

I want to show x value on chart bar itself as shown in the attached image along with this query. I tried using annotation where I need to give x and y value each time and it look not appropriate in the 2 data series column chart using, instead of that I need easy way to represent label of bar value on graph bar.

please suggest if any.

Thanks in advance.

  • ananya rai asked 3 years ago
  • last active 3 years ago
0 votes
3k views

Hey everyone, my team currently has Scicharts for WPF set up and functioning the way we want it too.

We are moving to Xamarin and have tested Scicharts in a Xamarin.Forms project working for Android/iOS and Windows WPF.
The next step was to install Visual Studios for Mac, and setup a new Xamarin.Forms project and pull the code from the windows version of our Xamarin.Forms project. For windows we use a custom renderer to get the scicharts to work for all platforms available on the windows version. For Mac, we are trying to get a custom renderer set up to load the swift version of the Scicharts for Mac. It’s not going so well.

Can anyone provide details on if it’s possible to get a xaramarin.forms project to load the scicharts for mac framework?

Thanks

NOTE** I picked iOS because for some reason MacOS wasn’t in the list of platforms

0 votes
3k views

I’m updating some code that was written against SciChart iOS v2. We have one graph in that code that relied on removeFromLegend in a renderable series, to prevent the legend from getting ridiculous long.

As an example, suppose we have Western Earth, Western Wind, Western Fire, Eastern Earth, Eastern Wind, and Eastern Fire. Each element is styled the same, no matter where it’s located. In the legend, we only want to see Earth, Wind, and Fire. Our actual list of series is much longer…4 “elements”, up to 8 locations, making 32 legend entries, with 28 duplicates.

What’s the replacement for removeFromLegend? How do I prevent these duplications?

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?

0 votes
3k views

I had recently integrated SciChart into my app, and faced some problems with chat appearance on trial mode which are described here: https://www.scichart.com/questions/ios/issue-with-scichart-on-ios-simulator
Due to this problems I tried to run my app on an actual device, and got this build error from Xcode:

”’
ld: building for iOS, but linking in dylib file (/Users/ruslansabirov/Library/Developer/Xcode/DerivedData/exinity-aupulhpegzsnlfcrnqfiwnvnljpj/Build/Products/Debug-iphoneos/SciChart.framework/SciChart) built for iOS Simulator, file ‘/Users/ruslansabirov/Library/Developer/Xcode/DerivedData/exinity-aupulhpegzsnlfcrnqfiwnvnljpj/Build/Products/Debug-iphoneos/SciChart.framework/SciChart’ for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
”’
How can I fix this problem?

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.

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
4k 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
3k views

While moving the rollover cursor, if the number of series under the cursor increases, the rollover cursor labels become wrongly positioned. This ViewController subclass Swift example reproduces the problem.

import UIKit
import SciChart


class ViewController: UIViewController {
    // Surface is added in Storyboard
    @IBOutlet weak var surface: SCIChartSurface!
    override func viewDidLoad() {
        super.viewDidLoad()

        let xAxis = SCINumericAxis()
        let yAxis = SCINumericAxis()
        xAxis.visibleRange = SCIDoubleRange(min: 0, max: 260)
        yAxis.visibleRange = SCIDoubleRange(min: -5, max:12)
        yAxis.autoRange = .never

        self.surface.chartModifiers.add(items: SCIRolloverModifier())
        self.surface.xAxes.add(xAxis)
        self.surface.yAxes.add(yAxis)
        self.surface.renderableSeries.add(items:
            renderableSeries( 10...50, 10, .red),
            renderableSeries(150...250, 8, .green),
            renderableSeries( 10...100, 2, .cyan),
            renderableSeries(200...250, 0, .orange),
            renderableSeries( 10...250, 5, .white)
        )
    }
    func renderableSeries(_ xValues:ClosedRange<Int>, _ yValue:Double, _ color:UIColor) -> SCIFastLineRenderableSeries {
        let series = SCIXyDataSeries(xType: .double, yType: .double)
        xValues.forEach { series.append(x: $0, y: yValue ) }
        let rSeries = SCIFastLineRenderableSeries()
        rSeries.dataSeries = series
        rSeries.strokeStyle = SCISolidPenStyle(color: color, thickness: 4)
        return rSeries
    }
}
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.

1 vote
4k views

Hi,

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

Thanks.

0 votes
3k views

Hi,

I’m trying to convert Java code to swift and I need the AnnotationLabel’s setAxisLabelStyle equivalent.

AnnotationLabel annotationLabel = new AnnotationLabel(getContext());
annotationLabel.setLabelPlacement(LabelPlacement.Axis);

            annotationLabel.setAxisLabelStyle(new Action1<AnnotationLabel>()
            {
                @Override
                public void execute(AnnotationLabel annotationLabel)
                {
                    annotationLabel.setFontStyle(new FontStyle(37.0f, Color.BLUE));
                    annotationLabel.setBackgroundResource(R.drawable.current_price);
                }
            });

How can i apply this code in swift?

0 votes
4k views

Hi,

I’m trying to convert Java code to swift and I need the same CustomCategoryDateAxis class as Yura’s answer: https://www.scichart.com/questions/android/setvisiblerangelimitmode-on-xaxis

I try to inherit from SCICategoryDateAxis but there is no isZoomConstrainSatisfied and coerceVisibleRange overrides.

How can i write the same code in swift?

Tnx.

0 votes
4k views

Hello,
I’m trying to convert Android (Java) code to iOS (Swift), and I need to create a custom SCIZoomPanModifier. In the android code, onFling, onDown, and onDown were overridden, but I can’t seem to do that in iOS. How can I override onFling, onDown, and onUp in iOS to mimic the android code?

Thanks

Showing 51 - 100 of 312 results

Try SciChart Today

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

Start TrialCase Studies