Logarithmic Axis


#1

Hi,

We are using ShinobiChart control to display charts with summary sales on iPhone.

One of the charts refers to a top 5 sales ranking (customers, for example). Thus, we have 5 data points, associated to this top 5, and another data point for “Others”.

Since the value of the “Others” may be significantly higher than any of the top 5 data points, the resulting chart is almost imperceptible, as you can see on the image bellow:

chart

This chart was initialized with the following code:

chart = [[ShinobiChart alloc] initWithFrame: chartFrame
                                      withTheme:[[SChartTheme alloc] init]
                                       withPrimaryXAxisType:SChartAxisTypeCategory
                                      withPrimaryYAxisType:SChartAxisTypeNumber];

I’ve searched for examples in order to use logarithmic scales but didn´t find any example.

If we change the code above with the following, then no datatpoint is rendered.

chart = [[ShinobiChart alloc] initWithFrame: chartFrame
                                      withTheme:[[SChartTheme alloc] init]
                                       withPrimaryXAxisType:SChartAxisTypeCategory
                                      withPrimaryYAxisType:SChartAxisTypeLogarithmic];

Is there any way to adjust the scale of the axis so the values presented can be more perceptible?

Thanks in advance.


#2

You could try adjusting the ‘base’ value of the axis - this might help with the scaling. This is a property on the log axis:

@interface SChartLogarithmicAxis : SChartNumberAxis

/** The base of the logarithmic axis. */
@property (nonatomic, retain) NSNumber *base;

@end