我想生成双 y 轴的条形图。我试过这样
-(void)loadGraph
{
_barColors = @[[UIColor cyanColor]];
_currentBarColor = 0;
// CGRect chartFrame = CGRectMake(0.0,
// 0.0,
// 300,
// 300.0);
CGRect chartFrame = CGRectMake(60,128-20,self.view.frame.size.width-40-40,180);//728//1024
_chart = [[SimpleBarChart alloc] initWithFrame:chartFrame];
//_chart.center = CGPointMake(self.view.frame.size.width / 2.0, self.view.frame.size.height / 2.0);
_chart.delegate = self;
_chart.dataSource = self;
_chart.barShadowOffset = CGSizeMake(2.0, 1.0);
_chart.animationDuration = 1.0;
_chart.barShadowColor = [UIColor clearColor];
_chart.barShadowAlpha = 0.5;
_chart.barShadowRadius = 1.0;
_chart.barWidth = 30.0;
_chart.xLabelType = SimpleBarChartXLabelTypeHorizontal;//SimpleBarChartXLabelTypeVerticle;
_chart.incrementValue = 10;
_chart.barTextType = SimpleBarChartBarTextTypeTop;
_chart.barTextColor = [UIColor blackColor];
//
_chart.gridColor = [UIColor clearColor];
//
[scroll addSubview:_chart];
[_chart reloadData];
我只得到一个没有 y 轴值的单轴。任何人都可以帮忙吗?我想用带值的双 y 轴绘制条形图。
提前致谢。
最佳答案
如果您的值为负,请尝试此图,它会显示双 y 轴。 https://github.com/chasseurmic/TWRCharts
关于ios - objective-c 中具有双 y 轴的多个条形图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38656908/