FAQ Database Discussion Community


Error in CorePlot 1.5.1

osx,cocoa,core-plot,quartz-graphics
I've been getting reports from my app's users of an error inside CorePlot framework. It does not always happens and I cannot detect a pattern on how to make it crash myself. I would like to know if there is something I can do to avoid this crash. Exception Type:...

ios core plot increase CPTPlotSymbol clickable area

ios,graph,core-plot,increment,clickable
I am using core plot library for showing Scatter plot in my app. I am creating CPTPlotSymbol like this :- CPTMutableLineStyle *symbolLineStyle = [CPTMutableLineStyle lineStyle]; symbolLineStyle.lineColor = [CPTColor blackColor]; CPTPlotSymbol *plotSymbol = [CPTPlotSymbol ellipsePlotSymbol]; plotSymbol.fill = [CPTFill fillWithColor:blueColor]; plotSymbol.lineStyle = symbolLineStyle; plotSymbol.size = CGSizeMake(5.0 , 5.0); Then graph point are...

Animate at re-selected index not working

ios,objective-c,animation,core-plot
I implemented corePlot in my xcode project using the pie chart. I'm having trouble the animation. When a slice gets selected, the radial offset changes with animation. Here is the code: - (void)pieChart:(CPTPieChart *)plot sliceWasSelectedAtRecordIndex:(NSUInteger)idx { if (self.selectedIndex == idx) { [self animateSelectedIndex:20 :0]; self.selectedIndex = -1; } else {...

Core Plot horizontal bar chart on negative y-axis

