Pre loader

Forums

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0 votes
0 answers
7k views

Hi, guys

Is there possibility to show CursorModifier by simply changing switch state?

According to custom tooltip behaviour it is possible for SCITooltipModifier. And it’s work at v 2.0.0.xxxx

So can you provide a code with redefinitions of private Api methods for this situation?

UDP: What is the best practice to customize tooltip’s data view?

Best regards,
Sushynski Andrei

0 votes
6k views

Hi everyone,

I have a scroll view containing (among others) subviews with SciChart surfaces. I use this method:

 [self.scrollView.layer renderInContext:UIGraphicsGetCurrentContext()];

… to take a screenshot of the whole scroll view (render it as a UIImage). All charts are rendered as black rectangles. Same thing happens if I use “Capture view hierarchy” in XCode – black rectangles where there should be a chart.

Any ideas?

  • Igor Peric asked 7 years ago
  • last active 7 years ago
1 vote
3k views

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

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

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

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

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

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

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

This is my code for creating box Annotation:

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

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

0 votes
6k views

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

In the document below, there is a phrase “Our server-side licensing component is written in C++.”
(https://support-dev.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?

  • Igor Peric asked 7 years ago
  • last active 7 years ago
1 vote
0 answers
6k views

I was not able to find any sample code for macOS swift on gitHub to I tried to convert the iOS one for Mac and I grabbed the key from Scichart Licensing Wizard then initialised it in app delegates didFinishLaunchingWithOptions but I am facing this issue of invalid License token.

grab the code from here:

https://drive.google.com/file/d/1POIiKuEXaa7zNlbdcwruzIEyuN5QjkMq/view?usp=sharing

0 votes
6k views

Hi, guys

I have some data series like:

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

Also my Y axis is kind of class SCINumericAxis

So my question is

if i’m trying add value to the series

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

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

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

Best regards,
Sushynski Andrei

0 votes
6k views

When i try to add SCITextAnnotation and text color is white, a gray outline appears around the symbol (triangle).
How can I turn it off or change the color?

0 votes
13k views

I am using an SCINumericAxis for my y-axis. I am setting the visibleRange to (Min = 28, Max = 76). I am leaving the minorsPerMajor to the default of 5. However when looking at my graph (attached) you can see that the major tick labels are actually every 6 minors, e.g. 30, 36, 42, etc. when they should be 30, 35, 40, etc for minorsPerMajor set to 5.

Please advise on how to fix this issue as my major tick labels should be every 5, not every 6.

  • Brad Taber asked 4 years ago
  • last active 4 years ago
-1 votes
0 answers
4k views

Hi I am using pod ‘SciChart’, ‘3.0.1-nightly.5114’.

Q1)How get selected series instance, index. How to change the color of the selected series.(Using UITapGestureRecognizer and HitTest).

Q2)How to show only Min and Max tick label value of Y Axis. Just want to hide the intermediate tick labels in between Min and Max of Y Axis.

Q3)How to give some spaces at beginning and end of the series in Scichart.

Q4)How to hide the square gray stroke around the Scichart.

1 vote
0 answers
5k views

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]

0 votes
5k views

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

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

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

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

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


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

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

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

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.

0 votes
0 answers
2k views

Hi,

I’m using SciChart for macOS (v4.4.2.5871 installed via CocoaPods) and I’m trying to restrict the X axis’ visibleRange as described in https://www.scichart.com/documentation/ios/current/axis-ranging—restricting-visiblerange.html but what I’m getting is the app hanging so badly that even “Pause program execution” doesn’t work (I need to “Stop the running scheme or application”).
The sample code for this issue is super basic and is attached to this ticket, but in a nutshell the lines causing issues are:

xAxis.visibleRangeChangeListener = { axis, oldRange, newRange, _ in
    if newRange.minAsDouble < -10 {
        axis.visibleRange = oldRange
    }
}

The scenario to reproduce the problem is to pan until you hit -10 on X axis.

Let me know if I’m missing something obvious or if this is indeed an issue.

P.S. I have one more problem with setting the visibleRange , but I will open a different ticket because the behavior is different.

  • Vlad Badea asked 8 months ago
  • last active 8 months ago
0 votes
5k views

I am plotting a line chart and in it I have a requirement to plot different sets of points in different colours. How can I achieve this ?

I am setting the colour as below

