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.
- Vikas Ahuja asked 5 years ago
- last active 4 years ago
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
How to make chart axis (date axis in my case) to move with scrolling?
Because currently labels staying on it’s positions and just refreshing its values.
let xAxis = SCIDateTimeAxis()
xAxis.axisId = ChartWrapper.SURFACE_MAIN_X_AXIS_ID
xAxis.autoRange = .never
xAxis.visibleRange = sharedXRange
xAxis.style.drawMajorBands = false
xAxis.style.drawMajorTicks = false
xAxis.style.drawMinorTicks = false
xAxis.style.drawMinorGridLines = true
xAxis.textFormatting = "HH:mm:ss"
xAxs.style.drawLabels = true
Best regards, Vadim
- Kirey Vadim asked 5 years ago
- last active 4 years ago
Hello there
I’m looking for any solution to work with milliseconds timestamps (like that one 1563448997279), but haven’t found anything yet.
Is it possible to handle them without losing precision?
Solutions like drop milliseconds not working for me.
One more question to developers:
What is the difference in SCIDataType_DateTime and SCIDataType_SwiftDateTime?
In source code i only found this:
@field SCIDataType_DateTime – NSDate
- Kirey Vadim asked 5 years ago
- last active 5 years ago
We have a graph surface with some point markers on it and we want to show a custom tooltip every time the user taps on a point marker. So far I’ve used a UITapGestureRecognizer, convert the touchpoint in the chart frame and for each of the renderable series perform a HitTestAtX with a radius (I’ve tried 1, 5 and 30) but it always returns true, even if I tap on an area where there’s a gap in the chart. Here’s some sample code:
SCIHitTestInfo hitTestInfo = renderableSeries.HitTestProvider.HitTestInterpolateModeAtX(touchPoint.X, touchPoint.Y, 30, renderableSeries.CurrentRenderPassData);
if (hitTestInfo.match)
{
Console.WriteLine($"Tapped {hitTestInfo.xValue} {hitTestInfo.yValue} with index {hitTestInfo.index} of the series {renderableSeries.DataSeries.SeriesName}");
var elementSeries = Model.BottomRightLegendList.FirstOrDefault(tup => tup.DataSeries.SeriesName == renderableSeries.DataSeries.SeriesName);
var element = elementSeries.GraphElement;
if (element != null)
{
matchedElements.Add(element);
}
}
Why is the “match” property always true, even if there are no Point Markers in the radius?
- Lazar Nikolov asked 5 years ago
- last active 5 years ago
Hi
I have a SCIFastLineRenderableSeries backed by data in SCIXyDataSeries.
I setup FIFO to 300 (this just a number I may increase, but it stores 30+ seconds of data)
x data is time stamp.
each time I have new data, I set a new visibleRange to show about 30 seconds of data on screen
xAxis.visibleRange = [[SCIDoubleRange alloc] initWithMin:SCIGeneric(secondSinceStart-31) Max:SCIGeneric(secondSinceStart)];
So this will scroll along showing latest 30 seconds of data. And that’s great.
But I want to scroll to the left to view the older data. because of the visibleRange is set I am not able to touch the axis labels and do anything)
how do I set the visibleRange or maybe not set it, so I can enable the scroll.
Here is the drag modifier I use , but I think it does not do anything either because of the visibleRange
SCIXAxisDragModifier * xAxisDragmodifier = [SCIXAxisDragModifier new];
xAxisDragmodifier.dragMode = SCIAxisDragMode_Pan;
xAxisDragmodifier.clipModeX = SCIClipMode_None;
Thanks
- Jeremy H asked 5 years ago
- last active 4 years ago
i want to implement a custom modifier to track the users touch, similar to rollover but without displaying a view
I tried to do this by implementing SCIGestureModifier and overriding all the onTouches methods, but – no matter the user behaviour – the modifier will always receive an onTouchesCancelled event after about a second and receive no more of these events after that.
What does work is implement onPanGesture to actually track all the user’s movement but i don’t see any way of how you would receive a touch up event this way (which i do need)
Is there any fundamental misunderstanding on how this should work on my side?
- Hubert Weid asked 5 years ago
- last active 5 years ago
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?
- Vikas Ahuja asked 5 years ago
- last active 1 month ago
So for both SCIZoomPanModifier and SCIXAxisDragModifier you can set a clip mode, that will cause the graph to not zoom in if you try to scroll past the edges.
This is not possible for the y-axis however, so everytime anyone scrolls up or down to far, the graph zooms in, which is not useful to anyone ever
Is there any way to change this behaviour at all?
Thanks in advance
- Hubert Weid asked 5 years ago
- last active 4 years ago
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
- Manish Malviya asked 5 years ago
- last active 4 years ago
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)
}
}
- Kirey Vadim asked 5 years ago
- last active 4 years ago
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.
- Alexey Moshkin asked 5 years ago
- last active 4 years ago
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
this is crash log just scroll left kline . please tell me how to deal with . (lldb) bt
thread
1 , queue = ‘com.apple.main-thread’, stop reason = EXCBADACCESS (code=1, address=0x0) frame
0 : 0x000000011290beb0 SciChart-[p_SCI_29RJjaaEk0 prs_rB:A:B:D:] + 772 frame 1: 0x000000011290b9f8 SciChart-[pSCI29RJjaaEk0 oexecuteMode:XColumn:YColumn:PointRange:VisibleRange:ViewPortWidth:LastPointSeries:isCategory:] + 684 frame
2 : 0x0000000112962c24 SciChart-[SCIXyDataSeries toPointSeriesWithResamplingMode:SCIIndexRange:ViewportWidth:IsCategoryAxis:VisibleRange:Resampler:] + 332 frame 3: 0x0000000112924420 SciChart+[pSCI29ASj923jdOIJIO29 scrrSWXA52f:A:B:C:D:E:F:] + 792 frame
4 : 0x0000000112923f48 SciChart-[p_SCI_29ASj923jdOIJIO29 scr_prDws:A:] + 1160 frame 5: 0x0000000112922b34 SciChart-[pSCI29ASj923jdOIJIO29 scrrL32e23:] + 212 frame
6 : 0x00000001128c5680 SciChart-[SCIChartSurface onRenderSurfaceDraw] + 220 frame 7: 0x000000011293e39c SciChart-[SCIRenderSurfaceBase onRenderTimeElapsed] + 240 frame
8 : 0x0000000112951240 SciChart-[SCIOpenGLRenderSurface onRenderTimeElapsed] + 192 frame 9: 0x0000000114964254 GPUToolsCore-[DYDisplayLinkInterposer forwardDisplayLinkCallback:] + 176 frame
10 : 0x0000000187453710 QuartzCoreCA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 672 frame 11: 0x0000000187507c5c QuartzCoredisplaytimercallback(CFMachPort, void, long, void*) + 240 frame
12 : 0x00000001834b4290 CoreFoundation__CFMachPortPerform + 188 frame 13: 0x00000001834cf000 CoreFoundationCFRUNLOOPISCALLINGOUTTOASOURCE1PERFORMFUNCTION_ + 56 frame
14 : 0x00000001834ce704 CoreFoundation__CFRunLoopDoSource1 + 440 frame 15: 0x00000001834cc1d8 CoreFoundation__CFRunLoopRun + 2196 frame
16 : 0x00000001833ebe58 CoreFoundationCFRunLoopRunSpecific + 436 frame 17: 0x0000000185298f84 GraphicsServicesGSEventRunModal + 100 frame
18 : 0x000000018ca6b67c UIKit`UIApplicationMain + 236
frame
19 : 0x00000001034ce07c FXChatmain at AppDelegate.swift:15:20 frame 20: 0x0000000182f0856c libdyld.dylibstart + 4
- ke zhang asked 5 years ago
- last active 5 years ago
I want to hide the axis and the place occupied by the axis on xammarin.iOS, i’am using below code to do the same, the problem here is it does hide the axis but it is not removing the place occupied by axis,
Axis.IsVisible = false;
is it the right way to hide the axis and remove the place occupied by it, or am I missing something here.
- [email protected] asked 5 years ago
- last active 5 years ago
Hi.
I’m in process optimizing my app.
I’m using Objective-c.
I’d found some memory leaking issues and successfully fixed some of that.
A first issue was about ‘renderableSeries’ under ‘SCIChartSurfaceView’.
If you set class of UIView as ‘SCIChartSurfaceView’ in interface builder and make outlet without setting ‘strong’ or ‘weak’ in .m file,
It never get released automatically and will stay retained on memory.
For me, it caused about 90MB of memory leaking.
But I could solve this issue manually by putting -(void)clear; method of renderableSeries in viewWillDisappear method.
Another issue is about ‘SCIDateTimeDeltaCalculator’ and ‘SCINumericDeltaCalculator’.
It causes about 50MB of memory leaking.
But problem is, I couldn’t find neither where it’s been called nor how I release this manually.
I will be waiting for your answer.
Thanks.
+)
(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 5 years ago
- last active 5 years ago
We have lots of Point Markers in our series that overlap, so we’re trying to find a way to Cluster them in Android and iOS. I can see that there is an SCIPointMarkerClusterizer. Can you give us some pointers on how we can achieve point marker clustering and/or spacing?
- Lazar Nikolov asked 5 years ago
- last active 5 years ago
Hello,
I am using SCI line chart for Android and iOS. How I can I add Multiple scales on the same graph for different lines?
Please do the needful.
- Piyushkumar asked 5 years ago
- last active 5 years ago
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
I couldnt find IPointMarkerPaletteProvider Interface in SciChart iOS framework. I want to change the color of the point markers of line series on tapping the markers. With IPointMarkerPaletteProvider it would have been easier.
SCIPaletteProvider is there but how do I provide the colors to each markers through that. Is there any other way to go about it ?
- Ayush Jain asked 5 years ago
- last active 5 years ago
I couldnt find IPointMarkerPaletteProvider Interface in SciChart iOS framework. I want to change the color of the point markers of line series on tapping the markers. With IPointMarkerPaletteProvider it would have been easier.
SCIPaletteProvider is there but how do I provide the colors to each markers through that. Is there any other way to go about it ?
- Ayush Jain asked 5 years ago
- last active 5 years ago
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
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
Hey again!
Is there kind of a delegate that notify me if the user uses the crosshair/SCIRolloverModifier?
I want to know which value he is inspecting to show him further information outside the chart for this datapoint.
Thanks and Greeting
Benedikt
- Hubert Weid asked 5 years ago
- last active 5 years ago
Hi all,
I’m trying to use the metal support in a little test project.
I have following lines to enable metal:
if SCIChartSurface.isMetalSupported {
sciChartSurface.renderSurface = SCIMetalRenderSurface(frame: sciChartSurface.bounds)
} else {
sciChartSurface.renderSurface = SCIOpenGLRenderSurface(frame: sciChartSurface.bounds)
}
the surface keeps empty until I remove the
sciChartSurface.renderSurface = SCIMetalRenderSurface(frame: sciChartSurface.bounds)
line – or in other words I use OpenGL.
Then the chart will render properly. I am using an iPhoneX (not simulator).
Thank you for your support!
Wall of Code:
import UIKit
import SciChart
import SnapKit
class ViewController: UIViewController {
// MARK: - UIElements
private var sciChartSurface: SCIChartSurface!
// MARK: - Vars
private var series: SCIXyDataSeries?
// MARK: - Lifecycle
override func viewDidLoad() {
super.viewDidLoad()
setupSurface()
setupData()
renderData()
}
// MARK: - Chart
private func setupSurface() {
// Create a SCIChartSurface. This is a UIView so can be added directly to the UI
sciChartSurface = SCIChartSurface.init(frame: view.bounds)
sciChartSurface.debugWhySciChartDoesntRender = true
view.addSubview(sciChartSurface)
// Detect metal with this static property
if SCIChartSurface.isMetalSupported {
sciChartSurface.renderSurface = SCIMetalRenderSurface(frame: sciChartSurface.bounds)
} else {
sciChartSurface.renderSurface = SCIOpenGLRenderSurface(frame: sciChartSurface.bounds)
}
sciChartSurface.snp.makeConstraints { (make) in
make.edges.equalToSuperview()
}
sciChartSurface.translatesAutoresizingMaskIntoConstraints = true
sciChartSurface.backgroundColor = .gray
// Create an XAxis and YAxis. This step is mandatory before creating series
let xAxis = SCICategoryNumericAxis()
setup(axis: xAxis)
sciChartSurface.xAxes.add(xAxis)
let yAxis = SCINumericAxis()
setup(axis: yAxis)
sciChartSurface.yAxes.add(yAxis)
}
private func setup(axis: SCIAxisBase) {
let axisStyle = SCIAxisStyle()
let majorPen = SCISolidPenStyle(colorCode: 0xFF393532, withThickness: 0.5)
let minorPen = SCISolidPenStyle(colorCode: 0xFF262423, withThickness: 0.5)
let textFormat = SCITextFormattingStyle()
textFormat.fontSize = 16
axisStyle.majorTickBrush = majorPen
axisStyle.majorGridLineBrush = majorPen
axisStyle.gridBandBrush = SCISolidBrushStyle(colorCode: 0xE1232120)
axisStyle.minorTickBrush = minorPen
axisStyle.minorGridLineBrush = minorPen
axisStyle.labelStyle = textFormat
axisStyle.drawMinorGridLines = true
axisStyle.drawMajorBands = true
axis.style = axisStyle
}
private func setupData() {
series = SCIXyDataSeries(xType: .int16, yType: .int16)
TestData.testData.forEach { (testData) in
let xGeneric = SCIGenericType(type: .int16, .init(int32Data: testData.x))
let yGeneric = SCIGenericType(type: .int16, .init(int32Data: testData.y))
series?.appendX(xGeneric, y: yGeneric)
}
}
private func renderData() {
let renderSeries = SCIFastColumnRenderableSeries()
renderSeries.dataSeries = series
sciChartSurface.renderableSeries.add(renderSeries)
}
}
struct TestData {
var x: Int32
var y: Int32
static let testData = [TestData(x: 2017, y: 5),
TestData(x: 2018, y: 8),
TestData(x: 2019, y: 2),
TestData(x: 2020, y: 9)]
}
- Hubert Weid asked 5 years ago
- last active 5 years ago
Hello
is there a way to set the padding (aka reduce the gap) between bars in a SCIFastColumnRenderableSeries?
I attach a screenshot of my current situation: I would like to have zero margin between columns.
I tried searching in the knowledge base but all the answers I found seem to refer to APIs not available in the iOS SDK
- SciChartSurface without paddings (https://www.scichart.com/questions/wpf/how-to-draw-a-pixel-x-millemeter)
- Reduce Chart Padding (https://www.scichart.com/questions/wpf/reduce-chart-padding)
.
There is not such class method in the iOS SDK called SciChartSurface.Padding
Thanks for your help
- Neybox Digital asked 5 years ago
- last active 5 years ago
Can SciChart be used in UITableviewCell? Is it possible to use Software rendering on iOS?
The OpenGL/Metal charts are great, but I suspect Software rendering would be a better for displaying data in UITableViewCells. There are many mobile apps out there that use charts in tableviews and I’d love to be able to use SciChart here too.
- Simon Persson asked 5 years ago
- last active 5 years ago
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
- Sandeep Dhull asked 5 years ago
- last active 5 years ago
Hello Team,
In Pie Chart with DonutSeries, the segment spacing seems to have no effect on graph.
donutSeries.segmentSpacing = 10
Thanks
- Sandeep Dhull asked 5 years ago
- last active 4 years ago
This might need to be two separate questions, but is there a way to select a point in a line series. or, can I style a pointMarker differently for each data point?
I would prefer to not have to do this with annotations.
- Mobile Developers asked 5 years ago
- last active 5 years ago
I’m try to generate a UIImage from a SCIChartSurface into a graphic context using the code below from a view that is not displayed on the screen. The image created is pure black, which indicates it did not draw. If I display the graph in a view on the devices screen, the graph draws correctly.
UIGraphicsBeginImageContextWithOptions(self.chart.bounds.size, NO, 0.0);
[self.chart drawViewHierarchyInRect:self.chart.bounds afterScreenUpdates:YES];
UIImage *chartImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
Are there any special steps that are needed to draw into a graphic context?
- Brian Smith asked 5 years ago
- last active 11 months ago
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.
- Yi Kwan Lam asked 5 years ago
Hi Guys,
I am not able to figure out solution for handling NAN values in iOS which is available in Android in case of FastLineRenderableSeries.
Thanks
- Sandeep Dhull asked 5 years ago
- last active 4 years ago
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.
- Mobile Developers asked 5 years ago
- last active 5 years ago
How can I hide the default segment value label drawn automatically?
I need the solution for both iOS and Android version.
- Sandeep Dhull asked 5 years ago
- last active 5 years ago
I’m trying to create a Modifier for a PieChart Surface. I can not figure out how to get a segment for a point on the screen. With SciChartSurface, you can get the axis, and use its calculator to get a datapoint, or pixel point. Is there something similar in SciPieChartSurface?
- Mobile Developers asked 5 years ago
- last active 5 years ago
In Android we are using initPlacementStrategy with HorizontalLineAnnotations to hide the axis label of annotation when the annotation is scrolled out of the view. So what is the equivalent way in iOS
- Manish Malviya asked 5 years ago
- last active 5 years ago
I’m trying to accomplish 2 things:
First is that I would like to not be able to zoom out past the data, it does no good to zoom out if there is no more data to see. It would also be nice to have a little bounce/spring back if you zoom to far, like when zooming out on an image on an iPhone.
The second is that I only want to be able to pan to the data. If zoomed all the way out, then trying to pan would do nothing. If zoomed in you should be able to scroll around, but only to the end of the data.
I believe I have the first one accomplished by setting the maximalZoomContrain to be the same as the data range, although this doesn’t allow any kind of bounce.
What need to be done to make this work, this seems like a feature that is built into the SciChart Modifiers.
- Mobile Developers asked 5 years ago
- last active 5 years ago
I wan to have a view that is outside of the chart that is updated whenever the chart modifier selection is changed. Is there a way to get notified when the selection changes?
Also, is it possible to get rid of the data views. I guess I could just add a custom view to the rollover modifier that is empty?
What I want to achieve is that when the user is using the rollover modifier to view datapoint the values for that datapoint is shown above the chart. It should also be possible to drill down by clicking on this information.
- Simon Persson asked 5 years ago
I want to modify SCICursorModifier in such a way that while user is doing pan gesture in x direction the line should always be in the centre of candlestick. How can i achieve this. For example there are 3 candlestick visible while panning from 0th x co-ordinate vertical line should be in the centre of first candlestick on more panning it will go to the centre of 2nd candlestick like rollover modifier
- Manish Malviya asked 5 years ago
- last active 5 years ago
I was able to add multiple y axis and able to fill data on different y axis but the problem is all the y axis are overlapping. What I want is how can I segregate y axes in such a way that they should appear one below the other in the same surface. I tried adding two different surface but then I am not able to add single cursorModifier to both surface. Our android developers had used something called YAxisStackedLayoutStrategy to achieeeve this is there any equivalent class for iOS
- Manish Malviya asked 5 years ago
- last active 5 years ago
I’m trying to add annotations on a chart but they are rendering above my legend.
Initially (similar to most of the demo code I’ve seen), I setup my modifiers, then created my series and animated them in — then added my annotations (adding to annotationGroup). This created a timeline of blank chart surface with legend (good so far), annotations popping in before the chart series animated in (weird / not good) and on TOP of the legend (really bad), then the animation of the series after that.
I’ve tried about everything I can think of and the best I’ve been able to do is use a completion block of the animation rendering the series — and moved my chart modifiers (and legend) into that completion block. If I put the annotations in the completion block, they will render after the chart modifier and I have the same problem (even if placed after the chart modifiers). I have to set the annotations before the animation, and then the chart modifier in the completion block will work and the legend will be above the . Of course, this is a bit odd too — as first my annotations pop up by themselves on the blank surface, followed by my series animating in, then at the end of the 2 second animation, the legend just pops in.
I really would like my legend to be rendered first on the blank surface and the annotations and chart series to animate in together under my legend. I’m gathering that’s unlikely (at least the animation part) — but is there anyway I can place my legend first and still have the annotations go under it? It feels like the layers should be: modifiers > annotations > rendered series. I also I’ve read this order before in some WPF docs I believe, but doesn’t seem to be respected on iOS?
UPDATE: My current work around isn’t sufficient because I really need access to the renderable series to create the annotations which means I really can’t defer my chart modifiers (i.e. legend) until after the annotations. Additionally, if I need to update (remove / re-add) an annotation due to a series being deactivated in the legend, now my annotations are on top of the legend again.
- Rich Wardwell asked 5 years ago
- last active 5 years ago
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?
- Rich Wardwell asked 5 years ago
- last active 5 years ago
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?
- Sean Young asked 5 years ago
We have 2 graph surfaces with 2 Y axes on each side, but the label formatting of the axes is different. That makes the axes widths different and therefore both the graphs appear as they have different widths. Is there a way to make the axis widths fixed so the graphs can be the same size?
- Lazar Nikolov asked 5 years ago
- last active 5 years ago
Hi guys,
Is it possible to capture the tap event when we tap on a point marker or a data point? I can see there’s a DataPointSelectionModifier for WPF, but there’s nothing for iOS. Our goal is to show a popup (tooltip) on the point marker when the user taps on it.
Thanks,
Lazar Nikolov
- Lazar Nikolov asked 5 years ago
- last active 5 years ago
I’m trying to create a spectrum viewer with your library. One important feature is a cursor supporting both automatic mode and manual mode. In automatic mode, it stays at the maximum value. In manual mode, it moves with finger panning. It’s close to the SCICursorModifier with the cross lines, but it should always stay on the plot even without touch. Also it should reside on real data points instead of anywhere in between like the SCIRolloverModifier instead of the SCICursorModifier.
Could you give me some advices about how to achieve it? Thanks.
EDIT: after reading more of your documents, I believe HorizontalLineAnnotation and VerticalLineAnnotation are the way to go. I have already added them as the automatic mode cursor. For the manual mode, I still need your help to achieve either:
1) a callback function for the VerticalLineAnnotation drag event, so that I could move both lines to the corresponding data point
or
2) a custom ZoomPanModifier to allow me to distinguish one point or two points touch: one point panning to move the whole plot and two points panning to determine the new cursor location and redraw the two annotations there
EDIT2: I was able to create a custom VerticalLineAnnotation class to handle the panning event. There is one more question left. Right now in order to update the verticallineannotation and horizontallineannotation on the graph, I remove them from sciChartSurface.annotations, change x/y locations and add them back. Is there a redraw or refresh or update function to call directly?
Thanks
- Haoran Xie asked 5 years ago
- last active 5 years ago
Hello,
I managed to implement a chart legend with a custom datasource (using just a SCIChartLegend object as a subview, not SCILegendModifier). However, I am unable to place the legend at specified position, it always snaps to upper-left corner of the screen. When creating a SCIChartLegend instance using the initializer that takes a Rect as a parameter, but not supplying a custom datasource, it draws correctly according to offsets specified by the supplied rect’s X and Y. It does respond to changes in the legendPosition property, but it still doesn’t allow to draw the view with any margins (which is what I’m actually trying to achieve).
- Radosław Opieńka asked 5 years ago
- last active 5 years ago
The numeric axis in our app weirdly displays the range from -2000 until 8000, even if it has or hasn’t got data series appended to it. I tried setting the VisibleRange and VisibleRangeLimit when creating the axis, but still no results. Here’s a piece of the code:
new SCINumericAxis
{
AxisAlignment = SCIAxisAlignment.Left,
AxisId = "axis_id",
TextFormatting = " 0%",
VisibleRangeLimit = new SCIDoubleRange(-30, 100),
VisibleRange = new SCIDoubleRange(-30, 100)
};
The Y values that we have are doubles, example:
[0]: 98.26171875
[1]: 0
[2]: NaN
[3]: 98.26171875
[4]: 0
[5]: NaN
[6]: 78.203125
[7]: NaN
[8]: 38.96484375
[9]: NaN
[10]: 98.28125
[11]: 0
[12]: NaN
[13]: 68.22265625
[14]: 0
So just by looking at the values, we should have a data range from 0 to 100, but I think somehow it messes up the conversion and ends up with ridiculously large numbers. I’m not doing any additional operations on the data, the printed data above is the data from the XyDataSeries. The Y type is Double, the YMin is 0, the YMax is 98, but still ends up drawing the values until 10000.
- Lazar Nikolov asked 5 years ago
- last active 5 years ago
I would like to format several lines differently while still scaling them all to the same YAxis. For example if one line needs to go out to 4 decimal places but then another does not need any decimal values at all i would like those formats to be represented in all of the tooltips with said formats.
- Clifford Bateman asked 5 years ago