core-plot,bar-chart
I have a requirement to draw Core Plot horizontal bar chart with everything on the negative y-axis. I.e. the first index should appear at -1, like below: I have figured out how to draw horizontal Bar Chart. But figuring out how to draw them in an "inverted" manner (to let...

How to get color from slice index?

ios,objective-c,core-plot,pie-chart
I implemented corePlot in my xcode project. I know there is a way to fill the pie slices color: -(CPTFill *)sliceFillForPieChart:(CPTPieChart *)pieChart recordIndex:(NSUInteger)index; But is there a way to get what color the index's slice is? Example: If I try getting index's 0 color, it would be blue, etc....

Core-Plot DataLabel Z-Ordering

ios,plot,core-plot
I try to add data labels to a bar graph in Core-Plot (on iOS). The user selects individual plots and then the values are shown. The main problem is shown in the image, the other plots overdraw the data labels. Is it possible to have the labels always at the...

CPTPlotSymbol larger touch area

ios,core-plot
How can I make the plot symbol touch area bigger. 10x10 is what I need to be filled with color, but it is really hard to touch on the screen with 'fat' fingers. So I need the area around it to activate the symbol, but not to be filled with...

Core Plot in Swift for Beginner

ios,iphone,xcode,swift,core-plot
Hi I just started learning Swift and managed to import CorePlot using CocoaPods, and do the import via the Bridging Header. I also managed to create the axes for my graph: class ViewController: UIViewController { @IBOutlet weak var graphView: CPTGraphHostingView! override func viewDidLoad() { super.viewDidLoad() // create graph var graph...

CorePlot CPTAxisLabelingPolicyAutomatic and NSDate

ios,core-plot
I just want to know if it is possible to use NSDate and labelFormatter for axislabels while using CPTAxisLabelingPolicyAutomatic? Thanks in advance...

Changing the position of a CorePlot annotation after zooming(iOS)

ios,objective-c,cocoa-touch,annotations,core-plot
I am using a CorePlot ScatterPlot to display data readings from an external bluetooth sensor. Ive gone through the following tutorial: http://www.raywenderlich.com/13271/how-to-draw-graphs-with-core-plot-part-2 and Ive got everything working the way that I would like with one exception. When the user taps on one of the data points, an annotation is placed...

How to draw Multiple line between x1,y,1,y2 using coreplot in ios8?

objective-c,core-plot,ios8.1
In my app am drawing multiple line using "CPTScatterPlotFieldY" and "CPTScatterPlotFieldX".I can draw line between X vs Y1. Now i want to draw line between X Vs Y2.How to code in :numberForPlot:" delegate. I used following code for X vs Y1. -(NSNumber *)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index { NSDictionary * dic...

Is it possible to add a UIImage to CPTGraph?

ios,objective-c,uiimage,core-plot
I'm trying to add an image to a graph using Core-Plot and I want the image to move along with the graph when it being dragged or pinched. I've tried the code below but it didn't work. Can anyone tell me how to do so? CALayer *subLayer = [CALayer layer];...

How can I access the layer so I can flip it?

ios,objective-c,calayer,core-plot
I implemented corePlot into my xcode project. I'm trying to flip the legend of the graph. Here is the code: CPTGraph *graph = self.hostView.hostedGraph; CPTLegend *theLegend = [CPTLegend legendWithGraph:graph]; graph.legend = theLegend; This is what I tried: theLegend.sublayerTransform = CATransform3DMakeScale( CPTFloat(1.0), CPTFloat(-1.0), CPTFloat(1.0) ); That didn't do anything. So I...

Core Plot Swift BarPlot tickLocation always zero

ios,swift,core-plot
I'm trying to make a Bar Chart using core-plot under Swift, i have a problem making custom labels on xAxis, they're always in tickLocation zero. Maybe someone can help me, this is my code. import UIKit class aaa: UIViewController, CPTPlotDataSource{ var items :[NSNumber] = [10,35,18, 20, 50, 5] @IBOutlet var...

Failed to install CorePlot 2.0 via cocoapod

core-plot,cocoapods
I have been using CorePlot 1.5.1 using cocoapod in my Xcode project without issue. Now I need to upgrade to CorePlot 2.0 because I need the touch up/down on same event. I tried doing that by editing PodFile by either: pod 'CorePlot', '~> 2.0' and target 'ERPTests' do pod 'CorePlot'...

Core plot CPTTimeFormatter fixed xAxis time interval

objective-c,core-plot
I am using core plot to plot a graph with the xAxis.labelFormatter being a CPTTimeFormatter. So I have set a reference date, and I have my data plotted nicely along the xAxis. The first xAsis label is "00" (midnight) and the last xAxis label is "00" which is great, working...

Error of '“_vDSP maxvD”, referenced from…' when implementing core-plot [duplicate]

ios,objective-c,xcode,core-plot,vdsp
This question already has an answer here: issue with using Core Plot in XCode6.1 1 answer I'm trying to implement this library for creating graphs in my Xcode project. I'm following this tutorial to insert it in my project. When I finish it and compile and run it, I...

How to hold axis when zoom into core plot?

ios,objective-c,graph,core-plot,ios8.1
I use Xcode to develop application for iOS8. I use Core-Plot option of plotSpace.allowsUserInteraction = YES; I added values to graph it shows me the graph but when i zoom into the x-title , y-title are hidden. How can i fix this issue? I want that the titles be not...

Core Plot Selecting (Random) Points Challenge

ios,xcode,swift,graph,core-plot
I have made a simple graph using Core Plot in Swift (Thank You Eric!) and have the following result. Challenge: What I would like to do is get the coordinates of the tap of the user within the plot area. So if the user Taps on the point 10,20 I...

How to fix a gap between the x and y axes in core plot

ios,core-plot
I am using [_graph.defaultPlotSpace scaleToFitPlots:[_graph allPlots]]; and if where none of the plots has a y value of 0, there is a gap between the bottom of the Y axis and the X axis. I've tried using _graph.axisSet.xAxis.orthogonalCoordinateDecimal = CPTDecimalFromDouble(0.0); as well as a calculated yMin instead of 0.0. Yet,...

Implement Pull to Refresh feature in Core Plot

ios,objective-c,core-plot
Hi I want to implement the pull to refresh feature in CP so that I can reload data by using this gesture. I did some research that the apple built in gesture features rely on tableview or scrollview. Is it possible to make use of the Gesture Recognizers that have...

Why does the object appear before animation

ios,objective-c,animation,core-plot
I implemented corePlot in my xcode project. I use the pie chart, and I tried animating it like this: [CPTAnimation animate:pieChart property:@"endAngle" from:pieChart.startAngle + M_PI * 2 to:pieChart.startAngle duration:2.0]; It animates well, but the problem is, as soon as the chart is supposed to be displayed, (before the animation,) the...

CorePlot Visible Range Not Working As Expected

ios,core-plot,visible
So I've been modifying the sample code to try to have a graph show the y values of 0-20 and to only show the max of 6 x values on the screen at a time. A visible range of 0-6 for x; Here's a picture of what I'm shooting for...

How to show x-axis title?

ios,objective-c,graph,core-plot,ios8.1
i develop application with Xcode to iOS 8. I want to create a temperature graph. I added values to graph it shows me the graph but the x-axis and x-title are hidden. How can i fix this issue? this is my functions: #import "CorePlot-CocoaTouch.h" @property CPTScatterPlot *linePlot; @property (nonatomic, strong)...

Core-Plot: Minor tick labels on axis disappear

core-plot
I have a graph that shows labels only on major ticks. I tried to show the minor tick labels after a certain level of zoom-in but I encountered an issue. At first all seemed to work well, then I zoomed-in really fast and the minor ticks in the visible axis...

Drawing tangent plot in Core Plot

ios,objective-c,core-plot
I'm making a graph plotter app. After creating a plot area, I manage to add graphs into the area using -addCurve:index as below. -(void)addCurve:(int)index { // identifier NSString *identifier = [NSString stringWithFormat:@"plot%d", index]; CPTScatterPlot *boundLinePlot = [[CPTScatterPlot alloc] init]; CPTMutableLineStyle *lineStyle = [CPTMutableLineStyle lineStyle]; lineStyle.miterLimit = 1.0f; lineStyle.lineWidth = 3.0f;...

Add view to subView

ios,objective-c,core-plot,addsubview
I implemented core plot in xcode. I'm trying to insert the legend in another cell. Here is my code of how I implemented the legend. - (void)configureLegend { CPTGraph *graph = self.hostView.hostedGraph; CPTLegend *theLegend = [CPTLegend legendWithGraph:graph]; // Configure the legend theLegend.numberOfColumns = 1; theLegend.fill = [CPTFill fillWithColor:[CPTColor whiteColor]]; theLegend.borderLineStyle...

iOS CorePlot how to install

ios,objective-c,core-plot
I am trying to use CorePlot in one of my iOS projects, but even after following the instructions and looking around online, I haven't managed to correctly install the framework. I feel like the documentation has not evolved and no longer describes the correct way to install the framework. I...

Core Plot CPTAxisLabelingPolicyAutomatic Days only

ios,core-plot
I'm using CPTAxisLabelingPolicyAutomatic on my x-axis which for time-line for days of a year (e.g. 07 March 2015). This is my reference date: let components = NSDateComponents() components.month = 10 components.day = 29 components.year = 1970 components.hour = 0 components.minute = 0 components.second = 0 referenceDate = NSCalendar.currentCalendar().dateFromComponents(components)! and here...

How to create UIImage from CPTPlotSymbol?

ios,core-plot
I am new to Core-Plot, and here is my problem. I created my Graph using ScatterPlot class. And my plot symbol creation data source method is: - (CPTPlotSymbol*)symbolForScatterPlot:(CPTScatterPlot *)plot recordIndex:(NSUInteger)index { CPTPlotSymbol *symbol = [[CPTPlotSymbol alloc]init]; if (index %2 == 0) { symbol.symbolType = CPTPlotSymbolTypeDiamond; symbol.fill = [CPTFill fillWithColor:[CPTColor redColor]];...

Why is this not animating?

ios,objective-c,animation,core-plot,pie-chart
I implemented corePlot in my xcode project. I have a pie chart that I'm trying to animate. Here is my code: - (void)configureChart { CPTGraph *graph = self.hostView.hostedGraph; CPTPieChart *pieChart = [[CPTPieChart alloc] init]; pieChart.dataSource = self; pieChart.delegate = self; pieChart.pieRadius = (self.hostView.bounds.size.height * 0.7) / 2; pieChart.startAngle = M_PI_4;...

Core-plot: How can I set a starting value for the x axis?

core-plot
I have a core-plot graph, that has values from 50 to 250 and the interval is set to 20. However the labels underneath the graph are as follows: 40, 60, 80, ..., 260. What I want from them is to become: 50, 70, 90, ..., 250. I guess that has...

Animation is not working as expected

ios,objective-c,core-plot,cabasicanimation
I implemented corePlot in xcode and I'm using the pie chart. I'm trying to create a 3d flip animation while the chart reloads. Here is the code: CABasicAnimation *scaleAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale.x"]; scaleAnimation.fromValue = [NSNumber numberWithFloat:1.0]; scaleAnimation.toValue = [NSNumber numberWithFloat:0.5]; scaleAnimation.duration = 1.0f; scaleAnimation.removedOnCompletion = NO; [self.pieChart addAnimation:scaleAnimation forKey:@"scale"]; [self.pieChart...

iOS Core plot - graph line not extending upto major interval

ios,core-plot
I am new to CorePlot. I am trying to render a graph that pulls data across network every 10 seconds. I want to plot the data that's pulled every 10 seconds and so I've set x.majorIntervalLength as 10. I expect every plot to appear on the major ticks, however, that's...

How do I convert CPTColor to UIColor?

ios,objective-c,core-plot,uicolor
I have a CPTColor (from corePlot). How can I convert the CPTColor to a UIColor?

Why is the text upside down?

ios,objective-c,core-plot
I implemented corePlot into my xcode project. I'm trying to add the legend to another cell. I'm able to add the legend to another cell, but when I do that, the text is upside down. Here is my code: - (void)configureLegend { CPTGraph *graph = self.hostView.hostedGraph; CPTLegend *theLegend = [CPTLegend...

How to show more x-axes in core-plot chart

objective-c,core-plot,ios-charts
According to our needs, we need to show the x-axis information at the top and bottom of the chart, how to show more x-axes? THX ...

How to determine that the Plot has been rendered by Core-Plot

ios,core-plot
In our project we are using CorePlot to display some graphs, they use CPTXYPlot and we are displaying some scatter plots. This is all well and we actually like the plotting library a lot. Big thanks to Eric Skroch and team for the great work they've done putting it together!...

How to repeatedly call a method (reload…) with a timer to animate a transition

ios,objective-c,animation,nstimer,core-plot
I implemented corePlot in my xcode project. I'm trying to "explode" a slice of the pie chart with animation. Here is the method I'm using: - (void)radialOffsetForPieChart:(CPTPieChart *)pieChart recordIndex:(NSUInteger)idx { if (myIndex == idx) { return 20; } return 0; } I have another method which calls [pieChart reloadRadialOffset];. For...

Despite setting xRange, data is plotted in the wrong place

core-plot
I'm trying to plot a histogram. The x-axis range should be about 881 to 1281 (I've verified that I'm using a location of 881 and range of 400 when constructing the CPTPlotRange for xRange). The axis draws with the correct range, but my bars end up near 2000 (data space),...

How to show Line label with two digits after dote?

ios,objective-c,core-plot,ios8.1
i use a core plot in my Xcode project and have a problem with plot values. How can i show number on the CPTScatterPlot? My plot shows me only one digit after dot (36.6). For example show me 36.665 or 36.001? I add a screen preview. INIT -(void)initLinePlotTmp { //Initialize...