[[(SCIFastLineRenderableSeries*)self.renderableSeries style] setLinePen: [[SCIPenSolid alloc] initWithColor:[UIColor redColor] Width:1]];

However, this sets the colour for the whole data series in line chart.

I have attached the screenshot of the desired output.

  • Chui asked 7 years ago
  • last active 7 years ago
1 vote
7k views

Is it possible to disable editing annotations via user drag?

0 votes
3k views

I have a question about an apparent regression/change from v2 to v4.

My chart uses an SCIHorizontallyStackedColumnsCollection with three SCIStackedColumnRenderableSeries instances. One of those is assigned to the right-hand Y axis, and the other two are assigned to the left-hand Y axis. Left and right Y axes have very different ranges.

In v2, each series in the group honored its assigned axis. In v4, each series is using the scale of the left-hand Y axis. This happens regardless of the order I add the renderable series to the columns collection.

In the example below, the magenta, blue, and yellow bars have a range of -2 to 2, and are assigned to the left-hand axis. The green bars have a range of 0 to 30 and are assigned to the right-hand axis. I expect all 4 bars to be displayed using the full vertical range of the chart, but instead everything is using the left-hand axis, and the non-green bars have very little displacement.

This is a change in behavior from v2 to v4. Is it intentional? Is there an easy workaround?

I tried to hack around it by having two different SCIStackedColumnRenderableSeries instances, one with 3 placeholder series/1 real series (RH axis) and the other with 1 placeholder/3 real series (LH axis). That doesn’t help. If there are two different column collections on the chart, they both use the left-hand axis, regardless of the order that they are added.

Minimal repro case is attached. But the crux is at the end. If I comment out the .add(rightStacks) call, I get desired behavior for the stack assigned to the left axis. If I comment out the .add(leftStacks), I get desired behavior for the stack assigned to the right axis. What I want is the chart I’d get by overlaying the second and third screenshots, but with the 0 point of left and right Y axis aligned.

    let rightStacks = SCIHorizontallyStackedColumnsCollection()
    rightStacks.add(rsRightPlaceholder1)
    rightStacks.add(rsRightPlaceholder2)
    rightStacks.add(rsRightPlaceholder3)
    rightStacks.add(rsRight)
    surface.renderableSeries.add(rightStacks)

    let leftStacks = SCIHorizontallyStackedColumnsCollection()
    leftStacks.add(rsLeftSine)
    leftStacks.add(rsLeftSingle)
    leftStacks.add(rsLeftDouble)
    leftStacks.add(rsLeftPlaceholder)
    surface.renderableSeries.add(leftStacks)

Edit

I think I’ve found the cause.

If I manually set (at line 46) yAxisLeft.axisId = “yAxisMyLeft”, then when I render, I get this in the console log:

2021-03-10 16:02:07.993233-0800 SciChart POC[86749:4815412] [WARNING] – [Render Warnings] Could not draw a renderable series of type SCIHorizontallyStackedColumnsCollection. YAxis with Id == DefaultAxisId doesn’t exist. Please ensure that the YAxisId property is set to a valid value.

2021-03-10 16:02:08.509648-0800 SciChart POC[86749:4815412] [WARNING] – [Render Warnings] Could not draw a renderable series of type SCIHorizontallyStackedColumnsCollection. YAxis with Id == DefaultAxisId doesn’t exist. Please ensure that the YAxisId property is set to a valid value.

I conclude from this behavior that SCIHorizontallyStackedColumnsCollection is hardwired to the default axis internally, regardless of the settings of the collection members.

1 vote
4k views

After seeing some strange behavior in my application, I have a simple repro case where hiding a renderable series that’s in a vertically stacked columns collection causes the entire screen to go black. I’ll attach a full viewDidLoad() below, but here’s the basic setup:

    let rsLeftSingle = SCIStackedColumnRenderableSeries()
    rsLeftSingle.dataSeries = dataSeriesLeftSingle
    rsLeftSingle.yAxisId = yAxisLeft.axisId
    rsLeftSingle.fillBrushStyle = SCISolidBrushStyle(color: UIColor.yellow)
    rsLeftSingle.strokeStyle = SCISolidPenStyle(color: UIColor.yellow, thickness: 2.0)

    let rsLeftDouble = SCIStackedColumnRenderableSeries()
    rsLeftDouble.dataSeries = dataSeriesLeftDouble
    rsLeftDouble.yAxisId = yAxisLeft.axisId
    rsLeftDouble.fillBrushStyle = SCISolidBrushStyle(color: UIColor.blue)
    rsLeftDouble.strokeStyle = SCISolidPenStyle(color: UIColor.blue, thickness: 2.0)

    let stacks = SCIVerticallyStackedColumnsCollection()
    stacks.add(rsLeftSingle)
    stacks.add(rsLeftDouble)
    surface.renderableSeries.add(stacks)

    let legendModifier = SCILegendModifier()
    surface.chartModifiers.add(legendModifier)

