Axis in Plot Area?


#1

The legend can be placed inside of the plot area. Can the axis information also be placed there? I’ve looked through lots of different styles, but don’t see any value that lets me do this yet.


#2

I’m throwing darts here, but not having much luck. I tried the following setup:

yAxis.style.majorTickStyle.tickGap = @-40;
yAxis.style.majorTickStyle.lineLength = @0;
yAxis.style.majorTickStyle.textAlignment = NSTextAlignmentRight;

This kind of gets what I want, but not really, a couple pixels are lost. But the tickGap obviously affects the plot frame, because it goes to the edge (past in fact). Hoping for answers. Working with the eval right version right now… 


#3

Instead of changing the tick style, it might be easier to use the “sChart:alterTickMark:beforeAddingToAxis:” method, and change the tickMark.tickMarkView.center and tickMark.tickLabel.center


#4

OK, I’m getting there. Here’s what I have right now:

http://imagebin.org/308721

(I tried the insert image thing and couldn’t figure it out)

The code I used is two part. In my setupChart method:

yAxis.axisPosition = SChartAxisPositionReverse;
	yAxis.style.gridStripeStyle.showGridStripes = YES;
	yAxis.style.majorTickStyle.showTicks = NO;
	yAxis.style.majorTickStyle.tickGap = @0;
	yAxis.style.majorTickStyle.lineLength = @0;
	yAxis.style.majorTickStyle.labelColor = [UIColor blackColor];
	yAxis.style.lineWidth = @0;

And I added the method you suggested:

- (void)sChart:(ShinobiChart *)chart alterTickMark:(SChartTickMark *)tickMark beforeAddingToAxis:(SChartAxis *)axis {
	CGPoint center = tickMark.tickLabel.center;
	center.x -= 30;
	tickMark.tickLabel.center = center;
}

So it kindof works. But it leaves the gap on the right side still. Which I don’t want. Any suggestions how to fix that?

Also, is there a way to make the edge labels of the axis show fully instead of being clipped half? (maybe this is a different topic)


#5

The best I can suggest is to increase the width of the chart so the space is not so obvious. Depending on what else is going on in your app, you may also want to change the background color of the chart/canvas to be clear too.