Issues with new version 2.9.8-3 on iOS


#1

I had a pie chart in our application prior to upgrading to version 2.9.8 that shows the appropriate labels set up in the

func sChart(_ chart: ShinobiChart, alter label: UILabel, forDatapoint datapoint: SChartRadialDataPoint, atSliceIndex index: NSInteger, in series: SChartRadialSeries)

delegate method.

All the other delegate methods are getting called when I debug through the application, but the alter label function above is not being called. Any suggestions?


#2

Hi clehew,

When Swift 3 was released, it required us to make changes to the method signatures of some protocol methods. The changes were made in version 2.9.0 of shinobicharts and are listed in the changelog; I’ve copied them here for reference:

Due to Swift 3.0’s naming convention changes, the following protocol method signatures have been updated and will not get called unless these updates are replicated locally

SChartDelegate:

  • sChart(chart:, toggledSelectionForSeries series:, nearPoint dataPoint: , atPixelCoordinate pixelPoint: to sChart(chart:, toggledSelectionFor series:, near dataPoint:, at pixelPoint:)
  • sChart(chart:, toggledSelectionForRadialPoint dataPoint:, inSeries series:, atPixelCoordinate pixelPoint:) to sChart(_ chart:, toggledSelectionFor dataPoint:, in series:, at pixelPoint:)
  • - sChart(chart:, toggledSelectionForPoint dataPoint:, inSeries series:, atPixelCoordinate pixelPoint:) to sChart(_ chart:, toggledSelectionFor dataPoint:, in series:, at pixelPoint:)
  • - sChart(chart:, crosshairMovedToXValue x:, andYValue y:) to sChart(_ chart:, crosshairMovedToXValue x:, yValue y:)
  • - sChart(chart:, alterLabel label:, forDatapoint datapoint:, atSliceIndex index:, inRadialSeries series:) to sChart(_ chart:, alter label:, for datapoint:, atSlice index:, in series:)
  • - sChart(chart:, setMajorTickFrequency majorTickFrequency:, andMinorTickFrequency minorTickFrequency:, onGeneratingTickMarksforAxis axis:) to sChart(_ chart:, majorTickFrequency:, minorTickFrequency:, onGeneratingTickMarksFor axis:)
  • - sChart(chart:, alterDataPointLabel label:, forDataPoint dataPoint:, inSeries series:) to sChart(_ chart:, alter label:, for dataPoint:, in series:)

So if you update the signature to: sChart(_ chart: ShinobiChart, alter label: UILabel, for datapoint: SChartRadialDataPoint, atSlice index: Int, in series: SChartRadialSeries) it should work as expected.

I hope that helps.

Alison