How to add Highcharts on UIWebView in iOS?

前端 未结 3 1400
旧巷少年郎
旧巷少年郎 2021-02-06 14:33

I am totally new to HighCharts and I referred example http://blog.li-labs.com/developing-ios-apps-with-custom-charting/ and tried same, but on iPad simulator I am getting a blan

3条回答
  •  有刺的猬
    2021-02-06 15:14

    Steps:-

    1) First just creat one html file and do the needful code or for trial can copy html code from examples that you get from package http://www.highcharts.com/download

    2) Make sure that the scripts in html should have proper .js links for e.g:-

    or

    if you want to give it locally you can write But make sure that the .js files are there in your application folder.

    3) NSString *htmlFile = [[NSBundle mainBundle] pathForResource:@"graph" ofType:@"html"];
       NSString* htmlString = [NSString stringWithContentsOfFile:htmlFile encoding:NSUTF8StringEncoding error:nil];
       [obj loadHTMLString:htmlString baseURL:nil];  // Webview *obj;
    

    Hope this help you. In my case its working.

提交回复
热议问题