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

-2 votes
0 answers
5k views

I don’t find limit line
How can I implement limit line without using Fast Line series?

0 votes
5k views

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

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

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

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

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

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

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

0 votes
6k views

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

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

  • Haoran Xie asked 5 years ago
  • last active 5 years ago
1 vote
6k views

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?

1 vote
6k views

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

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 .

0 votes
6k views

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).

0 votes
0 answers
8k views

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.

0 votes
8k views

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.

0 votes
7k views

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).

2 votes
9k views

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

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

0 votes
5k views

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?

0 votes
0 answers
8k views

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

0 votes
6k views

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

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

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

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

Any thoughts?

0 votes
8k views

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.

0 votes
5k views

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

0 votes
4k views

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

1 vote
0 answers
5k views

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.

0 votes
6k views

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.

1 vote
5k views

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

0 votes
9k views

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?

0 votes
5k views

How can I hide the default segment value label drawn automatically?
I need the solution for both iOS and Android version.

0 votes
8k views

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

0 votes
5k views

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

0 votes
0 answers
4k views

I am trying SciChart iOS.

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

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

yAxis.style.labelStyle.alignmentHorizontal = SCILabelAlignmentHorizontal_Right;

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

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

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

1 vote
6k views

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?

0 votes
8k views

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.

-1 votes
9k views

Hello Team,

In Pie Chart with DonutSeries, the segment spacing seems to have no effect on graph.

donutSeries.segmentSpacing = 10

Thanks

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

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.

1 vote
8k views

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

.

There is not such class method in the iOS SDK called SciChartSurface.Padding

Thanks for your help

0 votes
8k views

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

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

0 votes
5k views

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

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

    sciChartSurface.zoomExtents()

}

Code to add ScichartSurface is

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

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

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

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

    seriesCollection.add(rSeries1)
    seriesCollection.add(rSeries2)
    self.sciChartSurface.xAxes.add(SCINumericAxis())
    self.sciChartSurface.yAxes.add(SCINumericAxis())
    self.sciChartSurface.renderableSeries.add(self.seriesCollection)
    self.sciChartSurface.chartModifiers = SCIChartModifierCollection(childModifiers: [SCITooltipModifier()])
     self.seriesCollection.addAnimation(SCIWaveRenderableSeriesAnimation(duration: 3, curveAnimation: .easeOut))
    }
  • Keshav Raj asked 5 years ago
  • last active 5 years ago
0 votes
10k views

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

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

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

     self.surface.backgroundColor = UIColor.clear
     self.surface.isOpaque = false
     self.surface.renderableSeriesAreaFill = SCISolidBrushStyle(color: UIColor.clear)
     self.surface.renderableSeriesAreaBorder = SCISolidPenStyle(color: UIColor.clear, withThickness: 0)
  • Ayush Jain asked 5 years ago
  • last active 5 years ago
0 votes
4k views

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

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

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.

0 votes
8k views

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?

0 votes
5k views

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

0 votes
4k views

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.

Showing 101 - 150 of 314 results