Pre loader

SplineLineRenderableSeries doesn't render curved graph line properly in Swift

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
0

SplineLineRenderableSeries doesn’t render curved graph line properly in Swift , it renders stepped line for the data series .For reference please check the Screenshot attached ,ECG line(Green) rendered as stepped line (Marked by rectangle). Let me know anything I need to update in my code

Please find below the code for initialisation go the graph and updating the graph same. I am updating graph realtime with same DataSeries.

  1. Graph initialisation code

    func init_ECG_Chart()
    {
    //Remove Theme From Chart By Apply & Remove & Change Border color
    SCIThemeManager.applyTheme(to: self.ecg_Chart_Surface, withThemeKey: SCIChart_Bright_SparkStyleKey)
    SCIThemeManager.removeTheme(byThemeKey: SCIChart_Bright_SparkStyleKey)

    self.ecg_Chart_Surface.isOpaque = false
    self.ecg_Chart_Surface.backgroundColor = .clear
    self.ecg_Chart_Surface.renderableSeriesAreaBorderStyle = SCISolidPenStyle(color: .clear, thickness: 0)
    
    //Line
    let lineSeries = SCISplineLineRenderableSeries()
    
    lineSeries.strokeStyle = SCISolidPenStyle(color: ecgSelectedColor, thickness: 2.0)
    lineSeries.dataSeries = ecgLineDataSeries
    

    // lineSeries.resamplingMode = SCIResamplingMode_None //Resampling off
    // lineSeries.resamplingMode = SCIResamplingMode_Auto //Resampling off

    let xAxis = SCINumericAxis()
    xAxis.axisAlignment = .bottom
    xAxis.drawLabels = false
    xAxis.drawMajorGridLines = false
    xAxis.drawMinorGridLines = false
    xAxis.drawMajorTicks = false
    xAxis.drawMinorTicks = false
    
    let yAxis = SCINumericAxis()
    yAxis.axisAlignment = .left
    yAxis.drawLabels = false
    yAxis.drawMajorGridLines = false
    yAxis.drawMinorGridLines = false
    yAxis.drawMajorTicks = false
    yAxis.drawMinorTicks = false
    yAxis.autoRange = .never   //Stop auto ranging axis
    yAxis.visibleRange = SCIDoubleRange(min: -32, max: 96)
    

    // yAxis.visibleRangeLimit = SCIDoubleRange(min: -32, max: 96)

    yAxis.growBy = SCIDoubleRange(min: 0.2, max: 0.2)
    
    SCIUpdateSuspender.usingWith(self.ecg_Chart_Surface) {
    
        self.ecg_Chart_Surface.xAxes.add(items: xAxis)
        self.ecg_Chart_Surface.yAxes.add(items: yAxis)
        self.ecg_Chart_Surface.renderableSeries.add(items: lineSeries)
    
        //self.ecg_Chart_Surface.chartModifiers.add(items: SCIZoomExtentsModifier(),SCIPinchZoomModifier())
    }
    

    } //Init ECG

  2. Graph updation code

    func update_ECG_Chart(xValues:SCIDoubleValues,yValues:SCIDoubleValues)
    {

    SCIUpdateSuspender.usingWith(self.ecg_Chart_Surface) {
    
        self.ecgLineDataSeries.append(x: xValues, y: yValues)
      //  self.ecg_Chart_Surface.zoomExtents()
    
        self.ecg_Chart_Surface.zoomExtentsX()
    
    }
    

    } //Update ECG

Version
Latest available for download
Images
  • Oleksandr Shvets
    Hi Djkaran Nasa, Thanks for your inquiry. Unfortunately, we have noticed your license support has expired. If you wish to continue receiving technical support further please consider renewing your support subscription. To do that please contact Sales here: https://www.scichart.com/contact-us/ Or email us at [email protected] With best regards, Oleksandr
  • You must to post comments
0
0

Hi, there.

It is very hard to tell what is wrong without any example, because the Spline line drawing highly depends on the data, that you append to the dataSeries. Probably, there is too much data for such a small visible range but that is only my guess.

Please provide a test example or reproduce your issue on one of our examples so we can reproduce your issue and find a solution for you.

Thanks in advance

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

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

Start TrialCase Studies