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

1 vote
18k views

Hello,

Out team have several question about the framework:

  1. Is there a way to make SCIChartSurfaceView background transparent so that the user could see underlying views? We tried using background brush of clear color on SCIChartSurface and making SCIChartSurfaceView backgroundColor transparent but no avail.

  2. Is it possible to add translate/rotate/scale animation to markers/annotations from code?

  3. When using gradient brush with mountain renderable series we found a strange visual artifact (“Gradient artifact” image). Is there a way to fix it?

Best regards,
Vasiliy

0 votes
17k views

Hi,

I’m trying to achieve the looks of DateTimeCategory XAxis as shown on uploaded screenshot.

Formatting a single row of tick labels is not a hard task (setTextFormatting). The problem arises when there are 2 rows with same frequency (days of the week and dates) and third row with lower frequency (years).

I tried using new line character in text formatting property to break the line for days and dates and it didn’t work. I also tried having two axes bound to the same data series, each one having different formatting and majorDelta, but it seems that they don’t stack up (only first one added is shown).

Any ideas?

  • Igor Peric asked 7 years ago
  • last active 7 years ago
4 votes
15k views

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

CDAxisMarkerAnnotation.h

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

@protocol CDAxisMarkerAnnotationDelegate <NSObject>

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

@end

@interface CDAxisMarkerAnnotation : SCIAxisMarkerAnnotation

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

@end

CDAxisMarkerAnnotation.m

#import "CDAxisMarkerAnnotation.h"

@implementation CDAxisMarkerAnnotation

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

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

@end

Thanks,
Irmak

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

Hi, guys

Is it possible to draw axis line at axis area? See attachment.

0 votes
13k views

Hi,

I’ve been looking through ways to have to y-Axis scale for really small changes/values.

For example, I’m attempting to plot 10 values between 0.99300 to 0.99400, and the changes between points can vary between 0.001 to 0.0001 or so (basically, really small changes)

However, my y-Axis seems to always start at 0 and the y-Axis major ticks are always at most a 0.1 difference, making the graph look flat.

I’d like to achieve the following:
– Scale to the smallest value i can scale to.
– Have my y-Axis to not necessarily start at 0.

I’ve tried the following:

Setting up y-Axis:

    self.yAxis = [SCINumericAxis new];
    [self.yAxis setStyle:axisStyle];
    self.yAxis.axisId = @"yAxis";
    [self.yAxis setGrowBy:[[SCIDoubleRange alloc]initWithMin:SCIGeneric(0) Max:SCIGeneric(0.1)]];
    [self.yAxis setAutoRange:SCIAutoRange_Always];
    [self.chartSurface attachAxis:self.yAxis IsXAxis:NO];

Regards.

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?

2 votes
12k views

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

  • liza yudup asked 8 years ago
  • last active 8 years ago
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
12k views

Hi guys,

I have some troubles with piecharts in swift. I want to provide custom labels outside of the piecharts segments. I found a screenshot of a nested piechart attached to an issue in your issue tracker. Thats what I want to do in swift, but I couldn’t find out a way to do so. Could you please provide an example code?

Thanks a lot in advance!
Alex

0 votes
0 answers
12k views

iOS 11.2 with xCode 9.2

I have a chart with two data series and a legend. The chart lives in a view controller that is embedded in a navigation controller. I configured the navigation bar to hide itself when the phone it tilted into landscape mode: navigationController.hidesBarsWhenVerticallyCompact = true

When I tilt the phone the navigation bar is hidden as expected. However when I tap on the chart legend to turn off one of the data series I see the navigation bar re-appears. Screen shots attached.

1 vote
12k views

Hello!

Please take a look at the attached screenshot first.

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

I tried to draw coordinate relative line annotation as follows:

var date: NSDate = NSDate()

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

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

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

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

1 vote
12k views

When I embed my view controller in a navigation controller the top of the chart is hidden behind the navigation bar. So I went to the storyboard and found the view controller attributes section called “extend edges” and turned off the option called “under top bars”. This fixes the top of the chart. Now the bottom of the chart drops off the bottom of the screen. The x-axis is completely missing. Does SciChart support this case?

0 votes
11k views

Using custom label provider I am able to format the cursor label, but still there is the name of the axis. I only want to show the value here, like “0,91” and remove the “X:” (see attached screenshots).

Thanks in advance.