That code displays a stack of yellow and blue bars, with a legend and checkboxes (both checkboxes selected). When I tap a checkbox to deselect it, the SCIChartSurface() goes blank, the legend remains on screen, and I see this message in the console:

Exception raised with reason: All stacked series in on collection should have the same amount of X Values

When I reselect that checkbox, I get my plot back.

There are no changes being made to the underlying data. Hiding/showing works correctly for horizontally stacked collection and for other renderable series types.

What’s your recommended workaround?

0 votes
8k views

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

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

Looking forward to any recommendations.

Best Regards,
Paul.

0 votes
3k views

Good day!
I need to determine the value of the visible graph y from the x value and the problem is that I can’t calculate the y value outside of the data I’m rendering
example data:
[
{ x:1, y: 10 },
{ x:5, y: -5 },
{ x: 9, y: 15}
]

I use SCISplineMountainRenderableSeries and I need to show the intersection of the graph at point 3.5
I need a point but I have only one coordinate value

how can i get this y value?

0 votes
2k views

Hi, guys

My x axis is SCICategoryDateTimeAxis class type. And it’s limited by VisiableRangeLimit like:

[xAxis setVisibleRangeLimit:[[SCIDoubleRange alloc] initWithMin:SCIGeneric(firstItem – (lastItem – priorItem))
Max:SCIGeneric(lastItem + (lastItem – priorItem))]];

Also for scrolling my content inside chart:

SCIZoomPanModifier * zpm = [[SCIZoomPanModifier alloc] init];
[zpm setModifierName:@"PanZoom Modifier"];
[zpm setClipModeX:SCIZoomPanClipMode_ClipAtExtents];

Like a description SCIZoomPanClipMode_ClipAtExtents says:
“forces the panning operation to stop suddenly at the extents of the data” – but it’s not working constantly.
Sometimes it’s allow to scroll outside the range. Like on the attached image.

So my question is how to limit scrolling by min and max value?

Best regards,
Sushynski Andrei

0 votes
4k views

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

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

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

I added screenshots.

Thanks,
Alexey.

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

I am trying to add a legend to my chart similar to how is done in the LegendChartView.swift code in the sample app. However the legend does not show and I get several NSLayoutConstraints conflicts such as this one:

[LayoutConstraints] Unable to simultaneously satisfy constraints.   Probably at least one of the constraints in the following list is one you don't want.   Try this:       (1) look at each constraint and try to figure out which you don't expect;       (2) find the code that added the unwanted constraint or constraints and fix it.  (
    "<NSLayoutConstraint:0x283528af0 UIButton:0x13c52d840.height == 25   (active)>",
    "<NSLayoutConstraint:0x2835285f0 UIButton:0x13c52d840.bottom == UIView:0x13c545060.bottom - 4   (active)>",
    "<NSLayoutConstraint:0x2835285a0 V:|-(4)-[UIButton:0x13c52d840]   (active, names: '|':UIView:0x13c545060 )>",
    "<NSLayoutConstraint:0x283528b40 'UIIBSystemGenerated' SCIDefaultLegendItem:0x13c543f90.top == UIView:0x13c545060.top   (active)>",
    "<NSLayoutConstraint:0x283528b90 'UIIBSystemGenerated' V:[UIView:0x13c545060]-(0)-|   (active, names: '|':SCIDefaultLegendItem:0x13c543f90 )>",
    "<NSLayoutConstraint:0x283529c20 'UIView-Encapsulated-Layout-Height' SCIDefaultLegendItem:0x13c543f90.height == 0   (active)>" )

Will attempt to recover by breaking constraint  <NSLayoutConstraint:0x283528af0 UIButton:0x13c52d840.height == 25   (active)>

The internal SCIDefaultLegendItems look to keep setting their width and height to 0 which causes conflicts with the underlying UIButton and UILabel components.

