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
8k 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
6k views

Hello,

I would like to be able to change the rollover tooltip cursor color. It seems to be defaulted to the lineseries areastyle property color. I would like to be able to change it to a different color. I have not been able to find anything in the docs regarding how to do this.

Thank you

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

Hi, guys

I have some data series like:

[[SCIXyDataSeries alloc] initWithXType:SCIDataType_DateTime
                                 YType:SCIDataType_Double
                             SeriesType:SCITypeOfDataSeries_XCategory];

Also my Y axis is kind of class SCINumericAxis

So my question is

if i’m trying add value to the series

[volumeSerie appendX:SCIGeneric(bar.time) Y:SCIGeneric([bar.volume doubleValue])];

and my bar.volume is bigger than 2 147 483 648 (float limit as i’m know). It’s leads to a axis range crash. Like on the attached image.

So what should i use to handle huge values?
Like a billions and more

Best regards,
Sushynski Andrei

0 votes
7k views

https://www.scichart.com/documentation/ios/v2.x/Tutorial%2002%20-%20Creating%20a%20SciChartSurface.html

Can someone please point me to where I can complete this tutorial.

Why end this tutorial like this??

// That’s it! The SCIChartSurface will now display on the screen with default axis ranges

As is, it simply displays the x and y values. Nothing else.

How can I add my x and y values so that I can display my graph

0 votes
8k views

Is there a way to provide custom text for the labels in a PieChartSegment? I want to format the text, but haven’t been able to find a label formatter for the pie charts.

0 votes
7k views

I want to develop a rollover in my IOS application, like the example of Using RolloverModifier. However, the axis label & tooltip display of rollover in this example is static, I want to customize a the the label & tooltip that I want, .xib file or coding to develop also fine.

Can anyone help or give suggestions to my problems? Thanks.

  • Gumbo F asked 5 years ago
  • last active 2 years ago
0 votes
4k views

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

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

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

Hi, guys

What is the minimum required sdk version for SciChart v.2?

Such as i have some trouble with IOS 9. See attachment.

Same behavior at real devices.

Can you look at this?

Best regards,
Sushynski Andrei

0 votes
6k views

I’ve downloaded yesterday showcase example from your github: https://github.com/ABTSoftware/SciChart.iOS.Examples

After providing license key other samples work ok except Audio Analyzer (and the last sales dashboard – shows blank screen).

Problems is somewhere with SpectrogramSurfaceController ( If I commend it out wave plot and fft plot works)

Xcode shows there is some bad memory access at:
[SCIFastUniformHeatMapRenderableSeries internalDrawWithContext:WithData:]
cblas_sscal

Tested using:
iPhone 5SE
iOS 11.2.5
Xcode 9.2

0 votes
5k views

Hello, I’m trailing your library right now. I would like to be able to move the graph around as well as a cursor on the graph. So I enabled both SCIZoomPanModifier and SCICursorModifier. But since both use one finger panning, the result wasn’t that good. Do you have any guidance for solving the conflict and letting them working together? I’m thinking to do it in the following way: if the touch location is within certain pixel range of the cursor, panning action will move the cursor, otherwise it moves the graph. Is it possible? Thanks

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

I am using SciChart to create mountain chart. Now I want to change whole dataset when some button is clicked. So I am updating the dataset and calling invalidateElement on ScichartSurface. It is not animating while redrawing itself. First time it is animating.

@objc func changeDataValue() {
    if isFirstDataSet {
        for i in 0 ..< yValues3.count {
        ds1.update(at: Int32(i), x: SCIGeneric(i), y: SCIGeneric(yValues3[i]))
        ds2.update(at: Int32(i), x: SCIGeneric(i), y: SCIGeneric(yValues4[i]))
        }
    } else {
        for i in 0 ..< yValues1.count {
            ds1.update(at: Int32(i), x: SCIGeneric(i), y: SCIGeneric(yValues1[i]))
            ds2.update(at: Int32(i), x: SCIGeneric(i), y: SCIGeneric(yValues2[i]))
        }
    }
    isFirstDataSet = !isFirstDataSet
    sciChartSurface.invalidateElement()

    sciChartSurface.zoomExtents()

}

