GithubHelp home page GithubHelp logo

highcharts / highcharts-ios Goto Github PK

View Code? Open in Web Editor NEW
124.0 124.0 39.0 595.69 MB

iOS wrapper for Highcharts.

License: Other

Objective-C 4.22% CSS 0.15% HTML 0.01% JavaScript 95.61% Ruby 0.01% Swift 0.01%

highcharts-ios's Introduction

Highcharts JS is a JavaScript charting library based on SVG and some canvas/WebGL.

Highcharts is a source available product. Please refer to shop.highcharts.com for details on licensing.

Installing and using Highcharts

This is the working repo for Highcharts code. If you simply want to include Highcharts into a project, use the distribution package instead, or read the download page.

Please note that there are several ways to use Highcharts. For general installation instructions, see the docs.

Use our CDN

Instead of downloading, you can use our CDN to access files directly. See code.highcharts.com for details.

<script src="https://code.highcharts.com/highcharts.js"></script>

Install from npm

See npm documentation on how to get started with npm.

npm install --save highcharts

ES6 modules, AMD, CommonJS and others

For other ways to use Highcharts in your projects, please refer to our installation docs.

Create your own custom build of Highcharts

To reduce file size, or combine modules into one file to reduce latency, you may want to create your own build of the Highcharts modules. See Creating custom Highcharts files for more information.

Build and debug

If you want to do modifications to Highcharts or fix issues, you may build your own files. Highcharts uses Gulp as the build system. After npm install in the root folder, run gulp, which will set up a watch task for the JavaScript and CSS files. Now any changes in the files of the /js or /css folders will result in new files being built and saved in the code folder. Other tasks are also available, like gulp lint.

npm install
gulp

Node setup for Apple Mx CPU

When running Node natively on ARM64 MacOS, some Node packages like node-canvas with integrated compiling might fail. Install additional tools to resolve the problem:

  • Homebrew and run brew install pkg-config cairo pango libpng jpeg giflib librsvg pixman

Generate API docs

Run in this highcharts repository the doc generator with npx gulp jsdoc-watch, which also starts a new server with the generated API documentation.

highcharts-ios's People

Contributors

cdaitch avatar ihnatmoisieiev avatar mikolajmichalczak avatar mll avatar ratka6 avatar sebastianbochan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

highcharts-ios's Issues

How to change the Highcharts timezone from UTC to local in iOS?

I have a timezone on one of the axis, but the time is converted into UTC timeZone, but I want it to convert it in local timeZone in iOS.
Please let me know how can I do that. I have seen there is a class name HIGlobal, but I am not able to set options using HIGlobal instance.

Can't use lang.drillUpText property

I want to localize the text of drill up button. I searched the api document and it show that i need to set text for lang.drillUpText property. I also created a lang object and set value for lang.drillUpText. But i can't find Highcharts.setOptions to set this "lang" object for it

Carthage support

Is there a way to make this repo Carthage compatible?

I receive the following error when trying to use Carthage

Dependency "highcharts-ios" has no shared framework schemes for any of the platforms: iOS

Want to get tap event on bar chart in iOS native code

Hi,

I am using HighCharts to represent my data, but I want click event when user tap on any bar char, but I want to do some custom things by myself. and don't have any idea how do I get this event in my controller, is there any delegate or any call back that we can use?

Please help me with this, i am waiting for any help.

Resize on Orientation Change

Hello,

maybe this is a trivial issue but I'm fairly new to iOS development so bear with me :)

Currently I have 2 charts in a scrollview below one another - due to the fact that they are generated dynamically I also created the layout constraints in code. Everything works as expected so far except that the charts don't reflow after an orientation change from portrait to landscape and vice versa.

let chartView2 = HIGChartView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: 400))
chartView2.translatesAutoresizingMaskIntoConstraints = false  //needed for programmatic constraints
let options2 = HIOptions()
let chart2 = HIChart()
let title2 = HITitle()
let series2 = HISeries()
title2.text = "Demo"
chart2.type = "column"
options2.chart = chart2
series2.data = data
options2.series = [series2]
chartView2.options = options2