override func formatCursorLabel(_ dataValue: SCIGenericType) -> String! {
    return "" // super.formatCursorLabel(dataValue)
}
1 vote
11k views

I’m attempting to integrate some of the tutorial swift code into my app and I’m getting stuck on this error. Seems like some macro isn’t running.

“Use of unresolved identifier ‘SCIGeneric'”

Code is like this: lineDataSeries.appendX(SCIGeneric(i), y: SCIGeneric(sin(Double(i))*0.01))

I’ve done “import SciChart” and most things seem to work fine except this. Any ideas? Thanks

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

It seems most of the modifiers bring up tooltip data with a pan, and then it goes away when the user lifts their finger. Is there any way to bring up tooltip data with a tap (and does not go away when the finger has lifted)? The main problem that we’re trying to solve is that we would like to be able to pan to look at the chart (and don’t want an axis pan), but would also like to bring up tooltip data.

  • Carolyn asked 5 years ago
  • last active 5 years ago
1 vote
11k views

I’ve got error message during compilation:

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

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

1 vote
11k views

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

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

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

  • doughill asked 8 years ago
  • last active 8 years ago
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
10k views

Hey Guys,

I have a requirement where I need to show Donut Chart Title , but adding any annotation is crashing my application.

    let textAnnotation = SCITextAnnotation()
    textAnnotation.coordinateMode = .relative
    textAnnotation.x1 = SCIGeneric(0.5)
    textAnnotation.y1 = SCIGeneric(0.5)
    textAnnotation.horizontalAnchorPoint = .center
    textAnnotation.verticalAnchorPoint = .center
    textAnnotation.text = "Test"
    textAnnotation.style.textStyle.fontSize = 14
    textAnnotation.style.textColor = UIColor.fromARGBColorCode(0xff000000);
    textAnnotation.style.backgroundColor = UIColor.clear
    chartSurface.annotations = SCIAnnotationCollection(childAnnotations: [textAnnotation])

Thanks

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

Hi, guys

My X axis is SCICategoryDateTimeAxis type.

And i have a huge amount of data to display. So i need to display it by scrolling of the chart surface.
So what is the best practice to update data series on the fly and display it at the chart surface?

Best regards,
Sushynski Andrei

0 votes
10k views

I have just learned how to use sci-chart framework with tutorials.
And I tried to add values from bluetooth as realtime chart as shown in tutorials.
I have finished receiving data from a Bluetooth connection.
However, using scichart to represent this data in real time is hard to solve by looking at the tutorial alone.
Does anyone have any idea how to use real-time tutorials to teach you how to represent your own data, not the example sine graph?

The code below is what I tried and is wrong.

import UIKit
import CoreBluetooth
import SciChart

let maestroServiceCBUUID = CBUUID(string:”495sdfd3-FE7D-4AE5-8FA9-9FAFD205E455″)
let maestroBrainDataCBUUID = CBUUID(string: “4953sdf3-1E4D-4BD9-BA61-23C647249616”)
class HRMViewController: UIViewController {
var sciChartSurface: SCIChartSurface?

var lineDataSeries: SCIXyDataSeries!
var scatterDataSeries: SCIXyDataSeries!

var lineRenderableSeries: SCIFastLineRenderableSeries!
var scatterRenderableSeries: SCIXyScatterRenderableSeries!

var timer: Timer?
var phase = 0.0
var i = 0

@IBOutlet weak var brainRateLabel: UILabel!

var centralManager: CBCentralManager!
var maestroPeripheral:CBPeripheral!
override func viewDidLoad() {
super.viewDidLoad()

sciChartSurface = SCIChartSurface(frame: self.view.bounds)
sciChartSurface?.autoresizingMask = [.flexibleHeight, .flexibleWidth]
sciChartSurface?.translatesAutoresizingMaskIntoConstraints = true

self.view.addSubview(sciChartSurface!)


let xAxis = SCINumericAxis()
xAxis.growBy = SCIDoubleRange(min: SCIGeneric(0.1), max: SCIGeneric(0.1))
sciChartSurface?.xAxes.add(xAxis)

let yAxis = SCINumericAxis()
yAxis.growBy = SCIDoubleRange(min: SCIGeneric(0.1), max: SCIGeneric(0.1))
sciChartSurface?.yAxes.add(yAxis)

createRenderableSeries()
addModifiers()


centralManager = CBCentralManager(delegate: self , queue: nil)

// Make the digits monospaces to avoid shifting when the numbers change

}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)