Code to add ScichartSurface is

  private func configureChartSurface() {
    sciChartSurface = SCIChartSurface(frame: view.bounds)
    sciChartSurface.autoresizingMask = [.flexibleWidth, .flexibleHeight]
    sciChartSurface.translatesAutoresizingMaskIntoConstraints = true
    view.addSubview(sciChartSurface)

    for i in 0..<yValues1.count {
        ds1.appendX(SCIGeneric(i), y: SCIGeneric(yValues1[i]))
        ds2.appendX(SCIGeneric(i), y: SCIGeneric(yValues2[i]))
    }

    let rSeries1 = SCIStackedMountainRenderableSeries()
    rSeries1.dataSeries = ds1
    rSeries1.strokeStyle = SCISolidPenStyle(colorCode: 0xFFffffff, withThickness: 1)
    rSeries1.areaStyle = SCILinearGradientBrushStyle(colorCodeStart: 0xDDDBE0E1, finish: 0x88B6C1C3, direction: .vertical)

    let rSeries2 = SCIStackedMountainRenderableSeries()
    rSeries2.dataSeries = ds2
    rSeries2.strokeStyle = SCISolidPenStyle(colorCode: 0xFFffffff, withThickness: 1)
    rSeries2.areaStyle = SCILinearGradientBrushStyle(colorCodeStart: 0xDDACBCCA, finish: 0x88439AAF, direction: .vertical)

    seriesCollection.add(rSeries1)
    seriesCollection.add(rSeries2)
    self.sciChartSurface.xAxes.add(SCINumericAxis())
    self.sciChartSurface.yAxes.add(SCINumericAxis())
    self.sciChartSurface.renderableSeries.add(self.seriesCollection)
    self.sciChartSurface.chartModifiers = SCIChartModifierCollection(childModifiers: [SCITooltipModifier()])
     self.seriesCollection.addAnimation(SCIWaveRenderableSeriesAnimation(duration: 3, curveAnimation: .easeOut))
    }
  • Keshav Raj asked 5 years ago
  • last active 5 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

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

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

Hi, guys

I’m working with SCIDateTimeAxis type of the X-axis. So my question Is there possibility of skipping non-value period?

Best regards,
Sushynski Andrei

0 votes
0 answers
7k views

Working on building a candlestick chart in Swift. I have a working chart following the example. I get zoom and pan fine. But am getting an error when I swipe left on the chart. Can’t quite figure out what I’m missing. Seems like my data is unsorted but I don’t see any documentation on how it should be sorted and glad to send the repo if you like…
Thanks much – Warren

2017-09-14 14:31:39.426976-0700 GoogleStockAPI[7040:2331198] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Unsorted data occurs in the collection. The only allowed SearchMode is SCIArraySearchMode_Exact'

*** First throw call stack:
(0x18a2c6fe0 0x188d28538 0x1013c9644 0x101422af0 0x1013fbdb0 0x101421b28 0x1013fb7c8 0x101398be8 0x101399084 0x10142dd04 0x1013effd0 0x1013a22dc 0x10140a47c 0x101419f04 0x1023f44fc 0x18d4d95dc 0x18d4d948c 0x18a533b9c 0x18a25d960 0x18a275ae4 0x18a275284 0x18a272d98 0x18a1a2da4 0x18bc0d074 0x19045dc9c 0x1000ceb1c 0x1891b159c)
libc++abi.dylib: terminating with uncaught exception of type NSException

I am getting my data for this chart from a live API and after I parse the JSON I populate it with this as
Date, Double, Double, Double, Double, and it looks like this –

Date OHLC: 2017-04-27 07:00:00 +0000 143.9225 144.16 143.31 143.79
Date OHLC: 2017-04-26 07:00:00 +0000 144.47 144.6 143.3762 143.68

Here is the function to render the series