scrollView.addSubview(chartView2)
chartView2.topAnchor.constraint(equalTo: pieChart.bottomAnchor).isActive = true
chartView2.bottomAnchor.constraint(equalTo: scrollView.bottomAnchor).isActive = true
chartView2.heightAnchor.constraint(equalToConstant: 400).isActive = true
chartView2.widthAnchor.constraint(equalToConstant: UIScreen.main.bounds.width).isActive = true

Currently I'm using this self-made workaround which works fine so far I guess...

NotificationCenter.default.addObserver(self, selector: #selector(ViewController.rotated), name: NSNotification.Name.UIDeviceOrientationDidChange, object: nil)

func rotated() {
    if UIDevice.current.orientation.isLandscape {
         chartView2.options.chart.width = UIScreen.main.bounds.width as NSNumber
         chartView2.reload()
    } else {
         chartView2.options.chart.width = UIScreen.main.bounds.width as NSNumber
         chartView2.reload()
    }
} 

...but is there a better/easier/right way?

kr and keep up the good work

Android version?

Hi,

Can I expect a real Android version soon?

Regards,
Alexandre

formatter function doesn't display data

Hi, I am trying to implement HITooltip formatter function but it doesn't work.

sample in swift 3 (simplified for demonstration):

let hioptions = HIOptions()
...
let tooltip = HITooltip()
tooltip.formatter = "function() { return 'test'; }"
hioptions.tooltip = tooltip

screen_shot_2017-05-25_at_12_22_45_am

HIGChartView doesn't react to autolayout updates.

(Me again, sorry ^^°)
I've just discovered that HIGChartView doesn't react to autolayout updates. For example, I've put a HIGChartView in UITableViewCell. When a rotate my device, graph keep the previous width in the webview.

chart reload

Hello,

thanks for the continuous updates to the wrapper - really appreciate it!

I see that the reload method has been deprecated...what's the recommended way to update the chart once the series data has been changed or updated? I can't seem to find it.

kind regards

In the iOS8 system, including Chinese will cause the chart to not display

for example:the DataSources.json like this
[
{
"title": "你好",
"subtitle": "",
"source": "DataSteps",
"unit": "steps",
"chartType": "area",
"icon": "ic_directions_walk",
"exporting": false
},
{
"title": "我爱**",
"subtitle": "",
"source": "DataCaloriesOut",
"unit": "kcal",
"chartType": "column",
"icon": "ic_whatshot",
"exporting": false
},
{
"title": "Calories (Eaten)",
"subtitle": "",
"source": "DataCaloriesIn",
"unit": "kcal",
"chartType": "spline",
"icon": "ic_local_dining",
"exporting": false
}
]

hello,how to change the chart backgroundColor?

I use backgroundColor in DataSources.json,but it don't work.

        "title": "Calories (Eaten)",
        "subtitle": "",
         "source": "DataCaloriesIn",
         "unit": "kcal",
         "chartType": "spline",
         "icon": "ic_local_dining",
         "exporting": false,
         "backgroundColor":"#7cb5ec"

Pod install Error

I am trying to install highcharts within my iOS app using cocoapods and I am getting this error.

"Unable to find a specification for 'HighCharts' "

Have you pushed the code version to pod trunk??

Arithmetic function divide (/) in Formatter function not working

Hello,

I am trying to show in tooltip percentile difference between 1st and clicked Series as shown below, but unfortunately "/" operation is causing that Highchart is not load at all. All of the other standard operations are working as +,-,*,% but only / is causing this problem.

var tooltip = HITooltip()
tooltip.shared = true
tooltip.formatter = "function() {var s = 'Season: '+this.x+'';for (var i = 0 ; i < this.points.length; i++){s += '
'+this.points[i].series.name +': '+Highcharts.numberFormat(this.points[i].y/this.points[0].y)+'% ('+c+')'};return s;}"
options.tooltip = tooltip

Thank you for your reply,
Zuzana

onClick() events from HighCharts to Swift

Is there an example of receiving events from HighCharts to Swift?

I have seen an example of where one creates a WebView manually along with WebKitOptions to specify the onClick. But doing that solution won't be able to take an advantage of highcharts-ios library.

Thank you.

HIGChartView size and position

Hi all,

I spend one day on this, so I'm willing to share my experience to save you some time...

When creating a HIGChartView, you MUST set the origin (x,y) to (0,0), then set the options and finally you can change the (x,y) of the view to what you need.

If you create the HIGChartView with its origin different of (0,0) the chart inside the view will be offset and then everythings sucks :(

Hope this will help someone.

Regards,
Alexandre

Crash when HIChartView is created from a storyboard.

Since 1.01, all chart created in a storyboard crash the app with this stack :


Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** +[NSJSONSerialization dataWithJSONObject:options:error:]: value parameter is nil'
*** First throw call stack:
(
0 CoreFoundation 0x000000010cb181cb __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010bd9cf41 objc_exception_throw + 48
2 CoreFoundation 0x000000010cb8cb95 +[NSException raise:format:] + 197
3 Foundation 0x0000000105544506 +[NSJSONSerialization dataWithJSONObject:options:error:] + 99
4 Highcharts 0x0000000105b7e0ce -[HIGJavaScript JSObject:] + 52
5 Highcharts 0x0000000105b95e13 -[HIGHTML prepareOptions:] + 92
6 Highcharts 0x0000000105c98fe0 -[HIChartView loadChartWorker] + 1763
7 Foundation 0x00000001055a51ee __NSFireTimer + 83
8 CoreFoundation 0x000000010caa8374 CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION + 20
9 CoreFoundation 0x000000010caa8032 __CFRunLoopDoTimer + 1026
10 CoreFoundation 0x000000010caa7bea __CFRunLoopDoTimers + 266
11 CoreFoundation 0x000000010ca9f604 __CFRunLoopRun + 2308
12 CoreFoundation 0x000000010ca9ea89 CFRunLoopRunSpecific + 409
13 GraphicsServices 0x0000000110cbf9c6 GSEventRunModal + 62
14 UIKit 0x000000010832ed30 UIApplicationMain + 159
15 you 0x0000000101db9f94 main + 196
16 libdyld.dylib 0x000000010e34bd81 start + 1
)

Windbarb not drawing at all on iOS

I tried to get the windbarb to work on iOS, but have now spent about 6 hours without success. My code looks like below. Please note that the chart darws fine if I only use 'series_area' for the options.series, but once the 'series_barb' is used, the chart will simple not draw at all. Is this a bug or am I simply missing something? Thanks.

    self.chartView = [[HIChartView alloc] initWithFrame:CGRectMake(self.view.bounds.origin.x, self.view.bounds.origin.y + 20, self.view.bounds.size.width, 300.0f)];

    HIOptions *options = [[HIOptions alloc]init];
    HITitle *title = [[HITitle alloc]init];
    title.text = @"Demo chart";
    options.title = title;
    
    HIWindbarb *series_barb = [[HIWindbarb alloc]init];
    series_barb.type=@"windbarb";
    series_barb.keys=@[@"y",@"rotation"];
    series_barb.data = @[
                    @[@9.8, @177.9],
                    @[@12.4, @156.2],
                    @[@1.4, @22.2],
                    @[@11.7, @45.1],
                    @[@33.4, @100.7],
                    @[@21.8, @56.2],
                    ];
    
    HIArea *series_area = [[HIArea alloc]init];
    series_area.type=@"area";
    series_area.keys=@[@"y",@"rotation"];
    series_area.data = @[
                      @[@9.8, @177.9],
                      @[@12.4, @156.2],
                      @[@1.4, @22.2],
                      @[@11.7, @45.1],
                      @[@33.4, @100.7],
                      @[@21.8, @56.2],
                    ];
    
    options.series = @[series_area,series_barb];
    
    self.chartView.options = options;
    
    [self.view addSubview:self.chartView];

Even with a three point data structure (x, value, direction, as mentioned by the docs) it does not draw:

    series_barb.keys=@[@"x",@"value",@"direction"];
    series_barb.data = @[
                    @[@1515309886,@9.8, @177.9],
                    @[@1515312886,@12.4, @156.2],
                    @[@1515315886,@1.4, @22.2],
                    @[@1515318886,@11.7, @45.1],
                    @[@1515321886,@33.4, @100.7],
                    @[@1515324886,@21.8, @56.2],
                    ];

I am not sure if this is a bug, or if the Windbarb is not available on iOS at all as the demos for iOS also not include the windbarb... Maybe someone can help or provide a working demo. Thanks a lot - I am pulling my hair.

Solidgauge - threshold not working/plotOption 'rounded' missing

Hello,

Solid-gauge's threshold attribute seems not to work, it makes no change in series start point. It always start where the yAxis.min is set.

Also I would like to ask if I can get rounded series bar as in picture, in plotOption object is no rounded attribute.

Thanks!
snimka obrazovky 2017-07-12 o 16 10 52

Tooltip format

Hi,

Is there a way to get the formatted strings of a date in a tooltip in French?
Right now, when displaying my tooltip with the format "{point.x:%e %b}"
I get the month in English ('May').

I need to get it in French ('Mai').

My iPhone locale is French.

        let tooltip = HITooltip()
        tooltip.headerFormat = "<b>{series.name}</b><br>"
        tooltip.pointFormat = "{point.x:%e %b}: {point.y:.2f} €"

Regards,
Alexandre

Export button cannot be removed

While removing the credits via

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

does work, removing the export button in the top right of any chart does not work:

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

It works fine in JS, though, but not in the iOS wrapper. Am I doing something wrong, or is this a bug?

Thanks.

Hide the right menu button.

How to disable the right button near title above the chart in iOS. I am facing the issue in hiding the right button. It is a button which appears by default at top right corner of chart frame after drawing any chart. It is a three horizontal parallel line button.
screen shot 2017-09-06 at 1 42 00 pm

highstock candlestick redraw issue

this is my code:

var data = [
            [1515686400000,49.41,49.78,49.21,49.78],
            [1515686460000,47.07,49.25,46.57,48.66],
            [1515686520000,49.76,49.80,48.13,48.41],
            [1515686580000,48.06,48.33,47.16,47.53],
            [1515686640000,47.68,47.84,46.66,46.67],
            [1515686700000,46.70,48.21,46.67,48.21],
            [1515686760000,48.05,48.78,47.80,48.77],
            [1515686820000,48.99,49.37,48.79,49.12],
            [1515686880000,49.11,49.24,48.98,49.03],
            [1515686940000,49.17,49.20,47.65,48.01],
            [1515687000000,47.97,48.58,47.76,48.47],
            [1515687060000,48.76,49.38,48.71,49.29],
            [1515687120000,49.21,49.32,49.08,49.19],
            [1515687180000,49.11,49.18,48.36,49.06],
            [1515687240000,49.09,49.53,49.07,49.50],
            [1515687300000,49.70,50.46,49.66,50.27],
            [1515687360000,50.53,50.79,50.31,50.74],
            [1515687420000,50.74,51.29,50.70,51.17],
            [1515687480000,51.06,51.43,49.71,50.65],
            [1515687540000,50.68,51.11,50.51,50.98],
            [1515687600000,50.97,51.35,50.96,51.31],
            [1515687660000,51.31,51.42,51.08,51.41],
            [1515687720000,51.54,52.13,51.50,51.88],
            [1515687780000,51.04,51.47,50.93,51.19],
            [1515687840000,51.24,51.36,49.93,50.08],
            [1515687900000,48.88,49.34,48.25,48.37],
            [1515687960000,48.40,49.23,48.37,48.95],
            [1515688020000,49.15,49.31,48.34,48.98],
            [1515688026000,49.32,49.78,49.26,49.74],
            [1515688032000,50.18,50.72,50.16,50.46]
        ];

        Highcharts.setOptions({
            global: {
                useUTC: false
            },
            lang: {
                rangeSelectorZoom: null
            }
        });

        // create the chart
        Highcharts.stockChart('container', {
            yAxis: {
                opposite: false
            },

            exporting: {
                enabled: false
            },

            credits: {
                enabled: false
            },

            scrollbar: {
                enabled: false
            },

            navigator: {
                enabled: false
            },

            rangeSelector: {
                allButtonsEnabled: true,
                inputEnabled: false,
                buttons: [{
                    type: 'day',
                    count: 1,
                    text: '1M',
                    dataGrouping: {
                        forced: true,
                        units: [['minute', [1]]]
                    }
                }, {
                    type: 'day',
                    count: 1,
                    text: '5M',
                    dataGrouping: {
                        forced: true,
                        units: [['minute', [5]]]
                    }
                }, {
                    type: 'day',
                    count: 1,
                    text: '15M',
                    dataGrouping: {
                        forced: true,
                        units: [['minute', [15]]]
                    }
                }, {
                    type: 'day',
                    count: 1,
                    text: '30M',
                    dataGrouping: {
                        forced: true,
                        units: [['minute', [30]]]
                    }
                }, {
                    type: 'hour',
                    count: 1,
                    text: '1H'
                }, {
                    type: 'hour',
                    count: 4,
                    text: '4H'
                }, {
                    type: 'day',
                    count: 1,
                    text: '1D'
                }, {
                    type: 'week',
                    count: 1,
                    text: '1W'
                }],
                selected: 0
            },

            series: [{
                type: 'candlestick',
                name: 'AAPL Stock Price',
                data: data,
                color:  'green', // 或 rgba(0,0,0,0)
                lineColor: 'green',

                upColor: 'red',
                upLineColor: 'red'
            }]
        });

when switch all button.
why candlestick display like this? why?
image

HIGChartView is nil when using Swift

Hi,

When creating HIGChartView view, with this line of code (in swift)
let view = HIGChartView()
the object view is always nil

Any tip for me?

Thanks in advance.
Alex

Histogram in iOS

When can we expect a Histogram combination chart in iOS version?

Windbarb zoom issue

I am seeing an issue with a windbarb chart and zooming enabled - when zoomed in, the wind barbs appear at the top of the chart, too:

img_3505

Code looks like this:

    HIChartView *chartView = [[HIChartView alloc] initWithFrame:self.view.bounds];
    chartView.plugins = @[ @"windbarb" ];
    
    HIOptions *options = [[HIOptions alloc] init];
    
    HIChart *chart = [[HIChart alloc] init];
    chart.type = @"windbarb";
    chart.zoomType = @"xy";
    
    HITitle *title = [[HITitle alloc] init];
    title.text = @"Highcharts Wind Barbs";
    
    HIXAxis *xaxis = [[HIXAxis alloc] init];
    xaxis.type = @"datetime";
    xaxis.offset = @40;
    
    HIPlotOptions *plotoptions = [[HIPlotOptions alloc] init];
    plotoptions.series = [[HISeries alloc] init];
    plotoptions.series.pointStart = @1485648000000;
    plotoptions.series.pointInterval = @36e5;

    
    HIWindbarb *windbarb = [[HIWindbarb alloc] init];
    windbarb.name = @"Wind";
    windbarb.color = [[HIColor alloc] initWithHexValue:@"0d233a"];
    windbarb.showInLegend = [[NSNumber alloc] initWithBool:false];
    windbarb.tooltip = [[HITooltip alloc] init];
    windbarb.tooltip.valueSuffix = @" m/s";

    windbarb.tooltip.pointFormat = @"<b>{point.value:.1f} aus {point.direction:.1f}°</b><br/>";
    windbarb.data = [NSMutableArray arrayWithObjects:
                     @[@9.8, @177.9],
                     @[@10.1, @177.2],
                     @[@11.3, @179.7],
                     @[@10.9, @175.5],
                     @[@9.3, @159.9],
                     @[@8.8, @159.6],
                     @[@7.8, @162.6],
                     @[@5.6, @186.2],
                     @[@6.8, @146.0],
                     @[@6.4, @139.9],
                     @[@3.1, @180.2],
                     @[@4.3, @177.6],
                     @[@5.3, @191.8],
                     @[@6.3, @173.1],
                     @[@7.7, @140.2],
                     @[@8.5, @136.1],
                     @[@9.4, @142.9],
                     @[@10.0, @140.4],
                     @[@5.3, @142.1],
                     @[@3.8, @141.0],
                     @[@3.3, @116.5],
                     @[@1.5, @327.5],
                     @[@0.1, @1.1],
                     @[@1.2, @11.1],
                     nil];
    
    HIArea *area = [[HIArea alloc] init];
    area.keys = @[@"y", @"rotation"];
    area.data = [NSMutableArray arrayWithObjects:
                 @[@9.8, @177.9],
                 @[@10.1, @177.2],
                 @[@11.3, @179.7],
                 @[@10.9, @175.5],
                 @[@9.3, @159.9],
                 @[@8.8, @159.6],
                 @[@7.8, @162.6],
                 @[@5.6, @186.2],
                 @[@6.8, @146.0],
                 @[@6.4, @139.9],
                 @[@3.1, @180.2],
                 @[@4.3, @177.6],
                 @[@5.3, @191.8],
                 @[@6.3, @173.1],
                 @[@7.7, @140.2],
                 @[@8.5, @136.1],
                 @[@9.4, @142.9],
                 @[@10.0, @140.4],
                 @[@5.3, @142.1],
                 @[@3.8, @141.0],
                 @[@3.3, @116.5],
                 @[@1.5, @327.5],
                 @[@0.1, @1.1],
                 @[@1.2, @11.1],
                 nil];
    area.color = [[HIColor alloc] initWithHexValue:@"2f7ed8"];
    area.fillColor = [[HIColor alloc] initWithLinearGradient:@{ @"x1": @0, @"x2": @0, @"y1": @0, @"y2": @1 } stops:@[
                                                                                                                     @[@0, @"#2f7ed8"],
                                                                                                                     @[@1, @"rgba(47, 126, 216, 0.25)"]
                                                                                                                     ]];
    area.name = @"Wind speed";
    area.tooltip = [[HITooltip alloc] init];
    area.tooltip.valueSuffix = @" m/s";
    area.tooltip.pointFormat = @"<b>{point.y:.1f} aus {point.rotation:.1f}°</b><br/>";
    
    options.chart=chart;
    options.title = title;
    options.xAxis = [NSMutableArray arrayWithObjects:xaxis, nil];
    options.plotOptions = plotoptions;
    options.series = [NSMutableArray arrayWithObjects:windbarb, area, nil];
    
    chartView.options = options;
    
    [self.view addSubview:chartView];
    
    [self.view addSubview:self.chartView];

Problem with datetime line charts

Hi,

I'm drawing a line chart, with a datetime xaxis.
I give data for 2 dates : 2017-05-11 and 2017-05-10
Timestamps for these dates are 1494453600 and 1494367200

As you can see on the screenshots, data displayed are really strange:

screen shot 2017-06-21 at 14 51 23

screen shot 2017-06-21 at 14 51 15

Any idea of what can be wrong with my data or with the chart?

Regards,
Alexandre

Events...

Hi,

I don't understand how to use events to catch when the user clicks on my charts.
Could someone help me please?

Thanks in advance.

Regards,
Alexandre

Highcharts was built without full bitcode.

I've got an error if I want to build a version for the App Store.

bitcode bundle could not be generated because 'MyProject/Pods/Highcharts/Highcharts.framework/Highcharts' was built without full bitcode. All frameworks and dylibs for bitcode must be generated from Xcode Archive or Install build for architecture arm64

So basically I'm stuck :/

Error with Cocoapods

Getting this error using the command specified in README:

pod 'Highcharts', '~> 1.1'

[!] Unable to satisfy the following requirements:

  • Highcharts (~> 1.1) required by Podfile

None of your spec sources contain a spec satisfying the dependency: Highcharts (~> 1.1).

You have either:

  • out-of-date source repos which you can update with pod repo update or with pod install --repo-update.
  • mistyped the name or version.
  • not added the source repo that hosts the Podspec to your Podfile.

Several colors on the same HISpline

Hi all,

I'd like to draw a spline with several different colors on the same spline.
For instance, between the 2 first points in white, then in black.

Is that possible?

Thanks in advance.

Best regards,
Alexandre

Issue in uploading to iTunes

I have embedded Highcharts framework in my iOS app, when i am trying to upload it to on iTunes Connect, i am getting error.
Please see the attached screenshots.
high-charts

Animation turn off not working (How to turn it off)

Hello,

I am using code below to turn off animation during series data reload, but my chart is still animating reload. Not sure if I am missing something or no. (None of the animating options, one by one or both together is working).

options.series = series
options.chart.animation = false
//options.plotOptions.series.animation = false
DispatchQueue.main.async {
chartViewBar.options = options
}

Thank you for your reply,
Zuzana

WKWebView is always opaque.

You can't have a transparent background behind you chart. Properties are not set on the WKWebView.

For now, I fix this with :

for (UIView* subview in chartView.subviews) {
if ([subview isKindOfClass:[WKWebView class]]) {
subview.opaque = NO;
subview.backgroundColor = [UIColor clearColor];
((WKWebView*)subview).scrollView.backgroundColor = [UIColor clearColor];
}
}

Bugs in this wrapper

I'm using the Highcharts iOS v1.0.5 installed via Cocoapods, but I found quite a lot of bugs:

Bug 1 : Tooltip, Legend, Menu buttons cannot be hidden

// Highchart
self.highchartView = [[HIGChartView alloc] initWithFrame:CGRectMake(0, 0, chartArea.frame.size.width, chartArea.frame.size.height)];

HIOptions *options = [[HIOptions alloc] init];
options.legend.enabled = [NSNumber numberWithBool:NO]; // this does NOT work
options.tooltip.enabled = [NSNumber numberWithBool:NO]; // this does NOT work
options.credits.enabled = [NSNumber numberWithBool:NO]; // this works
options.exporting.enabled = [NSNumber numberWithBool:NO]; // this does NOT work
options.navigation.buttonOptions.enabled = [NSNumber numberWithBool:NO]; // this does NOT work
self.highchartView.options = options;

The elements are still there even when I disable them.
p.s. the enabled property should be in BOOL instead of NSNumber, which is very weird.

Bug 2 : Unable to find a correct formatter for Y axis labels
The API document explained I can use yAxis.label.formatter to format the Y axis label, in my case I would like to have 6 decimal places, but the example only provides unrelated JS functions.

What is the expected value for the formatter ? It requires NSString. Tried {.6f} but nothing changed (the actual value is 0.000006 but it's displayed as 0)

Unable to scroll after zoom

Hello,

I have multiple charts inside a scrollview which works perfectly fine - the whole HIChartView area registers the gesture. After I zoom in (chart zoom is set to "x") and reset the zoom the chart area captures the scroll gesture and won't allow to scroll anymore. Here's a capture to help understand what I'm talking about.

screen_cap

Note: The issue is the same using the simulator as well as real devices.

Pie chart not centered

Hi all,

When drawing a Pie Chart, it's not well centered on my HIGChartView.
Is that a normal behaviour?

Here is my (Swift) code:

        let chart = HIChart()
        chart.plotBackgroundColor = HIColor()
        chart.plotBorderWidth = NSNumber()
        chart.plotShadow = false
        chart.type = "pie"
        
        let legend = HILegend()
        legend.enabled = false
        
        let exporting = HIExporting()
        exporting.enabled = false


        let title = HITitle()
        title.text = ""
        let subtitle = HISubtitle()
        subtitle.text = ""
        
        let tooltip = HITooltip()
        tooltip.pointFormat = "{point.quantity} \("unites".localized) - {point.y:.2f}€ - <b>{point.percentage:.1f}%</b>"
        
        let plotoptions = HIPlotOptions()
        plotoptions.pie = HIPlotOptionsPie()
        plotoptions.pie.allowPointSelect = true
        plotoptions.pie.cursor = "pointer"
        plotoptions.pie.dataLabels = HIPlotOptionsPieDataLabels()
        plotoptions.pie.dataLabels.enabled = true
        plotoptions.pie.dataLabels.format = "{point.name}: <b>{point.percentage:.1f}%</b>"
        plotoptions.pie.showInLegend = true

        let credits = HICredits()
        credits.enabled = false
        
        let pie = HIPie()
        pie.name = ""
        pie.data = []


        let options = HIOptions()
        options.chart = chart
        options.tooltip = tooltip
        options.plotOptions = plotoptions
        options.series = [pie]
        options.credits = credits
        options.title = title
        options.subtitle = subtitle
        options.exporting = exporting
        options.legend = legend
        
        m_PieChartView = HIGChartView(frame: CGRect(x: 0, y: 0, width: _width, height: m_sizePieChart))
        m_PieChartView.options = options
        m_scrollview.addSubview(m_PieChartView)

Here is what I get:
screen shot 2017-06-22 at 09 50 33

Regards,
Alexandre

Tooltip formatter

Hello,

the latest upgrade enabled the use of the tooltip.formatter.

This works just fine so far but I can't figure out whats the correct way to format the date value you get with this.x. In JS this is no issue but here I cannot use (or at least I don't know how exactly) custom formatters. Example case of an arearange date/value chart:

tooltip.formatter = "function () { return  '<small>' + this.x + '</small><br/>
this.points[0].series.name + ':  ' + this.points[0].point.high + '/' + 
this.points[0].point.low + this.points[0].series.tooltipOptions.valueSuffix }"

works just fine but obviously this.x returns me the time in milliseconds. How can I use the default converter or provide my own formatter for this value to print a human readable time value?

thanks and kind regards

Export button shows, but no context menu

I imported the correct plugins:

chartView.plugins = @[ @"exporting",@"export-data"];

but the Export menu button does not work at all in iOS. There's no context menu popping up, although it should, according to the documentation:

To enable exporting, the module needs to be included

Furthermore, the docs say:

When enabled, a context button with a menu appears in the top right corner of the chart

That is true for JS, but in iOS only the button appears, but no context menu when you click the button. Actually the debug area of XCode (9.2, iOS 11.2) shows this warning two times (one after the other) in the debug console when the export button is clicked:

[App] if we're in the real pre-commit handler we can't actually add any new fences due to CA restriction

So, it looks like the button receives the click event, but the context menu does not show. My code is below.

I honestly must say that the iOS documentation is extremely poor as all samples are either outdated (because deprecated), or the samples are in JS, which does not help at all. We need pure and up-to-date Objective-C samples to get that going properly! Thank you.

Here 's my code - run it and you'll notice that the export button is there, but you cannot click it.

    HIChartView *chartView = [[HIChartView alloc] initWithFrame:self.view.bounds];
    HIChart *chart = [[HIChart alloc]init];
    chart.polar = @true;
    chart.type = @"area";

    chartView.plugins = @[ @"exporting",@"export-data"];

    HITitle *title = [[HITitle alloc]init];
    title.text = @"Highcharts Polar Chart";    
    
    HIPane *pane = [[HIPane alloc]init];
    pane.size = @"80%";
    
    HIXAxis *xaxis = [[HIXAxis alloc]init];
    xaxis.categories=[NSMutableArray arrayWithObjects:@"N",@"NNO",@"NO",@"ONO",@"O",@"OSO",@"SO",@"SSO",@"S",@"SSW",@"SW",@"WSW",@"W",@"WNW",@"NW",@"WNW", nil];
    xaxis.tickmarkPlacement=@"on";
    xaxis.lineWidth=@0;
    
    HILabels *labels = [[HILabels alloc] init];
    labels.style = [[HIStyle alloc] init];
    labels.style.fontSize = @"8px";
    xaxis.labels = labels;
    
    HIYAxis *yaxis = [[HIYAxis alloc]init];
    yaxis.gridLineInterpolation=@"polygon";
    yaxis.lineWidth=@0;
    yaxis.min=0;
    
    HITitle *titleYaxis = [[HITitle alloc]init];
    titleYaxis.text=@"Speed";
    
    yaxis.title=titleYaxis;
    yaxis.tickAmount=@15;

    HISeries *series = [[HISeries alloc]init];
    series.name=@"Wind";
    series.data=[NSMutableArray arrayWithObjects:@11,@12,@13,@14,@11,@12,@13,@14,@11,@12,@13,@14,@11,@12,@13,@14, nil];
    series.pointPlacement=@"on";
    
    HIOptions *options = [[HIOptions alloc]init];
    
    HINavigation *navigation = [[HINavigation alloc]init];
    navigation.buttonOptions = [[HIButtonOptions alloc]init];
    navigation.buttonOptions.enabled=[[NSNumber alloc] initWithBool:true];

    HIExporting *exporting = [[HIExporting alloc] init];
    exporting.enabled = [[NSNumber alloc] initWithBool:true];
    
    options.exporting = exporting;
    options.navigation=navigation;
    options.chart = chart;
    options.title = title;
    options.pane = pane;

    options.xAxis = [NSMutableArray arrayWithObjects:xaxis, nil];
    options.yAxis = [NSMutableArray arrayWithObjects:yaxis, nil];
    options.series = [NSMutableArray arrayWithObjects: series, nil];
    chartView.options = options;
    
    [self.view addSubview:chartView];

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.