Hello,
I would like to place a title for an X axis to the right of axis labels. I am easily able to achieve this on Android (see attached screenshot), but I cannot find relevant properties (axisTitlePlacement etc.) in iOS version of SciChart.
In the last section of this article in documentation you write that it is possible, however the links are dead (and frankly, the method names look suspiciously Java-ish to me).
- Radosław Opieńka asked 5 years ago
- last active 5 years ago
We have created graph for x axis string and y axis double. we have create object like this XyDataSeries<string,double> if run app getting exception error .
How to declare and how to use it .
- senthil kumar asked 5 years ago
- last active 5 years ago
I’m having difficulty determining the easiest method of placing the legend outside of the chart surface in iOS. I’ve done a ton of trial and error and have run into several issues. I understand that the SCIChartLegend class is just a subclass of UICollectionView. The problem seems to be these two things:
— When adding a legend via SCILegendModifier it only allows for custom placement if using SCILegendModifier’s initializer which also requires you assign an SCILegendDataSource. Or at least that’s required for the initializer with the useAutoPlacement parameter that I can then set to false (not even sure if that would work once I got that far).
— Placing the SCIChartLegend view manually without first initializing an SCILegendModifier with it results in none of the legend cells being loaded. I would imagine this is due to a missing SCILegendDataSource.
It seems like these could be overcome if I could somehow construct a default instance of SCILegendDataSource. Unfortunately, SCILegendDataSource only exposes one initializer which requires I pass it a xib name for the legend items. But I do not want to customize the legend items- I simply want to be able to construct the default SCILegendDataSource because that is apparently required to get the SCIChartLegend working.
Am I making this more complicated than it needs to be? What’s the simplest path to placing the chart legend where I want in iOS?
- Sean Young asked 5 years ago
- last active 5 years ago
i want to insert 500 data on the left of chart.
then, it freezes slightly.
so, i want to present indicator.
how can i listen to start and end of drawing?
- mssup mssup asked 5 years ago
- last active 4 years ago
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
Hello, I’m trailing your library right now. I’m wondering how to change the background color of the legend box. The document page for LegendModifier shows coming soon. I don’t see such option in LegendModifier definition in Xcode either. Thanks
- Haoran Xie asked 5 years ago
- last active 5 years ago
We’d like to customize the look of our legends. We have 4 legends displaying different data, but right now the only thing we can change is the Theme. Is there any way to customize the legend items, like add some icons, change the point marker shape and size, change the check box icon etc…
P.S.: I’m not a trial user. We have an iOS, Android and WPF licenses purchased.
Project info:
Xamarin.iOS
SciChart.iOS 2.2.2.854
- Lazar Nikolov asked 5 years ago
- last active 5 years ago
Andrew required swift code so I attach the code.
Please answer my question again.
https://www.scichart.com/questions/question/customize-chart-designwith-pic
https://www.scichart.com/questions/question/cannnot-remove-weird-square-areas
Andrew answered second question, but it didn’t work.
There is no drawAxisBands.
- Minsub Kim asked 5 years ago
- last active 5 years ago
I have a simple line renderable series in iOS with an SCIDateTimeAxis for X and an SCINumericAxis for Y. At this point all I’m trying to do is format the Y-axis labels and cursor labels as currency. According to the documentation, this should be as simple as:
yAxis.textFormatting = "$%f"
But it does not appear to properly use this formatting. The Y-axis is showing values like “$%f1400” when formatting a value for 14.
So, I instead attempted creating my own label provider by overriding SCINumericLabelProvider:
class CurrencyLabelProvider: SCINumericLabelProvider {
static let formatter: NumberFormatter = {
let formatter = NumberFormatter()
formatter.numberStyle = .currency
return formatter
}()
override func formatLabel(_ dataValue: SCIGenericType) -> NSAttributedString! {
let value = dataValue.doubleData
let string = CurrencyLabelProvider.formatter.string(from: NSNumber(value: value))!
return NSAttributedString(string: string)
}
}
Then assigning:
yAxis.labelProvider = CurrencyLabelProvider()
This works to properly format the axis labels. So, I also override SCINumericLabelProvider to provide the cursor labels:
override func formatCursorLabel(_ dataValue: SCIGenericType) -> NSAttributedString! {
let value = dataValue.doubleData
let string = CurrencyLabelFormatter.formatter.string(from: NSNumber(value: value))!
return NSAttributedString(string: string)
}
This then properly formats the cursor label for the Y-axis- but it also formats the X-axis cursor:
At this point, the X-axis is already assigned an SCIDateTimeLabelProvider- the X-axis is not assigned CurrencyLabelProvider. But it seems to be overridden by the Y-axis label provider or simply unused. The X-axis labels are formatted as dates properly, but X-axis cursor values are just numbers when not being interfered with by the Y-axis label provider.
Am I misunderstanding something or are these all bugs in the iOS SDK? We’re currently evaluating whether this package will meet our needs and it certainly appears to be riddled with issues.
- Sean Young asked 5 years ago
- last active 5 years ago
registerVisibleRangeChangedCallback is not enough for me.
I want an active stop function like this.
surface.stopScroll()….
- Minsub Kim asked 5 years ago
- last active 5 years ago
yAxis.textFormatting = “%f”
First image file is the result of this code.
yAxis.textFormatting = “0.00000000”
Second image file is the result of this code.
First code doesn’t work, even it is just a sample code in document.
Second code works, but I want flexible trailing zeros.
How can I do?
- Minsub Kim asked 5 years ago
- last active 5 years ago
I wanna make chart area background color white.
And I implemented it like below.
surface.xAxes.defaultAxis()?.style.gridBandBrush.color = .white
surface.yAxes.defaultAxis()?.style.gridBandBrush.color = .white
Then, some part became white, but not whole area.
I wanna remove those black areas, so I used theme manager, and it worked.
SCIThemeManager.applyTheme(toThemeable: surface, withThemeKey: “SciChart_Bright_Spark”)
surface.xAxes.defaultAxis()?.style.gridBandBrush.color = .white
surface.yAxes.defaultAxis()?.style.gridBandBrush.color = .white
But, this is not reasonable. I use that theme, only to change background color.
Is there another way to acheive white background?
- Minsub Kim asked 5 years ago
- last active 5 years ago
When scrolling, some weird bold lines appear and disappear.
You can see it on image files attached.
How can i fix it?
- Minsub Kim asked 5 years ago
- last active 5 years ago
I don’t find limit line
How can I implement limit line without using Fast Line series?
- Rustem Muzafarov asked 5 years ago
We’re trying to make multiple legends on the screen, for example, 1 for the left axis and its data series, 1 for the right axis and its data series. I can see it’s possible in the WPF documentation, but in the iOS documentation it says “Coming soon!”. Do we need to wait for a future release of the Xamarin.iOS library or is it possible somehow now?
By the way, I’m not a trial user. We’ve just purchased a license today.
Thanks,
Lazar Nikolov
- Lazar Nikolov asked 5 years ago
- last active 5 years ago
I’m always getting an Unsorted Data Error when I’m running the Xamarin on iOS simulators, but it doesn’t happen if I run the app on a real iOS device. Does anyone have any idea what could the problem be?
Thanks,
Lazar Nikolov
[email protected]
- Lazar Nikolov asked 6 years ago
- last active 6 years ago
Hi,
I am using sci chart version 2.2.1.2256 in that I am getting date wrong, I have attached image please go through it.Here I am sending previously how I am getting date and now what I am getting.
I am using date formatter “dd/MM/yyyy”
finalDateStr = “29/08/2016” and finalWeightStr = “76.7”
dataSeries.appendX(SCIGeneric(dateFormatt.date(from: finalDateStr)!), y: SCIGeneric(finalWeightStr))
- NanoHealth IT asked 6 years ago
- last active 6 years ago
Have recently converted to xcode 10 and swift 4.2.
Am now receiving this error message on build.
SciChart.framework/SciChart
Reason: no suitable image found. Did find:
/usr/lib/libstdc++.6.dylib: mach-o, but not built for iOS simulator
Any ideas?
- Russ Warwick asked 6 years ago
- last active 6 years ago
Hi Sir/Madam,
I have created a Mountain Series with gradient fill. below is part of my code:
-(SCIRenderableSeriesBase *)getTimeSharePlot:(SCIXyDataSeries*)xySeries{
SCIFastMountainRenderableSeries * rSeries = [SCIFastMountainRenderableSeries new];
rSeries.dataSeries = xySeries;
rSeries.strokeStyle = [[SCISolidPenStyle alloc] initWithColor:[UIColor colorWithRed:0 green:0 blue:0 alpha:1] withThickness:1];
rSeries.areaStyle = [[SCILinearGradientBrushStyle alloc] initWithColorStart:[UIColor colorWithRed:32/255.0 green:56/255.0 blue:124/255.0 alpha:1.0] finish:[UIColor whiteColor] direction:SCILinearGradientDirection_Vertical];
return rSeries;
}
When i run the test, the chart is just filling with solid color
Would you please help?
BR,
Tommy
- tommy ng asked 6 years ago
- last active 6 years ago
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…
- Andreas Svensson asked 6 years ago
- last active 6 years ago
I am following the MultiPaneStockChart example. I want to sync multiple chart and I want to sync it on x axis. but it’s not happening although zoom and pinch is working.
Can anyone point me what am I missing?
- Krishnakumar Sudersan asked 6 years ago
- last active 6 years ago
I’m trying to make a chart with a “toggle function”.
The “toggle function” what i wanted to make is this.
- enter to UIViewController which Chart is in it
- before singleTap on a chart, a chart has zoomPanModifier, XAxisDragModifier,, etc
- after make singleTap on the chart, that chart has only CursorModifier.
- 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)
- 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..?
- eunteak koh asked 6 years ago
- last active 6 years ago
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
- Jonas Olsson asked 6 years ago
- last active 4 years ago
Hi,
Im tryin to create an effect where I have a static point on the Y Axis and I want to perform zoom in, so what I did is to increase or decrease the Max visible range, what I’m left with is the rubber band effect where my static point isn’t static anymore because the point in “Stretching” in the direction I’m zooming.
- Alon Shmueli asked 6 years ago
- last active 6 years ago
Hi All,
I’ve been trying to get SciCharts and the IOS UIScrollview to work together and have been running into a couple of issues.
The main storyboard has 7 SciChart surfaces plotting realtime data embedded inside a single UI scrollview controller.
1) Charts don’t render when scrollview is actively scrolling
Everything works fine during normal operation and we don’t try to scroll.
Once a finger is placed on the screen, the SciCharts surface stops redrawing. This could be due to the fact that the ‘Scroll’ thread is handled in the UITouch thread and perhaps has higher priority. I don’t know if there is anyway to change the priority of the render routine. I can confirm that everything until ‘Update Data’ and Chart.InvalidateElement() is being called during a scroll action.
2) Scrolling is disallowed when Chart surface is as large as scrollview
This may not be exactly due to scichart but if anyone faced this problem before it would help. If you attempt to scroll when the SciChartSurface is as large as the parent UIScrollView, it doesn’t scroll. Almost like the SciChart surface has the priority of touch and doesn’t let the scroll view see the scroll.
I would greatly appreciate if anyone successfully got UIScrollview and Scicharts working well together. I might be doing a bunch of rookie mistakes.
Cheers,
Mithrandir
Adding a quick update,
I could fix (2) by disable User Interactions of the Chart.
Note that you can’t simply disable this in the Main Storyboard, this has to be done programmatically by calling
ChartName.isUserInteractionEnabled = false
So the only real issue is (1), getting the chart to render while scrollview is active.
- Sree Harsha Angara asked 6 years ago
- last active 6 years ago
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])
}
}
}
- JaeHwan Seol asked 6 years ago
- last active 6 years ago
Hi,
we are using an UICollectionView to display different kinds of views in our application, including charts created with SciChart. We noted that every time a cell with a SciChart is loaded, some memory is allocated and not freed when the cell disappears, which leads to a massive memory leak and eventually crashes the application.
Is there a way to free SciChart resources on demand? Or maybe you suggest another solution to solve this issue?
Regards,
Anna
- Anna Lazar asked 6 years ago
- last active 6 years ago
When there are 2 or more horizontal/vertical axis, how to hide the cursor label for specific axis?
- Chris Yeung asked 6 years ago
- last active 4 years ago
Hello,
I am unable to install SciChart pod.
The podfile has multiple pods with multiple platforms and source.
I get the error saying ” [!] Unable to find a specification for ‘SciChart’.”
Please advice..
use_frameworks!
pod 'UICircularProgressRing'
pod 'Alamofire'
platform :ios, '8.0'
source 'https://github.com/CocoaPods/Specs.git'
pod 'SideMenu'
source 'https://github.com/ABTSoftware/PodSpecs.git'
pod 'SciChart', :git => 'https://github.com/ABTSoftware/PodSpecs.git'
- Lakshmi H R asked 6 years ago
- last active 6 years ago
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?
- Clifford Bateman asked 6 years ago
I’ve been pouring through the documentation and examples and cannot find an example of this. Has anyone been able to accomplish this and willing to share an example? Thanks.
- Clifford Bateman asked 6 years ago
I have been trying to find a tutorial for ViewPortManagers for IOS and Xamarin.ios. Has anyone been able to pull this off and willing to share an example?
- Clifford Bateman asked 6 years ago
- last active 6 years ago
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
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
- Patryk Zoltowski asked 6 years ago
- last active 6 years ago
Hi all,
I want to use CategoryDateTimeAxis in my chart but also i want to format Date.
I found in documentation CategoryDateTimeAxisLabelProvider class but examples are not working and
this part does not exist anymore.
// Get the axis controller which has the XAxis data on it as dates
let controller = dtAxis?.currentController as? SCIArrayController
My question:
How to get seconds or dates based on min and max values from visibleRange to format it properly?
- Marcin C asked 6 years ago
I would like to restrict the chart to cap at the extents while panning, but chart stretches at the extents. I could able to set clip mode for X axis in SCIZoomPanModifier, same way I would like to set clip mode Y axis but I couldn’t.
Please help me to restrict my chart to not move after chart data extents.
Thanks,
Vadivel Muniswamy.
- Vadivel Muniswamy asked 6 years ago
- last active 6 years ago
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.
- Michael Chartier asked 6 years ago
Using iOS 11.2 and Xcode 9.2 and Swift 4
My chart includes two SCIXyDataSeries objects rendered by SCIFastLineRenderableSeries. Also I am using these chart modifiers: SCIPinchZoomModifier, SCILegendModifier, SCIZoomPanModifier
My Y axis is configured with autoRange set to always. Auto range works great as I pan left-and-right. However the Y axis does not “auto range” when I disable one of the data series by tapping on the legend. When I pan left-and-right I can see the auto-range adjusting the Y axis to fit the data set that is no longer visible. Any way to fix this?
Two screen shots are attached. The first shows both data sets visible. The second shows how the Y axis does not change when I de-select the yellow data series.
- Michael Chartier asked 6 years ago
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?
- Michael Chartier asked 6 years ago
- last active 6 years ago
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.
-
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.
-
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.
- Tam Nguyen asked 6 years ago
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)
}
- Christoph Rehbichler asked 6 years ago
- last active 6 years ago
I need someone to develop this chart for me and I will provide a JSON, for the data.
https://www.youtube.com/watch?v=t29Zl-7QyMw&t=215s
Please go to time line 3:22
I have been struggling in the documentation and if someone can create this chart for me, I will be more than happy to pay you.
The chart would have to be created for Swift 4 please.
Robert
- Robert De Saeger asked 6 years ago
- last active 6 years ago
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).
- Nicholas Provost asked 6 years ago
- last active 6 years ago
Could I have a date please.
is it possible for the December or more likely for January?
robert
- Robert De Saeger asked 6 years ago
- last active 6 years ago
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
- Robert De Saeger asked 6 years ago
- last active 6 years ago
Hi,
I have two question on iOS Chart.
1.How can I customize the display value for tooltip generated by SCICursorModifier? I would like to set the following:
15/06/2017
O: 99.35
H: 99.35
L: 98.30
C: 98.75
The text color of OHLC value should be set according to prev. close value.
2.The function setVisibleRange is working for SCIDateTimeAxis but not SCICategoryDateTimeAxis
Here is the initialization of the axis:
id axis = [[SCICategoryDateTimeAxis alloc] init];
axis.axisId = @”X1″;
[axis setAutoRange:SCIAutoRange_Never];
[axis setVisibleRangeLimitMode:SCIRangeClipMode_MinMax];
[surface.yAxes add:axis];
Set the visible range after receiving the data
SCICategoryDateTimeAxis *xAxis = (SCICategoryDateTimeAxis *)[[surface xAxes] getAxisById:@”X1″];
[xAxis setVisibleRange:[[SCIDateRange alloc] initWithDateMin: Max:]];`
I tried to replace the axis type from SCICategoryDateTimeAxis to SCIDateTimeAxis, it works well. Any idea about this?
- Chris Yeung asked 7 years ago
- last active 7 years ago
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
- Dan Pidcock asked 7 years ago
- last active 7 years ago