fileprivate func getCandleRenderSeries(_ isReverse: Bool,
                                       upBodyBrush: SCISolidBrushStyle,
                                       upWickPen: SCISolidPenStyle,
                                       downBodyBrush: SCISolidBrushStyle,
                                       downWickPen: SCISolidPenStyle,
                                       count: Int) -> SCIFastCandlestickRenderableSeries {

    let ohlcDataSeries = SCIOhlcDataSeries(xType: .dateTime, yType: .double)

    ohlcDataSeries.acceptUnsortedData = true

    let items = self.dataFeed.lastPrice

    let dateFormatter = DateFormatter()

    dateFormatter.dateFormat = "yyyy-MM-dd"

    for i in 0..<(items.count) - 1 {

        let date:Date = dateFormatter.date(from: items[i].date!)!

        ohlcDataSeries.appendX(SCIGeneric(date),
                               open: SCIGeneric(items[i].open!),
                               high: SCIGeneric(items[i].high!),
                               low: SCIGeneric(items[i].low!),
                               close: SCIGeneric(items[i].close!))
    }

    let candleRendereSeries = SCIFastCandlestickRenderableSeries()
    candleRendereSeries.dataSeries = ohlcDataSeries
    candleRendereSeries.fillUpBrushStyle = upBodyBrush
    candleRendereSeries.fillDownBrushStyle = downBodyBrush
    candleRendereSeries.strokeUpStyle = upWickPen
    candleRendereSeries.strokeDownStyle = downWickPen

    return candleRendereSeries
}
0 votes
10k views

Hi

I am developing a Xamarin iOS application and I’m using a SCIPieChartSurface. I can create the chart and set its values, but is is not possible to auto-update the donut with new data.
I am trying to update the value by doing:

myDonut.MyPieSegment.Value = newValue;

But nothing happends…

I heard it was a bug in the API for Android a month ago, is this similar? Or am I doing something wrong?
Thanks in advance!

Best regards
Jonas

0 votes
0 answers
8k views

I have a simple chart using a an SCIDateTimeAxis to display dates along the x-axis. In some situations, the labels displayed along this x-axis are way too close together. Please see attached screenshot. I was wondering whether there is a property somewhere I can configure to increase the required “culling” space between labels? Or, failing that, what would I need to implement myself to somehow drop some of the displayed labels in order to make them more readable?

0 votes
4k views

Hello.
We updated scichart to 2.5.0 version and got issue:
We have SCIAxisMarkerAnnotation with market line and set markerLinePen:

let mainDashPattern: [NSNumber] = [1.1, 1.0, 1.1, 1.0]
style.markerLinePen = SCISolidPenStyle(color: mainBlack15, withThickness: 1.0, andStrokeDash: mainDashPattern)

Sometimes, after create new chart, all lines with strokeDash colored with solid black color.

I added screenshots.

Thanks,
Alexey.

0 votes
9k views

I would like to change the color of chart legend, but have failed to find information on how can I do this for iOS. Any sort of tutorial would be highly appreciated.

Worst case scenario would be to create a custom theme that is based on Bright Spark theme and update legend parameters there, but for this I would need to know what exactly does Bright Spark theme looks like.

Looking forward to any recommendations.

Best Regards,
Paul.

0 votes
3k views

Hi,

I have a very simple iOS project in XCode 13 which uses Swift. The project has a tab bar controller with two tabs. The first tab brings up a sample home screen and the second tab initializes a blank SciChart graph.

I want to eventually be able to sometimes change what data is shown on the graph (via Bluetooth), and therefore I want to run my graph code every time the tab for the graph is selected. I put all my code for SciChart inside:

override func viewWillAppear(_ animated: Bool)

and this almost works fine, but declaring

let surface = SCIChartSurface() inside of override func viewWillAppear(_ animated: Bool)

seems to be causing some sort of memory leak. Switching between tabs often causes my app to crash and XCode reports the following error message: “Terminated due to memory issue”

Is there a better way to initialize my graph to prevent this memory leak? Or is there way to flush the “surface” variable from memory when transitioning between tabs to prevent this memory issue from occurring?

My small sample project is available here which demonstrates the memory leak when switching between the home screen tab and graph tab: https://drive.google.com/file/d/1mz88R3kKvoPqSGxFzohoHGDkseSwgHPh/view?usp=sharing