if nil == timer{
  timer = Timer.scheduledTimer(withTimeInterval: 0.01, repeats: true, block: updatingDataPoints)
}

}

override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)

if nil != timer{
  timer?.invalidate()
  timer = nil
}

}

func updatingDataPoints(timer:Timer){

i += 1

lineDataSeries.appendX(SCIGeneric(i), y: SCIGeneric(cos(Double(i)*0.1 + phase)))
scatterDataSeries.appendX(SCIGeneric(i), y: SCIGeneric(cos(Double(i)*0.1 + phase)))

phase += 0.01

sciChartSurface?.zoomExtents()
sciChartSurface?.invalidateElement()

}

func createDataSeries(_brainwave2:Double){
// Init line data series
lineDataSeries = SCIXyDataSeries(xType: .double, yType: .double)
lineDataSeries.fifoCapacity = 500
lineDataSeries.seriesName = “line series”

// Init scatter data series

// scatterDataSeries = SCIXyDataSeries(xType: .double, yType: .double)
// scatterDataSeries.fifoCapacity = 500
// scatterDataSeries.seriesName = “scatter series”

for i in 0...500{
  lineDataSeries.appendX(SCIGeneric(i), y: SCIGeneric(_brainwave2))

// scatterDataSeries.appendX(SCIGeneric(i), y: SCIGeneric(cos(Double(i)*0.1)))
}

i = Int(lineDataSeries.count())

}

func createRenderableSeries(){
lineRenderableSeries = SCIFastLineRenderableSeries()
lineRenderableSeries.dataSeries = lineDataSeries

scatterRenderableSeries = SCIXyScatterRenderableSeries()
scatterRenderableSeries.dataSeries = scatterDataSeries

sciChartSurface?.renderableSeries.add(lineRenderableSeries)
sciChartSurface?.renderableSeries.add(scatterRenderableSeries)

}

func addModifiers(){
let xAxisDragmodifier = SCIXAxisDragModifier()
xAxisDragmodifier.dragMode = .pan
xAxisDragmodifier.clipModeX = .none

let yAxisDragmodifier = SCIYAxisDragModifier()
yAxisDragmodifier.dragMode = .pan

let extendZoomModifier = SCIZoomExtentsModifier()
let pinchZoomModifier = SCIPinchZoomModifier()

let rolloverModifier = SCIRolloverModifier()
let legend = SCILegendModifier()

let groupModifier = SCIChartModifierCollection(childModifiers: [xAxisDragmodifier, yAxisDragmodifier, pinchZoomModifier, extendZoomModifier, legend, rolloverModifier])

sciChartSurface?.chartModifiers = groupModifier

}

func brainwaveReceived(_ brainWave:Double){
let brainWave = brainWave * 3.3 / 65536
brainRateLabel.text = String(brainWave)
print(“brainwave: (brainWave)”)
}

}

extension HRMViewController: CBCentralManagerDelegate {
func centralManagerDidUpdateState(_ central: CBCentralManager) {
switch central.state {

case .unknown:
  print("central.state is . unknown")
case .resetting:
  print("central.state is . resetting")
case .unsupported:
  print("central.state is . unsupported")
case .unauthorized:
  print("central.state is . unauthorized")
case .poweredOff:
  print("central.state is . poweredOff")
case .poweredOn:
  print("central.state is . poweredOn")
  centralManager.scanForPeripherals(withServices:nil)
}

}

func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber) {
print(peripheral)
if peripheral.name == “MAESTRO1” {
// maestroPeripheral = peripheral
centralManager.stopScan()
maestroPeripheral = peripheral
maestroPeripheral.delegate = self
central.connect(maestroPeripheral)
}

}
func centralManager(_ central: CBCentralManager, didConnect peripheral: CBPeripheral) {
print(“Connected!”)
maestroPeripheral.discoverServices([maestroServiceCBUUID])
}
}

extension HRMViewController:CBPeripheralDelegate{
func peripheral(_ peripheral: CBPeripheral, didDiscoverServices error: Error?) {
guard let services = peripheral.services else {return}
for service in services {
print(service)
peripheral.discoverCharacteristics(nil, for: service)
}
}
func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsFor service: CBService, error: Error?) {
guard let characteristics = service.characteristics else {return}

for characteristic in characteristics {
  print(characteristic)
  if characteristic.properties.contains(.read){
    print("\(characteristic.uuid): properties contain .read")
  }
  if characteristic.properties.contains(.notify){
    print("\(characteristic.uuid): properties contain .notify")
    peripheral.setNotifyValue(true , for: characteristic)
  }
}

}