Any thoughts on how to get around this? My chart has four series. I have seen the article on drawing the legend outside the chart surface area however I do not want to do that.

Thank you!

  • Brad Taber asked 4 years ago
  • last active 4 years ago
0 votes
9k views

On device, there is an unwanted border line on the SCIChartSurface. Please refer to the screenshot.

I tried removing this by setting the border width and setting it’s colour as white as below
self.surface.view.layer.borderColor = [[UIColor whiteColor]CGColor];
self.surface.view.layer.borderWidth = 2.0f;
However, this does not set the border of the SCIChartSurface.

How do I remove this unwanted border line?

  • Chui asked 7 years ago
  • last active 7 years ago
1 vote
6k views

In Scichart 2, we had some code that added some annotations in the SCIAnimation completion block. Here’s a snippet. We need the self.renderAnnotations() to happen AFTER the chart data range is set, because we only draw annotations that will fit within the individual bar stack elements.

        SCIUpdateSuspender.usingWithSuspendable(sciChartSurface) {
            if hasBarData {  
                self.sciChartSurface?.renderableSeries.add(columnCollection)
                let animation = SCIWaveRenderableSeriesAnimation(duration: 1, curveAnimation: .easeOut)
                animation.completionHandler = {
                    self.renderAnnotations()
                    self.configurationButtons?.forEach { $0.isUserInteractionEnabled = true }
                }
                columnCollection.addAnimation(animation)
            }

Here’s the current rewrite to run under Scichart 4. With this code, yAxisLeft.visibleRange has not been updated to the correct data range when renderAnnotations() is called.

Uncommenting the 3 animator-related lines near the bottom doesn’t make a difference, and my listener function is never called.

I’ve also tried wrapping the renderAnnotations() call in a DispatchQueue.main.asyncAfter() call. That sometimes works, and sometimes results in renderAnnotations() not being called at all.

How do I get renderAnnotations() (and the following line looping on configurationButtons) to run, reliably, after the axis range setup is complete?

How do I get my wave animation back?

        SCIUpdateSuspender.usingWith(sciChartSurface) {
            if hasBarData { 
                self.sciChartSurface?.renderableSeries.add(columnCollection)
                    self.renderAnnotations()
                self.configurationButtons?.forEach { $0.isUserInteractionEnabled = true }
//                let animator = SCIAnimations.createWaveAnimator(for: columnCollection)
//                animator.add(self)
//                animator.start()
            }
0 votes
4k views

I just requested a trial key and notice that it say I have to put a license call into my app.

Does this mean my app will require internet so it can verify a license when the user starts the app?

Will it do this all the time?

I do not like this at all. I don’t want my customers asking why my app requires internet and is contacting some server when they start the app.

1 vote
9k views

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

surface.backgroundColor

But that just changes the axis background color

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

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

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

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

1 vote
6k views

Hello!
I tried to draw relative line annotations but can’t get expected behavior.

I have a chart with date x axis and numeric y axis. I want to draw line from (x1, y1) to (x2, y2) where:
x1 = deal.startQuoteDate
y1 = deal.startQuoteRate
x2 = deal.endQuoteDate
y2 = deal.startQuoteRate

func activeDealAnnotations() -> [SCILineAnnotation] {
    return bnd_activeDeals.map { deal in
        let lineAnnotation = SCILineAnnotation()
        lineAnnotation.xAxisId = self.xAxisId
        lineAnnotation.yAxisId = self.yAxisId
        lineAnnotation.coordMode = .Relative
        lineAnnotation.style.linePen = SCIPenSolid(color: UIColor.whiteColor(), width: 0.5)
        lineAnnotation.xStart = SCIGeneric(deal.startQuoteDate)
        lineAnnotation.xEnd = SCIGeneric(deal.endQuoteDate)
        lineAnnotation.yStart = SCIGeneric(deal.startQuoteRate)
        lineAnnotation.yEnd = SCIGeneric(deal.startQuoteRate)
        return lineAnnotation
    }
}

I also tried different configurations of the line annotation to check the validity of x and y values.

lineAnnotation.coordMode = .RelativeX
lineAnnotation.xStart = SCIGeneric(0)
lineAnnotation.xEnd = SCIGeneric(1)
lineAnnotation.yStart = SCIGeneric(deal.startQuoteRate)
lineAnnotation.yEnd = SCIGeneric(deal.startQuoteRate)

lineAnnotation.coordMode = .RelativeY
lineAnnotation.xStart = SCIGeneric(deal.startQuoteDate)
lineAnnotation.xEnd = SCIGeneric(deal.startQuoteDate)
lineAnnotation.yStart = SCIGeneric(0)
lineAnnotation.yEnd = SCIGeneric(1)

lineAnnotation.coordMode = .RelativeY
lineAnnotation.xStart = SCIGeneric(deal.endQuoteDate)
lineAnnotation.xEnd = SCIGeneric(deal.endQuoteDate)
lineAnnotation.yStart = SCIGeneric(0)
lineAnnotation.yEnd = SCIGeneric(1)

The lines draws at expected parts of the chart. Now I’m sure that the values are valid and the problem is in the configuration.

Could you help me to do it right?

1 vote
8k views

I’m trying to render a column chart with multiple series. I want the two series to show side-by-side. See the reference image attachment for how I want it to look.

However, when I add a second series to a surface, the two series overlap and draw over each other, such that you can ‘t see some of the column data points.

Is there a way to draw multiple series that don’t overlap?

While I’m here, a have a couple of more questions:

• Is there a way to show more of the values on the time/date series X-axis . Notice in the SciChart column chart that is attached it shows every third value on the X-axis (Jan, April, July, October). It would be great if I could show every two, or all for each data point.

• For a time/date series X-axis, can I show a different representation of the time/date values? Specifically, I want to show, e.g.

Jan 17

rather than

01-2017

Presumably one would specify a different date formatter but I only see how to do variations of “MM-dd-yyy”. I want to show values as textual rather than numeric.

• Is there a way to extend the Y-axis to go higher?
In the SciChart column chart attachment, the Y-axis goes up to 100, but the values go higher. I would like to show the the Y-axis going up to 120.

• Is there a way to change the interval of the Y-axis?
Instead of showing every 20 values, can I show every 25 values?

Thanks.

  • doughill asked 7 years ago
  • last active 7 years ago
1 vote
5k 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
7k views

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?

1 vote
5k views

Hi,

I’m using SciChart for macOS (v4.4.2.5871 installed via CocoaPods) and one thing that I tried was to implement the an axis to show full extent of data, as described in the first bullet of https://www.scichart.com/documentation/ios/current/axis-ranging—get-or-set-visiblerange.html#zooming-to-fit-all-the-data

However, what I’m getting is that after setting the visibleRange to match the dataRange, the dataRange no longer reflects the “true” range, but something else. Also “zoom to extent” no longer works

Attached is a super basic example (project) for this. To reproduce, do the following:

  1. Do a zoom (via pinch)
  2. Click the button titled “Set visibleRange to dataRange” -> this step works as expected
  3. Do a zoom
  4. Click again the button -> “zoom to extent” no longer works, dataRange is messed up
  • Vlad Badea asked 8 months ago
  • last active 8 months ago
1 vote
7k views

I’m updating from Xamarin iOS SciChart v2 to v3 and just hit the issue that i can not use a custom TickProvider because there is no overridable UpdateTicks method.

I could not find any TickProvider code in the v3 Examples so the docs are my only source:
https://www.scichart.com/documentation/ios/current/axis-ticks—tickprovider-and-deltacalculator-api.html

According to the docs, I should override SCINumericTickProvider or SCIDateTickProvider

class CustomNumericTickProvider: SCINumericTickProvider
{
    public override void UpdateTicks(SCIDoubleValues minorTicks, SCIDoubleValues majorTicks)
    {
       //...
    }
}

But there is no UpdateTicks method to override.
I tried to override the Update() method instead:

public override void Update()
{
    Ticks.Clear();

    Ticks.MajorTicks.Add(5);
    //...
}

But that is just causing a freeze/crash at runtime.

It’s worth noting that it works well on Android because there is a UpdateTicks method to override.

What should I do?

  • Wil O asked 4 years ago
  • last active 4 years ago
0 votes
6k views

There are no simple macOS tutorial projects, so I transplant ios “Tutorial 01 Create Simple 2D Chart” to macOS one. (Attached file.)

Build and Run successfully. But no appear the coded chart. It seems that only SCIChartSurface is being displayed. (without axis and line series)
I enabled SciChart Console Debugging and got like this.

2021-09-17 20:48:06.077950+0900 StoryboardTest[75014:920684] [INFO] - [SCIAxisBase] isSuspended = YES. Ignoring `invalidateElement:` call
2021-09-17 20:48:06.078006+0900 StoryboardTest[75014:920684] [INFO] - [SciChartSurfaceBase] IsSuspended=YES. Ignoring `invalidateElement:` call

Why doesn’t the chart show up? Would you mind giving me some advice?

P.S.
It seems that the file was not attached properly.
Please download the file from here.
https://drive.google.com/file/d/1YfJIf0G14QOxA0fzmEQXyAEbPrfMx4CU/view?usp=sharing

0 votes
8k views

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

How can I implement that in iOS.

0 votes
8k views

I cannot get SCILinearGradientBrushStyle working on a donut chart. Only radial gradients work

Here is my code sample:

let segment = SCIPieSegment()
segment.fillStyle = SCILinearGradientBrushStyle(colorCodeStart: 0xff007aff, finish: 0x4D007aff, direction: .horizontal)
segment.value = 100.0
segment.title = "Segment"
donutSeries.segments.add(segment)

The segment just renders a flat color

0 votes
3k views

I am trying to zoom and pan the line graph in my macOS app the zoom is working but I am not able to pan through the zoomed graph its not at all scrolling and also I wanted to know how can I add click event on the graph so that I can display some more data on click at a particular coordinate apart from tooth. I have shared my view controller. I will really appreciate any help as I have spend a lot of time figure this out and have no clue where to go from here.

0 votes
7k views
1 vote
10k views

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

1 vote
8k views

Hi,

Is there any possible way to get axis value for a point in chart view? I use pan gesture to get the touch location and convert it to its context point but cannot find the value for that CGPoint.

Thanks,
Irmak

1 vote
2k views

Hello there,

I am new to SciChart and trying to implement custom SCICursorModifiers tooltip,

It’s almost done, except one issue, i.e I am not able to hide the X axis (or) Horizontal line which is in green colour, it is showing up in the background whenever I am trying to use the tooltip.

The line which needs to be hidden

I tried with following below code but it is not working

extension SCIChartTheme {
    static let berryBlue: SCIChartTheme = SCIChartTheme(rawValue: "SciChart_SciChartv4DarkStyle")
}

SCIThemeManager.addTheme(.berryBlue, from: Bundle.main)

Is there any way to achieve this

Thanks in Advance

1 vote
4k views

Try to integrate new SciChart.xcframework 4.2.0 instead of SciChart.framework 2.0 to the project and build failed in Xcode 12.4 with the next errors:
RNSciCandlestickChart.swift:
1) 335th line: Editor placeholder in source file
dates.add(date!))
2) 549th line: Cannot convert value of type ‘Bundle.Type’ to expected argument type ‘Bundle’ SCIThemeManager.addTheme(byThemeKey: theme, from: Bundle)
3) 768th line: Method does not override any method from its superclass
override func internalHandleGesture(_ gestureRecognizer: UIGestureRecognizer)
AnnotationDragListener.swift:
1) 4th line: Cannot find type ‘SCIAnnotationDragListener’ in scope
class AnnotationDragListener: SCIAnnotationDragListener
RNSciLineChart.swift:
1) 475th line: Editor placeholder in source file
SCIThemeManager.addTheme(byThemeKey: theme, from: Bundle)
Can you tell me please can I launch SciChart.xcframework 4.2.0 in Xcode 12.4? Any how to solve this issues?