Any help greatly appreciated, thanks!

0 votes
0 answers
162 views

My purpose is SCIAxisLabelAnnotation draw above on border line.
like this <– this is just design guide. not a app screenshot.

But SCIAxisLabelAnnotation is can’t overlap renderable series area. So It can’t overlap renderable series area border line.

So I have to customize.
I think that If I add view into render surface, and it’s order make to zero, I can get TOBE result.

My code is below.
Code

But SeparatorView is always on view’s top. So I’m struggling.
You can See result.
It’s covered all surface.

How can I insert some view below Y Axis or SCIAxisLabelAnnotation?

tl;dr I want customize annotation shape and it draw above on 1st top layer.

  • jay han asked 4 weeks ago
  • last active 4 weeks ago
0 votes
12k views

Hey guys,

Starting from 2.0 we can have dashed lines in renderable series. I was wondering can we have dashed line annotations as well?

I tried this:

verticalLineAnnotation.style.linePen = [[SCIPenDashed alloc] initWithColor:[UIColor redColor] width:2 withStrokeDashArray:@[@(10.f),@(3.f)]];

and got this build error:

Assigning to 'SCIPenStyle *' from incompatible type 'SCIPenDashed *'

Isn’t SCIPenDashed a SCIPenStyle?

Best,
Igor

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

Could I have a date please.

is it possible for the December or more likely for January?
robert

0 votes
6k views

How would I go about doing this in swift?

0 votes
8k views

I am creating point data series using SCIXyScatterRenderableSeries.
I need to tap on specific data points and display pop over or some view on top of it. Pop over provides information regarding that point.

How can I implement that in iOS.

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

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

Hi,

I have an issue regarding to SCIAxisMarkerAnnotation that I could not find. Can I customise the look of it or should I implement my own axis marker? And can I add another pan gesture to annotation pin so the user can change annotation location on that axis?

Thanks,
Irmak

0 votes
6k views

Hi, guys

Is it possible to use negative index for methods:

-(void) insertAt:(int)index X:(SCIGenericType)x Open:(SCIGenericType)open High:(SCIGenericType)high Low:(SCIGenericType)low Close:(SCIGenericType)close;

-(void) updateAt:(int)index Open:(SCIGenericType)open High:(SCIGenericType)high Low:(SCIGenericType)low Close:(SCIGenericType)close;

Can you give an answer?

Best regards,
Sushynski Andrei

0 votes
10k views

Hi,
I am creating iOS aplication which displays charts based on stocks data.
I want to create box annotations to show when market is open or closed.
I am using CategoryDateTimeAxis to display data but when i add AnnotationCollection with BoxAnnotations to Surface i can not see the annotations.

