ReetuBok / MIMChart-Library

iPhone/iPad chart library
http://mimchartlibrary.blogspot.com/
173 stars 32 forks source link

Group/Stack Bars doesnt show xAxis Labels #7

Open susrisha opened 11 years ago

susrisha commented 11 years ago

I have been trying this for a while. I have tested even in the usage files. It doesnt show the bottom xAxis for the grouped or bar charts. Its working fine for line and simple bar charts. Not working group and stacked bar charts. Please help me out here.

susrisha commented 11 years ago

I have got a work around for this. But the code is with me. I will be able to help you ouy.

ReetuBok commented 11 years ago

sorry...I will be able to look at during weekend.. But I have changed a lot of code in the library..restructured and stuff....so even if I upload the new code you will to replace lot of things... But good luck ... thats why it is opensource :)

Adrian2013 commented 11 years ago

doesnt show the bottom xAxis for the grouped or bar charts. PLEASE help me..!

Hbosamia commented 10 years ago

Check out mr. ProgMan comment on http://mimchartlibrary.blogspot.com.au/2012/07/bar-graph.html

You can edit XAxisBand.m at line 298 as follows:

else if(barChart && stackedBarChart) { float offset=scalingFactor; for (int i=0; i<[xElements count]; i++) {

XAxisLabel *label; int v;

if(xIsString) v=i; else v=[[xElements objectAtIndex:i] intValue];

if(style==3){

label=[[XAxisLabel alloc]initWithFrame:CGRectMake(offset, 0, scalingFactor, /15.0/xAxisHeight)]; label.style=5; label.width=scalingFactor; } if(style ==1) { label=[[XAxisLabel alloc]initWithFrame:CGRectMake(offset+(0.4_scalingFactor) , 0, 50, /15.0/xAxisHeight)]; label.style=1; label.width=50; } if(style ==2) { label=[[XAxisLabel alloc]initWithFrame:CGRectMake(offset+(0.1_scalingFactor) , 0, 50, /15.0/xAxisHeight)]; label.style=2; label.width=50; }

offset+=scalingFactor; label.height=xAxisHeight; label.lineChart=lineChart; label.text=[NSString stringWithFormat:@"%@",[xElements objectAtIndex:i]]; label.fontSize=fontSize; [label drawTitleWithColor:lineColor]; [self addSubview:label];

offset+=groupGapDistance; }