开发者

CorePlot - XAxis - iPhone

I am using the coreplot for displaying the graph in iPhone. I want to display the label(10,20,30 .. ) properly in the plotArea. Currently, The bar and label are displaying in uneven format. How to solve this ?

Code :

x.axisLineStyle = nil;
    x.majorTickLineStyle = nil;
    x.minorTickLineStyle = nil;
    x.majorIntervalLength = CPDecimalFromString(@"10");
    x.orthogonalCoordinateDecimal = CPDecimalFromString(@"0");
    x.title = @"Age Limit";
    x.titleLocation = CPDecimalFromFloat(30.0f);
    x.titleOffset = 35.0f;
    x.la开发者_如何学CbelRotation = M_PI/2;![enter image description here][1]
    x.labelOffset = 5.0f;

CorePlot - XAxis - iPhone


Two things I would check:

  1. Make sure the barOffset property of your bar plot is zero (0).

  2. Verify that the locations returned by your datasource are what you expect (0, 10, 20, etc.).

Eric


i think you need to maintain array rightly.

currently you having an array xAxisLabels(if you follow code from net) or other one for showing texts labels on x axis you need to remove first value that is 0.0 and then adjust x axis (CPXYAxis) properties according to you.


Its better to use the following method instead of using lables....

plotSpace.xRange = [CPPlotRange plotRangeWithLocation:CPDecimalFromInteger(0) length:CPDecimalFromInteger(15)];

Otherwise there is the example in coreplot framework itself for x-axis with label text.....

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