0

我在使用 MIMChart 库设置固定颜色集时遇到问题。我正在使用 Ritu Raj MIMChart 库

MIMBarGraph *myBarChart;
myBarChart=[[MIMBarGraph alloc]initWithFrame:CGRectMake(50, 20, myTableView.frame.size.width-    50, myTableView.frame.size.width * 0.5)];
myBarChart.delegate=self;
myBarChart.tag=10+indexPath.row;
myBarChart.isGradient=YES;
myBarChart.groupedBars=YES;
myBarChart.glossStyle=GLOSS_STYLE_1;
myBarChart.xTitleStyle=X_TITLES_STYLE2;
[myBarChart drawBarChart];
[cell.contentView addSubview:myBarChart];
4

1 回答 1

0

试试这个代表

-(NSArray *)colorsForBarChart:(id)graph {
    NSArray *colorsArray;

    MIMColorClass *color1=[MIMColorClass colorWithRed:0.0f/255.0f Green:255.0f/255.0f Blue:127.0f/255.0f Alpha:1];
    MIMColorClass *color2=[MIMColorClass colorWithRed:255.0f/255.0f Green:4.0f/255.0f Blue:0.0f/255.0f Alpha:1];
    MIMColorClass *color3=[MIMColorClass colorWithRed:255.0f/255.0f Green:182.0f/255.0f Blue:193.0f/255.0f Alpha:1];
    MIMColorClass *color4=[MIMColorClass colorWithRed:1.0f/255.0f Green:255.0f/255.0f Blue:255.0f/255.0f Alpha:1];

    colorsArray=[NSArray arrayWithObjects:color1,color2,color3,color4, nil];

    return colorsArray;

}
于 2013-09-21T10:19:11.300 回答