func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic,
error: Error?) {
switch characteristic.uuid {
case maestroBrainDataCBUUID:
let wave = Double(brainData(from: characteristic))*3.3/65536
createDataSeries(_brainwave2:wave)

  default:
  print("Unhandled Characteristic UUID: \(characteristic.uuid)")
}

}
private func brainData(from characteristic: CBCharacteristic) -> Int {
guard let characteristicData = characteristic.value else { return -1 }
let byteArray = UInt8

let firstBitValue = byteArray[0] & 0x01
if firstBitValue == 0 {
  // Heart Rate Value Format is in the 2nd byte
  return Int(byteArray[1])
} else {
  // Heart Rate Value Format is in the 2nd and 3rd bytes
  return (Int(byteArray[1]) << 8) + Int(byteArray[2])
}

}

}

0 votes
10k views

Hi!

I tried implementing pinch zooming for real time chart in the demo project(FIFO Performance Demo and ECG Monitor Demo) and found that it’s not possible.

I used the following code:

self.surface = [[SCIChartSurface alloc] initWithView: self.sciChartSurfaceView];
SCIPinchZoomModifier * pzm = [[SCIPinchZoomModifier alloc] init];
[pzm setModifierName:@”PinchZoom Modifier”];
self.surface.chartModifier = pzm;

If it is so, then how can I achieve it ?

  • Chui asked 7 years ago
  • last active 7 years ago
0 votes
10k views

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

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

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

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

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

1 vote
10k views

Stacked Bar chat: If we give 0 values, there are Black lines showing at middle of screen. please see attached screen.

0 votes
10k views

Hi, guys

My x axis is SCICategoryDateTimeAxis and i’m want to draw grid line with custom period. Let’s say every four hours for data with a period of thirty minutes. What is the best way for that?

Can i redifined axis’s tickCoordinatesProvider?
Can you provide some example?
Or it only possible with axes annotations ?

Best regards,
Sushynski Andrei

0 votes
10k views

So I want to draw multiple charts so is there any way I can have stacked yAxes like yAxis 2 should be drawn below yAxis1. I have gone through your example and there I got that we can add multiple surface but its becoming difficult for us to show a crosshair on all surfaces since we have a custom cross hair. Can you guide on same. Thanks in advance

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
1 vote
10k views

Hi everyone,

What would be the easiest way of shading all vertical bands for weekend days? I’ve got two ideas:

  1. Setting major band brush won’t work because there’s no way of setting only weekend bands to be major bands (as far as I know).
  2. Using box annotations.

Problem with 2nd option is that annotations are rendered over the chart (screenshot attached). Is there a way of sending them behind columns?

Thanks,
Igor

  • Igor Peric asked 7 years ago
  • last active 7 years ago
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
0 answers
9k views

Hello,

I’m currently evaluating SciChart to see if it supports our needs for an application. We’re trying to have a chart that closely mimics the iOS Stock application (attachment: StockApp.PNG) but for sensor values. Our effort so far can be seen in attachment: SciChart.jpg.

  1. Inside the tooltip provided by the RolloverModifier, we only want to display the value of the Y axis – and get rid of the X axis (datetime). Is there a way to hide the X axis value and only display the Y axis value inside the tooltip? Refer to SciChart.jpg. For example, when RolloverModifier is visible, the tooltip for Turbidity line should only read “Turbidity: 2.50 NTU”, where 2.50 is the Y-axis value and NTU is the unit of measure. Notice we do not want to see “X: 28/01/18 12:24PM” at all in the tooltip.

  2. Similar to the iOS Stock app, we require a second RolloverModifier when a second finger rests on the chart. The idea is to provide a quick popover to display the difference in Y-axis value between the two RolloverModifier values. I tried adding a second instance of RolloverModifier to the SCIChartSurface however the vertical trace line would just overlap the first finger’s trace line.

