chimpstudios / amcharts Goto Github PK
View Code? Open in Web Editor NEWA Native Objective C wrapper for the AmCharts charting library. http://www.amcharts.com
License: MIT License
A Native Objective C wrapper for the AmCharts charting library. http://www.amcharts.com
License: MIT License
I m a iPhone developer. Your API is very helpful. I want to implement the candle stick type chart but not able to. Can you please guide me the steps to implement.
In the AmChartLibrary/AppDelegate I have changed the code
AmStockGraph *stockGraph = [[AmStockGraph alloc] init];
stockGraph.uid = @"graph1";
stockGraph.valueField = @"value";
stockGraph.type = @"candlestick";
stockGraph.title = @"MyGraph";
stockGraph.hidden = YES;
stockGraph.markerType = @"square";
stockGraph.openField = @"open";
stockGraph.lowField = @"low";
stockGraph.highField = @"high";
stockGraph.closeField = @"close";
stockGraph.useDataSetColors = NO;
stockGraph.fillAlphas = [NSNumber numberWithInteger: 1];
stockGraph.lineColor = @"green";
stockGraph.fillColors = @"green";
stockGraph.negativeLineColor = @"red";
stockGraph.negativeFillColors = @"red";
stockChart.chartScrollbarSettings.graphType = @"candlestick";
But still not able to see any candle type.. Can you please give me the detail steps to run the app for candle stick type chart
let map:AmMap = AmMap.init()
map.type = "map"
map.theme = "none"
map.pathToImages = "ammap/images/"
map.responsive.enabled = true
let mapData:AmMapData = AmMapData()
mapData.map = "worldLow"
map.mapDataProvider = mapData
mapView.chart = map
mapView.drawChart()
How i can update existing map ?
map.validateData()
map.validateNow()
Is not availible for me...
Me again. I have been struggling with how to determine which country was selected in the map. I create an array of countries which I use to populate other charts data.
In my website .js version I do this:
var arrCountry = [];
map.addListener('clickMapObject', function (event) {
arrCountry = [];
var selectedCountry = event.mapObject.id;
arrCountry.push(selectedCountry);
}
I don't know how to reference 'clickMapObject' for iOS.
Also, I can't figure out what to call when I 'manually' want to select a country. (A search result will return a country that I use to select in map)
My code is Swift - I am happy to have any help in Objective-c and I can just translate
var countryArray = ["US"];
for sArea in map.mapDataProvider.areas as NSArray as [AmMapArea]{
var areaID = sArea.uid;
if contains(countryArray, areaID!){
sArea.showAsSelected = true; // highlights
// How to zoom here? ( I am using an array but in this case it will always only have one country)
}else{
sArea.showAsSelected = false;
}
Thank you
Love AmCharts, AmMaps, it is a huge part of our web data display. I understand the js version but I am really struggling with the wrapper classes. Currently working on an iPad app, I have pie charts, barcharts all working fine. I can't seem to find an example of the wrapper classes for amMaps and its killing me. Could you point me to a simple snippet of how to set up the map? Thank you.
Hi,
Could you point to documentation on how to create this chart in objective c:
http://www.amcharts.com/demos/multiple-value-axes/#theme-light
Cheers
Can i customize X Axis Label of line chart (Not date) ,How?
Hello,
I'm trying to add guide lines to my graph for the category axis. The "date" and toDate" variables take NSDate parameters, but JSONserialization does not seem to accept date variables. Even if I change the variables to accept strings, Amcharts ultimately wants a Date variable for these parameters.
This is the error I get: 'Invalid type in JSON write (__NSTaggedDate)', which occurs in:
NSDictionary+JSONString.m
Any help on solving this issue?
Thanks for your time and assistance
I tried to run in iPhone simulator but some files are missing..Its showing me some PBXCp Error. Can you please fix it soon
Hi,
Great package - I'm using it!
Is it possible to receive any callbacks/delegate methods? I've tried but not succeeded.
Also, how do I invoke labelFunction? I have:
_valAxis.labelFunction =
Just don't get it how I define that function so that it can take the parameters that are passed: value & valueText. The valueAxis parameter is no problem.
"This function is called and these parameters are passed: labelFunction(value, valueText, valueAxis); Where value is numeric value, valueText is formatted string and valueAxis is a reference to valueAxis object. Your function should return string."
Any help greatly appreciated!
Best regards,
Micke
Hello,
Great decision to open source this component this is fantastic for the community of iOS/MacOS developers.
Could you consider creating a podspec and publish it at the cocoapods specs repository for easy integration in applications? Nobody drags and drops components into projects anymore these days :)
Thanks!
After including this project to my iOS project, XCode is not longer recognizing my app as iOS app and not allow me to submit the new version.
Is something not mentioned in the instructions that i need to do to make it work?
thanks
I've tried reworking the Obj-c example in the readme file, to implement a basic chart, but without any results.
Is there a working example file available somewhere?
Appstore does not accept UIWebView anymore.
this lib needs to be converted using UIWebKit instead of UIWebView.
In OS X Application, I use 3 AmChartView in single window, but only one AmChartView works.
All the way, I just want to display several charts in single window.
(A Swift Cocoa Application on OS X, Xcode 6.2 Beta 3)
Hi again!
I get 'AmChartsMobile/AmCharts.h' file not found when I run Archive for my project. Works fine when running on the phone and in the simulator...
Best regards,
Mikael DG
I think I found it . had forgotten about -ObjC for other configurations. I had put it i DEBUG but not the others...ADHOC and RELEASE...
Hello,
I'm building a UIView subclass that load 4 AmMobileChartView objects in page.
I load the UIView subclass programmatically in ViewDidAppear of the related controller.
Allocating che subclass and the AmMobileChartView works good, but sometimes graphs are not rendered.
I printed some logs and:
Following a screenshot of what is happening on screen
Thanks in advance
This is probably outside the scope of this project, but is there a way to place a marker on AmMap
(world map) given the marker latitude/longitude
?
Hi,
Thanks for doing this!
I ran into an issue with not finding AmExport.h when building on iOS. For now I just commented it out in AmCharts.h...
Best regards,
Micke
Hello,
I have just added AmCharts wrapper to my new project... I added a AmMobileChartView to a CollectionCellView loaded from storyboard.
charView webview inside the AmMobileChartView won't initialiazed (print nil on log screen) and chat won't load.
Any help please?
Here some snippet...
//--- custom cell class
import UIKit
class SFA4CustomStatsCollectionViewCell: UICollectionViewCell {
//define class objects
@IBOutlet weak var amcGraphView: AmMobileChartView!
}
//--- collection view snippet
func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCellWithReuseIdentifier(customStatsCollectionViewCell, forIndexPath: indexPath) as SFA4CustomStatsCollectionViewCell
//TODO: configure cell here
let theChart : AmPieChart! = SFA4DummyObject.getAMPieChartDummy()
cell.amcGraphView.chart = theChart
return cell
}
func collectionView(collectionView: UICollectionView, willDisplayCell cell: UICollectionViewCell, forItemAtIndexPath indexPath: NSIndexPath) {
let aCell = cell as SFA4CustomStatsCollectionViewCell
aCell.amcGraphView.drawChart()
}
This Api is wonderful!
I have a problem showing legend in iPhone (iPad works fine)
AmSerialChart * chart = [[AmSerialChart alloc] init];
...
AmLegend* legend = [[AmLegend alloc] init];
[chart setLegend:legend];
...
I seeing the javascriptRepresentation of final chart, it's fine in both (iPhone and iPad). I've tried to resize the AmMobileChartView too. Anyway, I couldn't run any legend in iPhone :c.
/*Update/
I have an unique iOS Autolayout for all devices (iPod, iPhone and iPad):
Tried a @media only css set
...
/* ----------- iPhone 6 ----------- /
/ Landscape */
@media only screen
and (min-device-width: 375px)
and (max-device-width: 667px)
and (-webkit-min-device-pixel-ratio: 2)
and (orientation: landscape) {
{
width:100%;
height: 240px;
}
}
...
Tried put the chartdiv into a chart wrapper:
...
...
Intercepted the final html file content in "stringWithContent" string:
NSURL localURL = [NSURL fileURLWithPath:self.templateFilepath];
NSString stringWithContent = [NSString stringWithContentsOfFile:self.templateFilepath encoding:NSUTF8StringEncoding error:nil];
[self.chartView loadHTMLString:stringWithContent baseURL:localURL];
And in both (iPhone and iPad) it's all right.
Anyway everything I try does not work on iPhone. In iPad continues works fine.
/*Update/
Thanks!
Hi,
I'm trying to implement the Amcharts Mobile Library, and as the screenshots below show, the labels for the pie chart fail to render in the IOS Simulator. The labels render fine for the chart on my website. The IOS simulator is for the iphone. Even when I copy and paste the code for the sample Pie Chart in the examples, the labels still dont show up.
This is the code in Objective C. I've tried enabling "labelsEnabled" but that doesn't work either.
AmPieChart *pieChart = [[AmPieChart alloc] init];
pieChart.type = @"pie";
pieChart.theme = @"dark";
pieChart.backgroundColor=@"#3f3f4f";
pieChart.backgroundAlpha=[NSNumber numberWithInteger: 1];
pieChart.percentPrecision=[NSNumber numberWithInteger: 1];
pieChart.depth3D=[NSNumber numberWithInteger: 10];
pieChart.labelsEnabled=YES;
pieChart.balloonText=@"[[title]]: [[num_grams]] grams/day";
NSMutableArray _dataProvider = [[NSMutableArray alloc] init];
[dataProvider addObject:@{@"nutrition" : @"Protein", @"calories" : @(rounded_protein_4), @"num_grams" : @(rounded_protein)}];
[dataProvider addObject:@{@"nutrition" : @"Carbs", @"calories" : @(rounded_carb_4), @"num_grams" : @(rounded_carb)}];
[dataProvider addObject:@{@"nutrition" : @"Fats", @"calories" : @(rounded_fat_9), @"num_grams" : @(rounded_fat)}];
[dataProvider addObject:@{@"nutrition" : @"Alcohol", @"calories" : @(rounded_alcohol*7), @"num_grams" : @(rounded_alcohol)}];
pieChart.dataProvider = dataProvider;
pieChart.valueField = @"calories";
pieChart.titleField = @"nutrition";
AmMobileChartView *new_nutrition_graph=[[AmMobileChartView alloc]initWithFrame:CGRectMake(0, 0, 300, 250)];
///////this is in tableview, and each cell has an AmMobileChartView named nutrition_chart
cell.nutrition_chart= new_nutrition_graph;
[cell.nutrition_chart setChart:pieChart];
[cell.nutrition_chart drawChart];
//////////nutrition_chart_view is the UIView container that will hold the nutrition_chart
[cell.nutrition_chart_view addSubview:cell.nutrition_chart];
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.