This is my code for creating box Annotation:

    let pre = SCIBoxAnnotation()
    pre.coordinateMode = .relative
    pre.x1 = SCIGeneric(setDate(date, 4, 0, 0)!)
    pre.x2 = SCIGeneric(setDate(date, 9, 30, 0)!)
    pre.y1 = SCIGeneric(max )
    pre.y2 = SCIGeneric(0)
    pre.isEditable = false
    pre.style.fillBrush = SCISolidBrushStyle(color: #colorLiteral(red: 0.01680417731, green: 0.1983509958, blue: 1, alpha: 0.13))
    pre.style.borderPen = SCISolidPenStyle(color: .clear, withThickness: 0)
  • Marcin C asked 6 years ago
  • last active 6 years ago
0 votes
10k views

I am using latest version of SciChart through Pods. I am using trial key for now.

I have made all the views under the chart clear. And have tried the code below but the background appears to be shades of black.

     let yAxis = SCINumericAxis()
     let xAxis = SCINumericAxis()
     self.surface.xAxes.add(xAxis)
     self.surface.yAxes.add(yAxis)

     self.surface.backgroundColor = UIColor.clear
     self.surface.isOpaque = false
     self.surface.renderableSeriesAreaFill = SCISolidBrushStyle(color: UIColor.clear)
     self.surface.renderableSeriesAreaBorder = SCISolidPenStyle(color: UIColor.clear, withThickness: 0)
  • Ayush Jain asked 5 years ago
  • last active 5 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
7k views

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

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

Hi, guys

Is there possibility to show tooltip by simply changing switch at the settings?
Not by tapping at the chart area as it implemented now.

Best regards,
Sushynski Andrei

0 votes
6k views

Hi, guys

I’m very sad because of you.

On my chart i’m added SCIZoomPanModifier with clip mode SCIClipMode_ClipAtExtents. And it well worked before i have updated lib to ‘2.0.1.1748’. Now it’s works the same way as SCIClipMode_StretchAtExtents. But i don’t want to zoom by scrolling at the edge of data.

Can you look at it and fix as soon as possible?

Best regards,
Sushynski Andrei

0 votes
6k views

I’m trying to make a chart with a “toggle function”.

The “toggle function” what i wanted to make is this.

  1. enter to UIViewController which Chart is in it
  2. before singleTap on a chart, a chart has zoomPanModifier, XAxisDragModifier,, etc
  3. after make singleTap on the chart, that chart has only CursorModifier.
  4. CursorModifier’s UI stays on chart without disappearing and i can move crossed line to specific point i want (just like what CursorModifier originally does)
  5. another single tap on chart would make a chart to have all other modifiers but CursorModifer.

What I have made successfully was 1,2,3,5 . not 4.

The way i was going to solve this problem was make fake touch event on Chart view and
snatch UIGestureRecognizer Event and let ChartView think they’re being touched till I give stop signal

But I heard that there is no more way to pass fake touch to UIView.

So I’m feeling difficulty on this problem…..

is there any easy way to solve this problem?

TL;DR;

I WANT TO MAKE CURSORMODIFIER’ UI STAYS ON A CHART!

+)
(lldb) po SciChartVersionNumber
0x3ff0000000000000

(lldb) po SciChartVersionString
0x474f525029232840

I wanted to know what version I’m using.. but i couldn’t know… what version am i using..?

0 votes
6k views

I am placing annotations at the top of every bar in a stacked bar graph (and a standard bar graph on another screen) showing the total of all the stacked bars by iterating through my data, generating the sum, and placing it at the correct x,y (an incredibly manual process that seems like there should be much easier to do but I found no other way to do it – if there is a better way, I would love to hear it, but that’s a secondary issue and not my current problem).

I also have a legend where the user can select / deselect series.

When the user selects/deselects a series from the legend, I need to hide all my annotations and then recreate them because the sums of the stacked bars has changed (or if no bars are showing, remove my annotation completely). My assumption is I could reiterate through my data and check series to see if they are visible (isVisible) and recalculate the sums and recreate the annotations (another very manual process but I can probably work it out).

My primary problem is I see no way for me to intercept that this legend event occurred. The series get hidden internally and I never have a chance to do anything with the annotations. It seems like this may be doable on other platforms but I’m at a loss on iOS. There is no delegate / block event handler / etc.

Any thoughts?

0 votes
8k views

Hello.

It’s very strange, but chart can not be zoomed with pinch, only by double tap fitting full screen.
And when trying to zoom app freezes and CPU load became 100%.