There are the two major requirements I see right now in determining whether to invest in SciChart. So please let me know if they are possible. Below is the code.

    override func viewDidLoad() {
        super.viewDidLoad()

        layout()

        configXaxis(surface: sciChartSurface)
        configYaxis(surface: sciChartSurface)        
        loadDataSeriesFromCsv(csv: rlCSVToDownload!)
    }

   private func layout() {
        let margins = view.layoutMarginsGuide

        sciChartSurface = SCIChartSurface()
        sciChartSurface?.translatesAutoresizingMaskIntoConstraints = false
        self.view.addSubview(sciChartSurface!)

        sciChartSurface?.leadingAnchor.constraint(equalTo: self.view.leadingAnchor).isActive = true
        sciChartSurface?.trailingAnchor.constraint(equalTo: self.view.trailingAnchor).isActive = true
        sciChartSurface?.bottomAnchor.constraint(equalTo: margins.bottomAnchor).isActive = true
        sciChartSurface?.topAnchor.constraint(equalTo: margins.topAnchor).isActive = true
    }

    private func configYaxis(surface: SCIChartSurface!) {
        let axis = SCINumericAxis(), numericFormat = "%.02f"
        axis.textFormatting = numericFormat
        axis.cursorTextFormatting = numericFormat
        surface.yAxes.add(axis)
    }

    private func configXaxis(surface: SCIChartSurface!) {
        let axis = SCIDateTimeAxis(), datetimeFormat = "dd/MM/YY H:mm a", subDayFormat = "H:mm a"
        axis.textFormatting = datetimeFormat
        axis.subDayTextFormatting = subDayFormat
        axis.cursorTextFormatting = datetimeFormat

        surface.xAxes.add(axis)
    }

    private func addModifiers() {
        let xAxisDragmodifier = SCIXAxisDragModifier()
        xAxisDragmodifier.dragMode = .pan
        xAxisDragmodifier.clipModeX = .none

        let yAxisDragmodifier = SCIYAxisDragModifier()
        yAxisDragmodifier.dragMode = .pan

        let extendZoomModifier = SCIZoomExtentsModifier()
        let pinchZoomModifier = SCIPinchZoomModifier()

        let rolloverModifier = SCIRolloverModifier()

        let legend = SCILegendModifier()

        let groupModifier = SCIChartModifierCollection(childModifiers: [xAxisDragmodifier, yAxisDragmodifier, pinchZoomModifier, extendZoomModifier, legend, rolloverModifier])

        sciChartSurface?.chartModifiers = groupModifier
    }

   private func loadDataSeriesFromCsv(csv: CSV) {
        rlCSVConnection?.download(csv: csv, onProgress: nil, onComplete: {
            [weak self] (csv) -> (Void) in

            self?.turbDataSeries = SCIXyDataSeries(xType: SCIDataType.dateTime, yType: SCIDataType.double)
            self?.turbDataSeries.seriesName = "Turbidity"

            self?.cl2DataSeries = SCIXyDataSeries(xType: SCIDataType.dateTime, yType: SCIDataType.double)
            self?.cl2DataSeries.seriesName = "Chlorine"

            //... Populate data into DataSeries ...

            self?.turbRenderableSeries = SCIFastLineRenderableSeries()
            self?.turbRenderableSeries.isDigitalLine = true
            self?.turbRenderableSeries.dataSeries = self?.turbDataSeries
            self?.turbRenderableSeries.style.strokeStyle = SCISolidPenStyle(color: UIColor.orange, withThickness: 1)

            self?.cl2RenderableSeries = SCIFastLineRenderableSeries()
            self?.cl2RenderableSeries.isDigitalLine = true
            self?.cl2RenderableSeries.dataSeries = self?.cl2DataSeries
            self?.cl2RenderableSeries.style.strokeStyle = SCISolidPenStyle(color: UIColor.green, withThickness: 1)

            self?.sciChartSurface?.renderableSeries.add(self?.turbRenderableSeries)
            self?.sciChartSurface?.renderableSeries.add(self?.cl2RenderableSeries)

            self?.addModifiers()
        }, onFailure: nil)
    }

Thanks.

0 votes
9k views

Hi, guys

it seems that i had found a mistake:

At SCICursorModifierStyle class if i try to set up axisVerticalTooltipCornerRadius property it lead to changing of axisHorizontalTooltipCornerRadius

Please take a look

Best regards,
Sushynski Andrei

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

Hello!

I am building an iOS framework that sits on top of SciChart for app developers within our company. I’d like to provide my own default SCIThemeColorProvider object for charts in my framework. Easiest way to do that is to include my own theme plist in my framework’s bundle, but I cannot currently do that (as of 2.0.0.1643) because the SCIThemeColorProvider initializer assumes it’s either in the “Charting.SciChart” bundle or the main bundle.