0 votes
0 answers
10k views

Hello,

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

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

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

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

    override func viewDidLoad() {
        super.viewDidLoad()

        layout()

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

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

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

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

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

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

        surface.xAxes.add(axis)
    }

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

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

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

        let rolloverModifier = SCIRolloverModifier()

        let legend = SCILegendModifier()

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

        sciChartSurface?.chartModifiers = groupModifier
    }

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

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

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

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

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

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

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

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

Thanks.

0 votes
10k views

Hi, guys

My X axis is SCICategoryDateTimeAxis type.

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

Best regards,
Sushynski Andrei

0 votes
4k views

After upgraded SciChart to SciChart_iOS_SDK_3.0.0.5074, using rollover modifier on a SciChart surface which was embedded into a scroll view will crash the app. It crashed when user scroll horizontally on a SciChart surface inside a horizontal scrollable scrollview. It is the same with the vertically scrollable scrollview.

2020-03-09 10:14:15.489302+0800 ******[4835:62890] -[SCIRolloverModifier onTouchesCancelled:]: unrecognized selector sent to instance 0x60000ba28500

2020-03-09 10:14:15.503967+0800 *******[4835:62890] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[SCIRolloverModifier onTouchesCancelled:]: unrecognized selector sent to instance 0x60000ba28500’
*** First throw call stack:
(
0 CoreFoundation 0x00007fff23c7127e exceptionPreprocess + 350
1 libobjc.A.dylib 0x00007fff513fbb20 objc_exception_throw + 48
2 CoreFoundation 0x00007fff23c91fd4 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x00007fff23c75c4c
forwarding + 1436
4 CoreFoundation 0x00007fff23c77f78 _CF_forwarding_prep_0 + 120
5 SciChart 0x000000011139aaba -[SCITouchModifierBase onEvent:] + 186
6 SciChart 0x000000011135dfd8 +[SCIEventManager raiseOnEvent:toTarget:isMaster:] + 267
7 SciChart 0x000000011132d03f __38-[SCIEventDispatcher p_SCI_commonInit]_block_invoke + 165
8 SciChart 0x000000011132d45d -[SCIEventDispatcher raiseOnEvent:withAction:] + 569
9 SciChart 0x000000011133fa94 -[SCIChartSurfaceBase p_SCI_onTouchEvent:] + 233
10 SciChart 0x000000011133f996 -[SCIChartSurfaceBase touchesCancelled:withEvent:] + 209
11 UIKitCore 0x00007fff480bf863 forwardTouchMethod + 340
12 UIKitCore 0x00007fff480bf974 -[UIResponder touchesCancelled:withEvent:] + 49
13 UIKitCore 0x00007fff480bf863 forwardTouchMethod + 340
14 UIKitCore 0x00007fff480bf974 -[UIResponder touchesCancelled:withEvent:] + 49
15 UIKitCore 0x00007fff480a4a43 __106-[UIApplication _cancelViewProcessingOfTouchesOrPresses:withEvent:sendingCancelToViewsOfTouchesOrPresses:]_block_invoke + 609
16 UIKitCore 0x00007fff480a429e -[UIApplication _cancelTouchesOrPresses:withEvent:includingGestures:notificationBlock:] + 1163
17 UIKitCore 0x00007fff480a47ac -[UIApplication _cancelViewProcessingOfTouchesOrPresses:withEvent:sendingCancelToViewsOfTouchesOrPresses:] + 158
18 UIKitCore 0x00007fff47c37f2f -[UIGestureEnvironment _cancelTouches:event:] + 707
19 UIKitCore 0x00007fff47c40115 -[UIGestureRecognizer _updateGestureForActiveEvents] + 1779
20 UIKitCore 0x00007fff47c31eda _UIGestureEnvironmentUpdate + 2706
21 UIKitCore 0x00007fff47c3140a -[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:] + 467
22 UIKitCore 0x00007fff47c3117f -[UIGestureEnvironment _updateForEvent:window:] + 200
23 UIKitCore 0x00007fff480d04b0 -[UIWindow sendEvent:] + 4574
24 UIKitCore 0x00007fff480ab53b -[UIApplication sendEvent:] + 356
25 UIKit 0x0000000114ad2bd4 -[UIApplicationAccessibility sendEvent:] + 85
26 UIKitCore 0x00007fff4812c71a __dispatchPreprocessedEventFromEventQueue + 6847
27 UIKitCore 0x00007fff4812f1e0 __handleEventQueueInternal + 5980
28 CoreFoundation 0x00007fff23bd4471 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
29 CoreFoundation 0x00007fff23bd439c __CFRunLoopDoSource0 + 76
30 CoreFoundation 0x00007fff23bd3b74 __CFRunLoopDoSources0 + 180
31 CoreFoundation 0x00007fff23bce87f __CFRunLoopRun + 1263
32 CoreFoundation 0x00007fff23bce066 CFRunLoopRunSpecific + 438
33 GraphicsServices 0x00007fff384c0bb0 GSEventRunModal + 65
34 UIKitCore 0x00007fff48092d4d UIApplicationMain + 1621
35 ****** 0x000000010b51505f main + 143
36 libdyld.dylib 0x00007fff5227ec25 start + 1
37 ??? 0x0000000000000001 0x0 + 1
)

  • Gary Chan asked 4 years ago
  • last active 4 years ago
0 votes
0 answers
7k 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?

Showing 51 - 100 of 314 results