func installChart() {
    sciChartSurface = SCIChartSurface(frame: self.view.bounds)
    sciChartSurface?.translatesAutoresizingMaskIntoConstraints = false


    self.vGraphBox.subviews.forEach({ $0.removeFromSuperview() })

    self.vGraphBox.addSubview(sciChartSurface!)

    NSLayoutConstraint.activate([
        sciChartSurface!.leftAnchor.constraint(equalTo: self.vGraphBox.leftAnchor),
        sciChartSurface!.rightAnchor.constraint(equalTo: self.vGraphBox.rightAnchor),
        sciChartSurface!.bottomAnchor.constraint(equalTo: self.vGraphBox.bottomAnchor),
        sciChartSurface!.topAnchor.constraint(equalTo: self.vGraphBox.topAnchor)
        ])

    // Add the SCIChartSurface as a subview
    self.vGraphBox.addSubview(sciChartSurface!)

    let xAxis = SCILogarithmicNumericAxis()
    xAxis.growBy = SCIDoubleRange(min: SCIGeneric(0.1), max: SCIGeneric(0.1))
    xAxis.scientificNotation = .logarithmicBase
    //xAxis.textFormatting = "#.#E+0"
    xAxis.logarithmicBase = 10.0
    xAxis.visibleRange = SCIDoubleRange(min: SCIGeneric(100), max: SCIGeneric(22000.0))

    let yAxis = SCINumericAxis()
    yAxis.autoRange = .never
    yAxis.visibleRange = SCIDoubleRange(min: SCIGeneric(-300.0), max: SCIGeneric(0.0))

    lineRenderableSeries.dataSeries = self.dataSeries
    lineRenderableSeries.strokeStyle = SCISolidPenStyle(colorCode: 0xFFE13219, withThickness: 1)

    //self.sciChartSurface?.chartModifiers.add(pinchZoomModifier) //Causes freeze
    self.sciChartSurface?.chartModifiers.add(SCIZoomPanModifier())
    self.sciChartSurface?.chartModifiers.add(SCIZoomExtentsModifier())

    SCIUpdateSuspender.usingWithSuspendable(sciChartSurface!) {
        self.sciChartSurface?.xAxes.add(xAxis)
        self.sciChartSurface?.yAxes.add(yAxis)
        self.sciChartSurface?.renderableSeries.add(self.lineRenderableSeries)
        self.sciChartSurface?.renderableSeries.add(self.lineRenderableSeriesMax)
    }
}
0 votes
4k views

I’m trying to clear a SCIUniformHeatmapDataSeries after connecting it to a SCIChartSurface, but it is very slow and energy consuming. However, if I clear the data series before it is connected to the sci chart, then the clearing is pretty fast. How can I clear the data series after it is connected to the chart surface quickly? Do I have to make a new data series, clear it, and connect to the scichartsurface every time I want to clear a data series? This is for iOS by the way.
EDIT: code