I’d like to propose modifying SCIThemeColorProvider to add another initializer that takes a bundle ID, like this:

/**
 * Creates theme provider based on specified style
 *
 * @param themeKey The key of style which should be used as base for this theme provider
 *
 * @param bundleIdentifier The identifier of the bundle containing the theme plist identified by 
 *                         themeKey; if nil, the main bundle is used.
 */
- (nullable instancetype)initWithThemeKey:(nonnull NSString*)themeKey bundleIdentifier:(nullable NSString*)bundleIdentifier;

The existing -initWithThemeKey: initializer would call through to this initializer with a nil bundle ID.

I have attached a patch file with this proposed change. Could this be added to an upcoming build?

0 votes
9k views

Hi, guys

Please take look at:
http://prntscr.com/gmmib5

So my question is

Is there a way to highlight a line of a gridlines to which the label belong? It can be a color changed or something similar that can be easily perceived by the user.

Best regards,
Sushynski Andrei

0 votes
9k views

Hi,

I’m trying to limit the x-axis panning up to an annotation that I’ve drawn on the graph. This annotation can be beyond the current data’s position (i.e. data’s timestamp is at 5/4/2017 11:00:00, annotation’s position is at 5/4/2017 16:00:00). Is there a method, or any way that I can use to limit the x-axis panning up to the annotation’s position instead of limiting it to the data series’ max X?

Regards.

0 votes
0 answers
9k views

We are using the candlestick chart, and scrolling off the ends of the plotted data behaves very strangely:
– If I scroll slowly, the chart expands, anchored to the end of the data set (this is expected)
– If I scroll quickly, it lets me scroll beyond the end of the data set
– Once I have scrolled of the end of the data set, touching the screen again jumps back to the data set
– If I scroll slowly so the chart is expanding, and then release touch, the chart continues to move with inertia. If I clock again it jumpos back to expanding mode.

The combination of all these behaviours makes a very confusing and unsatisfying user experience.

Is there a way to change the behaviour? I had a look at https://www.scichart.com/documentation/ios/v2.x/api/dir_2dcc4ec269b335aa862d36c6f6e3093f.html but can’t find anything that might.

We have set:
xAxis is a SCIDateTimeAxis
xAxis.VisibleRange to desired range
xAxis.VisibleRangeLimit = range.Clone() where range is desired range
xAxis.VisibleRangeLimitMode = SCIRangeClipMode.inMax (I guess it should be called minMax but something broke in the build?)
xAxis.AutoRange = SCIAutoRange.Never

with chart modifiers:
– new SCIZoomPanModifier()
– new SCIZoomExtentsModifier()
– new SCIPinchZoomModifier()

Thanks,

Dan

2 votes
9k views

From your documentation:

4.9 Annotations

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

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

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

0 votes
9k 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 it 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…

0 votes
9k views

Hi, guys

Is there something similar like

  • (void)bringSubviewToFront:(UIView *)view;
  • (void)sendSubviewToBack:(UIView *)view;

from UIView but for chart Annotations?

Best regards,
Sushynski Andrei

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

1 vote
9k views

I want a transparent background of SCI Chart so that view below the chart are visible. I have tried various solutions but it is still turning out to be black. Below is my code for the same. Can anyone please help me out ? I am setting SCIChartSurface backgroundColor property to achieve it but it doesnt seem to work.

