Horizontal bar graph


#1

Hi All,

I want to implement horizontal bar graph for iPhone.

Is it possible to implement?

Please help me… I am new to this iOS developmnet.

Thanks in advance.


#2

Hi Rashmink,

Thanks for getting in touch!

You can easily manipulate the ColumnSeries sample app to make a bar chart by following these steps:

  1. Swap the X-Axis and Y-Axis around, so the SChartCategoryAxis is assigned to the chart’s Y-Axis and the SChartNumberAxis is assigned to the chart’s X-Axis.

  2. Replace SChartColumnSeries with an SChartBarSeries in the SChartDatasource method “sChart:seriesAtIndex:”.

  3. Swap the SChartDatapoint’s xValue and yValue around in the SChartDatasource method “sChart:dataPointAtIndex:forSeriesAtIndex:”. So the NSString “key” variable is assigned to the yValue and the value from the “_sales” array is assigned to the xValue.

This should now draw you a bar chart.

Let me know if you have any questions. 

Kind Regards,
Andrew Polkinghorn


#3

Thanks a lot  Andrew.

If possible please share me sample example.

It would be great help for me.


#4

Hi Rashmink23,

The ColumnSeries sample Andrew is refering to is in the Samples/ folder of our framework download.

Thanks,
Jan Akerman


#5

I changed my columnSeries into a barSeries and everything worked except for one issue.  The x-axis goes from 0 - 100 (%) but the 100 is off the right side of the chart.  How can I extend the background gradient to the right of the plot area so that the “100” fits on the background?  The background currently ends exactly at the right edge of the plotting area.