SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components
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.
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
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
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
Please login first to submit.