func initColumnChart() {

    let xAxis = SCINumericAxis()
    let yAxis = 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)


    let xAxisGridBandBrush = SCISolidBrushStyle(color: UIColor.clear)
    xAxis.style.gridBandBrush = xAxisGridBandBrush

    xAxis.visibleRange = SCIDoubleRange(min: SCIGeneric(-0.6), max: SCIGeneric(8.0))
    xAxis.style.majorTickBrush = SCISolidPenStyle(color: UIColor.white, withThickness: 1)
    xAxis.style.majorTickSize = 5
    xAxis.autoTicks = false
    xAxis.majorDelta = SCIGeneric(1.0)
    xAxis.minorDelta = SCIGeneric(1.0)
    xAxis.labelProvider = UsageXLabelProvider()
    xAxis.style.labelStyle.color = UIColor.white
    xAxis.style.labelStyle.fontName = "Helvetica"
    xAxis.style.labelStyle.fontSize = 14
    xAxis.style.drawLabels = true
    xAxis.style.drawMajorGridLines = false
    xAxis.style.drawMinorGridLines = false
    xAxis.style.drawMajorTicks = true
    xAxis.style.drawMinorTicks = false
    xAxis.tickProvider = YAxisTickProvider(minorTicks: [], majorTicks: [0,1,2,3,4,5,6])



    let yAxisGridBandBrush = SCISolidBrushStyle(color: UIColor.clear)
    yAxis.style.gridBandBrush = yAxisGridBandBrush

    yAxis.style.labelStyle.color = UIColor.white
    yAxis.style.labelStyle.fontName = "Helvetica"
    yAxis.style.labelStyle.fontSize = 14
    yAxis.style.drawLabels = true
    yAxis.visibleRange = SCIDoubleRange(min: SCIGeneric(-1.0), max: SCIGeneric(65))
    yAxis.autoTicks = false
    yAxis.majorDelta = SCIGeneric(1.0)
    yAxis.minorDelta = SCIGeneric(0.2)
    yAxis.style.majorGridLineBrush = SCISolidPenStyle(color: UIColor.white, withThickness: 0.5, andStrokeDash: [5.0,6.0])
    // Style the Minor Gridlines on the YAxis (vertical lines)
    yAxis.style.minorGridLineBrush = SCISolidPenStyle(color: UIColor.white, withThickness: 0.5, andStrokeDash: [5.0, 6.0])
    yAxis.style.drawMajorGridLines = true
    yAxis.style.drawMinorGridLines = true
    yAxis.style.drawMajorTicks = false
    yAxis.style.drawMinorTicks = false
    yAxis.axisAlignment = .left
    //yAxis.labelProvider = DailyFlowrateLabelProvider()
    yAxis.tickProvider = YAxisTickProvider(minorTicks: [0,8,16,24,31,40,48,56], majorTicks: [0,31,62])

    let dataSeries = SCIXyDataSeries(xType: .float, yType: .float)
    dataSeries.appendRangeX([0,1,2,3,4,5,6], y: [52,40,15,48,25,36,20])

    let rSeries = SCIFastColumnRenderableSeries()
    rSeries.dataSeries = dataSeries
    rSeries.paletteProvider = BarsColorPalette()

    SCIUpdateSuspender.usingWithSuspendable(surface) {
        self.surface.xAxes.add(xAxis)
        self.surface.yAxes.add(yAxis)
        self.surface.renderableSeries.add(rSeries)
        //self.surface.chartModifiers = SCIChartModifierCollection(childModifiers: [SCIPinchZoomModifier(), SCIZoomExtentsModifier(), SCIRolloverModifier()])

        //rSeries.addAnimation(SCIWaveRenderableSeriesAnimation(duration: 3, curveAnimation: .easeOut))
    }
}
  • Ayush Jain asked 5 years ago
  • last active 5 years ago
0 votes
9k views

It would be nice to have an access to repo through CocoaPods. You can create a private spec repo and share with developers. https://guides.cocoapods.org/making/private-cocoapods.html

1 vote
9k views

Hello,
I’ve been looking for the documentation of how to customize the look of the chart. I have a black/dark gray checker pattern that seems to be the default. I would like to:
1. Change the background to white, no checkerboard pattern
here is the documentation for chart background but it does not show me how to change it to white. https://www.scichart.com/documentation/ios/v2.x/webframe.html#The%20SciChartSurface%20Type.html
I have found through experimentation the I can call

surface.backgroundColor

But that just changes the axis background color

2. Make the text larger on the axis.
here is the documentation for the axis https://www.scichart.com/documentation/ios/v2.x/webframe.html#Adding%20an%20Axis%20to%20a%20SciChartSurface.html
I see these lines that were provided but they won’t compile because Xcode doesn’t know what defaultFontSize is and there are no other references to it and I still don’t see a way to set the size.

textFormat.fontName = SCSFontsName.defaultFontName
textFormat.fontSize = SCSFontSizes.defaultFontSize

I think it would be helpful to create a walkthrough for iOS that shows how to customize the background and axis. I’ve looked through the samples provided but the files are huge and I get lost trying to figure it out.
Thanks,
Warren

0 votes
0 answers
9k views

I have a chart that has Real Time updates. I would like to create a custom legend modifier to display the latest value in the legend as well as other information. Is it possible to do this and if so where can I find an example?

Showing 1 - 50 of 314 results

Try SciChart Today

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

Start TrialCase Studies