1

I added a secondary axis to my chart using addYAxis:(SChartAxis *)newYAxis. How do I get the second series linked to the new axis?

I found (BOOL)isLinkedToSeries:(SChartSeries *)series in SChartAxis.h. But how do I create the initial link?

cbartel
  • 1,298
  • 1
  • 11
  • 18

1 Answers1

3

When you have multiple axes on a ShinobiChart, then you can use the sChart:xAxisForSeriesAtIndex: and sChart:yAxisForSeriesAtIndex: on the SChartDataSource protocol.

For example, if you have 2 y-axes, and 2 series, and you want the first series associated with the first axes, and the second axis with the second series then implement the following method on your datasource:

- (SChartAxis *)sChart:(ShinobiChart *)chart yAxisForSeriesAtIndex:(int)index
{
    return chart.allYAxes[index];
}
sammyd
  • 883
  • 5
  • 6