从HighChart Objective-C中删除导出按钮

从HighChart Objective-C中删除导出按钮,objective-c,highcharts,Objective C,Highcharts,在iOS中,是否仍然可以从折线图中删除导出按钮 下面是我的代码: HIChartView *chartView = [[HIChartView alloc] initWithFrame:self.lineGraphView2.bounds]; chartView.tintColor = [UIColor greenColor]; HIColor *color = [[HIColor alloc] initWithHexValue:@"283445"]; HIColor *greeCo

在iOS中,是否仍然可以从折线图中删除导出按钮

下面是我的代码:

HIChartView *chartView = [[HIChartView alloc] initWithFrame:self.lineGraphView2.bounds];
    chartView.tintColor = [UIColor greenColor];

HIColor *color = [[HIColor alloc] initWithHexValue:@"283445"];

HIColor *greeColorHex = [[HIColor alloc] initWithHexValue:@"00B84A"];
HIColor *redColorHex = [[HIColor alloc] initWithHexValue:@"A3001F"];
//    color = [color initWithHexValue:@"000000"];

HIChart *chart = [[HIChart alloc] init];
chart.plotBackgroundColor = color;
chart.backgroundColor = color;

HICredits *credits = [[HICredits alloc] init];
credits.enabled = @0;

HIExporting *exporting = [[HIExporting alloc] init];
exporting.enabled = @0;

HIOptions *options = [[HIOptions alloc]init];
options.exporting.enabled = false;

HITitle *title = [[HITitle alloc]init];
title.text = @"";

HISubtitle *subtitle = [[HISubtitle alloc]init];
//    subtitle.text = @"Source: thesolarfoundation.com";

HIYAxis *yaxis = [[HIYAxis alloc]init];
yaxis.title = [[HITitle alloc]init];
yaxis.title.text = @"";
yaxis.gridLineColor = color;
yaxis.gridLineWidth = @0;


HILegend *legend = [[HILegend alloc]init];
legend.layout = @"vertical";
legend.align = @"right";
legend.verticalAlign = @"middle";

HIPlotOptions *plotoptions = [[HIPlotOptions alloc] init];
plotoptions.series = [[HISeries alloc] init];
plotoptions.series.label = [[HILabel alloc] init];
plotoptions.series.label.connectorAllowed = [[NSNumber alloc] initWithBool:false];
plotoptions.series.lineWidth = @2;

HILine *line1 = [[HILine alloc]init];
line1.name = @"Shares Price";
line1.data = graphPointsMutableArray;
line1.color = greeColorHex;
line1.threshold = @10;

HIResponsive *responsive = [[HIResponsive alloc] init];

HIRules *rules1 = [[HIRules alloc] init];
rules1.condition = [[HICondition alloc] init];
rules1.chartOptions = @{
                        @"legend" : @{
                                @"layout": @"horizontal",
                                @"align": @"center",
                                @"verticalAlign": @"bottom"
                                }

                        };
responsive.rules = [NSMutableArray arrayWithObjects:rules1, nil];

options.title = title;
options.subtitle = subtitle;
options.yAxis = [NSMutableArray arrayWithObject:yaxis];
options.legend = legend;
options.plotOptions = plotoptions;
options.series = [NSMutableArray arrayWithObjects:line1, nil];
options.responsive = responsive;
options.chart = chart;
options.credits = credits;
options.exporting = exporting;
options.exporting.enabled = @0;
options.labels.enabled = @0;

chartView.options = options;

[self.lineGraphView2 addSubview:chartView];

我已经在文档中阅读了设置
exporting.enable=false
,但它不起作用。

viewForHeaderInSection
方法集exporting=NO

它将隐藏3条按钮有关更多详细信息,请参见下面的屏幕截图:


下面是我在Swift中找到的解决方案。基本上,您必须创建一个HINavigation对象和一个HIButtonOptions对象。将button options enabled属性设置为false后,可以将导航的button options属性设置为button options对象,然后将HIOptions对象的导航对象设置为创建的导航对象。我的obj-c不够好,无法尝试在obj-c中输入,因此下面是我的解决方案的Swift版本:

// init your options object
let options = HIOptions()

// hide hamburger button
let navigation = HINavigation() // init navigation object
let buttonOptions = HIButtonOptions() // init button options object
buttonOptions.enabled = false
navigation.buttonOptions = buttonOptions
options.navigation = navigation

您多次将导出设置为false,将其更改为仅设置一次,就像在swift中那样:

options.exporting = HIExporting()
options.exporting.enabled = NSNumber.init(booleanLiteral: false)

你能给我们图书馆的链接让我们检查一下吗。@NiravKotecha右上角的“i”信息按钮你必须隐藏在右边吗?@NiravKotecha右上角有3个栏的按钮。请问你在哪里操作?我没有使用任何tableview或任何东西,这里有点混乱。这是HighFit library文件夹-->视图中提供的
DataTableViewController.m
文件。您可以浏览其中的pod文件夹,找到HighFit文件夹-->视图部分和
DataTableViewController.m
文件。我从您的回答中得到提示,需要将启用设置为@NO,exporting.enabled=@NO;