Question

I'd like to draw amcharts in offline. It works fine in offline already but I got some problems with scrollbar grips - they are not drawned because all images stored at http://www.amcharts.com/lib/images/ and the property chart.pathToImages is defined to this path. I see only one way to solve my problem :

  1. find out what's the name of grip's icon
  2. create my own icon with the same name
  3. put it into my local folder
  4. change property chart.pathToImages setting it to my folder path.

Can somebody help me with first task in the list?

PS I got one image from standart amcharts folder: http://www.amcharts.com/lib/images/star.gif and i've tried some variations for scrollbar grips, but have no results atm

Was it helpful?

Solution

I have solved my problem! I just opened amcharts.js and CTRL+F'ed it with "gif" and it returned me followed names: dragIcon.gif dragIconH.gif which are exactly what i've been looking for.

PS. I'm working on an iOS application which can draw amcharts in offline, so for do this I downloaded the amcharts.js and added it to my project, then I created my html file and added into it following string in purpose of import amcharts.js library

<script src="amcharts.js" type="text/javascript"></script>

then I loaded my html into the UIWebView:

NSString *path = [[NSBundle mainBundle] bundlePath];
NSURL *baseUrl = [NSURL fileURLWithPath:path]; //URL representation of main project bundle

NSString *htmlPath = [[NSBundle mainBundle] pathForResource:@"chart" ofType:@"html"];
NSError *error;
NSString *htmlStr = [[NSString alloc] initWithContentsOfFile:htmlPath encoding:NSUTF8StringEncoding error:&error];
htmlStr = [NSString stringWithFormat:htmlStr , [self getJSONStringFromDict:dataDict] , baseUrl]; // i do this for insert JSONdata and baseURL into my HTML (see below)
[self loadHTMLString:htmlStr baseURL:baseUrl];

baseURL is very important in case you want to use local files in your html that's why src="amcharts.js" works fine.

And finally! What about my scrollbar grips? As I mentioned before, I downloaded the file dargIcon.gif and added it to my project (same I did with amcharts.js), then I replaced

chart.pathToImages = "http://www.amcharts.com/lib/images/"

with chart.pathToImages = "%@"; %@ will be replaced with my baseURL (see code above)

Problem solved. Hope this helps somebody.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top