Tag: 条形图

如何在CorePlot上显示条形值 – 已绑定的条形图

我已经使用core-plot在我的应用程序中显示堆叠的条形图,我遵循这个漂亮的教程来实现堆积的条形图,现在的graphics如下所示。 “ http://www.gilthonwe.com/2012/06/09/stacked-bar-chart-coreplot-ios/ ” 我用下面的代码来显示栏的值,而用户在屏幕上触摸它们。 -(void)barPlot:(CPTBarPlot *)plot barWasSelectedAtRecordIndex:(NSUInteger)index { if (plot.isHidden == YES) { return; } static CPTMutableTextStyle *style = nil; if (!style) { style = [CPTMutableTextStyle textStyle]; style.color= [CPTColor yellowColor]; style.fontSize = 16.0f; style.fontName = @"Helvetica-Bold"; } NSNumber *price = [NSNumber numberWithDouble:[self doubleForPlot:plot field:CPTBarPlotFieldBarTip recordIndex:index]]; if (!self.priceAnnotation) { NSNumber *x = [NSNumber numberWithInt:0]; NSNumber […]

图表:只有在棒内点击时才能获取选定的棒数据

我在我的项目中使用了https://github.com/danielgindi/Charts库。 这是完美的工作,但我想select只有当用户点击酒吧内的酒吧数据。 目前,它还会在水龙头外面返回小节数据。 当用户敲击酒吧外时,它将提供最近的酒吧数据。 我设置了这样的条形图: _chartView.delegate = self; _chartView.drawBarShadowEnabled = NO; _chartView.drawValueAboveBarEnabled = YES; _chartView.maxVisibleValueCount = 60; ChartXAxis *xAxis = _chartView.xAxis; xAxis.labelPosition = XAxisLabelPositionBottom; xAxis.labelTextColor = [UIColor whiteColor]; xAxis.labelFont = [UIFont systemFontOfSize:20.f]; xAxis.drawGridLinesEnabled = NO; xAxis.spaceBetweenLabels = 2.0; xAxis.labelWidth = 100; ChartYAxis *leftAxis = _chartView.leftAxis; leftAxis.labelFont = [UIFont systemFontOfSize:20.f]; leftAxis.labelCount = 5; leftAxis.labelTextColor = [UIColor […]

coreplot中的x轴标签不显示

我附上了我正在使用的整个代码,但是x轴标签没有被生成。我不知道哪里出了问题。我是核心小区的noob。请帮助我。感谢提前和开心新的年。 #import "BarPlotViewController.h" @interface BarPlotViewController () @end @implementation BarPlotViewController #define BAR_POSITION @"POSITION" #define BAR_HEIGHT @"HEIGHT" #define COLOR @"COLOR" #define CATEGORY @"CATEGORY" #define AXIS_START 0 #define AXIS_END 50 // @synthesize data; @synthesize graph; @synthesize hostingView; – (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { self.data = [NSMutableArray array]; int bar_heights[] = […]

如何在coreplot中设置剧情委托

这是来自这个链接的后续问题: coreplot bar tap不工作 ,答案是: Set the plot delegate to your bar plot delegate object. 有人可以告诉我怎么做。我正在尝试创build一个简单的条形图,只需点击10天,没有任何教程可以用简单的语言来解释这个过程。 这将是一个很大的帮助,我会很感激它。提前感谢。

coreplot酒吧轻拍不工作

我已经从Github上下载了这个代码: https : //github.com/gilthonweapps/CorePlotBarChartExample。如何获得onTap的select吧? 我正在使用下面的代码: #pragma mark – CPTBarPlotDelegate methods -(void)barPlot:(CPTBarPlot *)plot barWasSelectedAtRecordIndex:(NSUInteger)index { NSLog(@"barWasSelectedAtRecordIndex %d", index); } 但是这不起作用(它不认识Tap)。请帮助。 预先感谢和新年快乐。

如何使用Swift 3.0设置BarChart X轴和Y轴标签

在Swift 2.3中,我可以为x轴和y轴设置标签。 但在Swift 3.0中,我无法设置它。 func setChart(dataPoints: [String], values: [Double]) { barChartView.noDataText = "You need to provide data for the chart." for i in 0..<dataPoints.count { let dataEntry = BarChartDataEntry(x: Double(i), yValues: [values[i]]) dataEntries.append(dataEntry) } let chartDataSet = BarChartDataSet(values: dataEntries, label: "INR Rates(₹)/$") let chartData = BarChartData(dataSet: chartDataSet) barChartView.data = chartData barChartView.xAxis.labelPosition = .bottom barChartView.rightAxis.enabled = […]