for i in 0..<data.MATRIX_COLUMNS {
        for j in 0..<data.MATRIX_ROWS  {
            data.ecm2DMatrix[i][j] = Double.nan
            SCIUpdateSuspender.usingWith(charts.ecmSurface) {
                self.data.ecmDataSeries.update(z:self.data.ecm2DMatrix[i][j], atX: i, y: j)
            }
0 votes
6k views

The wick for the up candlestick go through the body while the down candlestick do not. How can I make the wick inside the body part disappear? I didn’t change any settings of stroke and fill style. Thanks.

let candlestickSeries = SCIFastCandlestickRenderableSeries()
candlestickSeries.dataSeries = dataSeries
candlestickSeries.yAxisId = "right"
0 votes
0 answers
166 views

Hello,

I have a problem reading the position of the vertical line annotations. The function “getX1” returns type double (0 – 1) or date depending on whether the annotation has not changed its position. I found out from the documentation that the type returned depends on the coordinateMode. I set it to absolute. This change had no effect, unlike in library written in Java. Is it possible to set the default type? Can I ask for any guidance needed to solve the problem? The version of the library I am using is 4.4.2.5871.

Thanks in advance!
Paweł

0 votes
15k views

Hi guys,

I am having difficulties setting the background of my bar chart with SCICategoryDateTime X axis since I switched to 2.0.

As far as I understand, just setting the background property of the SCIChartSurface should suffice.
These are all of the things I’ve tried:

1. [self.barSurface setBackgroundColor:[UIColor clearColor]];
2. [self.barSurfaceView setBackgroundColor:[UIColor clearColor]]; 
3. self.barSurface.renderableSeriesAreaFill = [[SCISolidBrushStyle alloc] initWithColor:[UIColor clearColor]];
4. [self.barSurface.renderSurface setIsTransparent:YES];

I didn’t find any other way of setting it, but it still remains black. Any thought on what might cause it?

EDIT: I just found out about this color setting:

[axisStyle setGridBandBrush:[[SCISolidBrushStyle alloc] initWithColor:[UIColor whiteColor]]];

The result I got was a black and white chess board, as shown on the attached picture. I really don’t understand this behaviour. If I set this gridBandBrush to nil, columns are coloured with random colours, so the chart looks like a rainbow. I understand why is this happening but shouldn’t there be a default colour in case brush is nil?

EDIT 2: While debugging using “Capture view hierarchy” in XCode I discovered that render surface is actually white inside debugger. Perhaps it will give more insight to you, it doesn’t mean much to me – I guess it’s because rendering is done on GPU and the context is not available to the debugger.

Best,
Igor

  • Igor Peric asked 7 years ago
  • last active 7 years ago
0 votes
5k views

I have a Xamarin forms Project with one page of my app containing a SciChart. On that page, I have a RelativeLayout.

In the code behind for that page, I pass my layout to a dependency service method which adds the SciChartSurface to it depending on the platform. This has tested well on various Android platforms.

For iOS, I’ve tested on a device running iOS 9 and simulators running 9, 10, and 11. And any run less than 11 does not display. The view is simply blank.

Here’s the code where I add the SciChartSurface to the view.. I’m still new to SciChart, so I’m not sure if I’m doing everything totally correct.

public void renderSciChart(Xamarin.Forms.RelativeLayout masterLayout, Xamarin.Forms.RelativeLayout topLayout)
    {


        SciChart.iOS.Charting.SCIChartSurface Surface = new SciChart.iOS.Charting.SCIChartSurface();
        Surface.TranslatesAutoresizingMaskIntoConstraints = true;
        SciChart.iOS.Charting.XyDataSeries<double, double> dataSeries = new SciChart.iOS.Charting.XyDataSeries<double, double>();
        //generateDataPoints(dataSeries);
        var xAxis = new SciChart.iOS.Charting.SCINumericAxis{/*GrowBy = new SciChart.iOS.Charting.SCIDoubleRange(0.1, 0.1), VisibleRange = new SciChart.iOS.Charting.SCIDoubleRange(1.1,2.7)*/};
        var yAxis = new SciChart.iOS.Charting.SCINumericAxis();
        var renderableSeries = new SciChart.iOS.Charting.SCIFastLineRenderableSeries { DataSeries = dataSeries, StrokeStyle = new SciChart.iOS.Charting.SCISolidPenStyle(0xFF279B27, 2f) };
        using (Surface.SuspendUpdates())
        {
            Surface.XAxes.Add(xAxis);
            Surface.YAxes.Add(yAxis);
            Surface.RenderableSeries.Add(renderableSeries);
            Surface.ChartModifiers = new SciChart.iOS.Charting.SCIChartModifierCollection
            {
                new SciChart.iOS.Charting.SCIZoomPanModifier(),
                new SciChart.iOS.Charting.SCIPinchZoomModifier(),
                new SciChart.iOS.Charting.SCIZoomExtentsModifier(),
            };
        }

        masterLayout.Children.Add(Surface.ToView(),
        widthConstraint: Constraint.RelativeToParent(parent => parent.Width),
        heightConstraint: Constraint.RelativeToParent(parent => parent.Height * 0.5),
        yConstraint: Constraint.RelativeToView(topLayout, (RelativeLayout, element) => element.Height));
    }

Additionally, here’s a Screenshot of the same code running on a simulator with iOS 10 (Left) and iOS 11 (Right).
10 vs 11

0 votes
0 answers
4k views

I am trying SciChart iOS.

I run the demo code, and check on the line chart.
The y-axis label is on the right of the plot, and aligned center.

I tried to modify the alignment to right by adding the following code.
(Also, changing things like amplitude or rightAxisAreaForcedSize)

yAxis.style.labelStyle.alignmentHorizontal = SCILabelAlignmentHorizontal_Right;

I was hoping that the smallest digit of “0” and “100” can be aligned,
but no effect could be seen when I ran the code. (still center-aligned)

Is that a bug or is there any reason for the behavior?

FYI, when I modify the code again with “SCILabelAlignmentHorizontal_Left”, it work as expected.

Showing 151 - 200 of 314 results