core-plot

CorePlot in Swift can not call “numberForPlot”

落花浮王杯 提交于 2019-12-06 07:47:23
I am using CorePlot( https://github.com/core-plot/core-plot ) in Swift. In order to make a pie chart on iOS, I wrote as below by translating Obj-C code to swift. I was able to view the graph title, but I could not plot a pie chart. As a result of looking at NSlog, I found that “numberForPlot” function was apparently not called. How should I rewrite this? My code looks like this: ViewController.swift import UIKit class ViewController: UIViewController, CPTPieChartDataSource, CPTPieChartDelegate{ @IBOutlet var graphView : CPTGraphHostingView var dataForChart = NSNumber[](); override func

How to scale graph to fit to visible space

六眼飞鱼酱① 提交于 2019-12-06 06:10:27
I'm using core-plot (and the barcharts) to display financial information. My problem is that whenever I use negative values, it seems that the scale of the shown graph is wrong. I'd like the entire graph to be visible, but often only a part of the graph is shown, leaving the bars cut off and sometimes not even the x-axis visible (the part shown is so far down on the y-axis). If I turn on the user-interaction, it's possible to scroll within the view to see different parts of the graph, but I want an overview, not study the graph in detail. Note that I do not use the whole screen for the graph,

Core Plot 1.0 how to implement reloadData method?

回眸只為那壹抹淺笑 提交于 2019-12-06 02:26:23
问题 I asked this question yesterday and got some great help from Eric Skroch. However, I am still a bit confused after looking over all the documentation on the Core Plot website along with some examples. So I am going to post the code I have so far, and see if anyone can help me out some more. Maybe it will be a bit easier for Eric to help as well. My problem is that I need to remove a plot and then replace it with another in a tabbed app. Eric and others have said to use the reloadData method.

CorePlot - Set y-Axis range to include all data points

为君一笑 提交于 2019-12-05 23:21:31
问题 I have implemented a CorePlot graph in my iOS application, however I am unable to dynamically size the y-Axis based on the data points in the set. Some datasets range from 10-50, while others would range from 400-500. In both cases, I would like to have y-origin (0) visible. I have tried using the scaletofitplots method: [graph.defaultPlotSpace scaleToFitPlots:[graph allPlots]]; but this has no effect on the graphs, they still show the default Y-Axis range of 0 to 1. The only way that I can

How do I draw horizontal bars in a chart using Core Plot?

喜欢而已 提交于 2019-12-05 15:38:17
I'm beginner with the Core Plot framework. Right now, I am able to render bar charts on the screen. However, I need to draw a horizontal bar chart that has the bars extending from the Y axis, like so: ^ y| |**** |******* |********** |****** |---------------> x How would I implement such a horizontal bar chart in Core Plot? you said you are using core-plot, there are sample codes with the framework, in which barChart has been implemented. You can have a look at it. EDIT: Sorry I saw you update now, and I got you need horizontal bars. Use following code. CPBarPlot * barPlot = [CPBarPlot ...];

Core plot mouseMoved

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-05 15:02:17
I would like to show (annotate) values in a scatterplot as the mouse is moved/hovering over a symbol or line. I understand this question has been asked before but I can only find answers that require the user to click the plot to show this information. I have tried to implement the mouseMoved method in my plotView delegate: - (void)mouseMoved:(NSEvent *)theEvent { NSPoint location = [hostingView convertPoint: [theEvent locationInWindow] fromView: nil]; CGPoint mouseLocation = NSPointToCGPoint(location); CGPoint pointInHostedGraph = [hostingView.layer convertPoint: mouseLocation toLayer:

iPhone CorePlot: Chart with user Touch Event

与世无争的帅哥 提交于 2019-12-05 14:43:56
I am now using Core-plot to develop application. I am looking for some touch event for user touch one point of the chart, then it show up the price. When i take a look of the CorePlot website, It has a application show what i need http://code.google.com/p/core-plot/wiki/AppsUsingCorePlot I really want to do this function by Core-plot, i am now using CorePlot 0.4 i want to do the following function I really want to have a touch event which can show the specify price of the point user touch. Thank you very much!! CorePlot provides a lot of ways to detect user touches: For plots: -(void)barPlot:

Positioning label on CPTBarPlot (Core-Plot)

六月ゝ 毕业季﹏ 提交于 2019-12-05 12:11:29
I am trying to change default position of labels in Bar chart with Core-Plot. I am using this method: -(CPTLayer *)dataLabelForPlot:(CPTPlot *)plot recordIndex:(NSUInteger)idx; And I return: return textLayer = [[CPTTextLayer alloc] initWithText:@"2222" style:textStyle]; I get this result: But I want to appear as follows: Any idea? I tried to find answer on documentation, but I has been impossible. Use a negative labelOffset for the bar plot. The default is +10 which puts the labels 10 pixels above the bars. This property is inherited from CPTPlot so it works for all plot types, although the

CorePlot: how to set touch event, when user click the CandleStick on the chart, then it can show the Candle X and Y Value?

大兔子大兔子 提交于 2019-12-05 07:21:38
问题 CorePlot: how to set touch event, when user click the CandleStick on the chart, then it can show the Candle X and Y Value? The value in left side is not correct,because the chart can be zoom in and zoom out , so may be the value need to include the scale value. But i don't know the scale value.... so is there any way to get the CandleStick Chart By click the screen? graph = [[CPTXYGraph alloc] initWithFrame:CGRectZero]; CPTTheme *theme = [CPTTheme themeNamed:kCPTStocksTheme]; [graph

CorePlot problems

青春壹個敷衍的年華 提交于 2019-12-05 05:34:51
问题 I started with core-plot now and came to some problems. I followed the tutorial from this page: http://www.switchonthecode.com/tutorials/using-core-plot-in-an-iphone-application and completed with the instructions from this page: http://code.google.com/p/core-plot/wiki/UsingCorePlotInApplications (such as -all_load). But I still have some problems, I get the following errors: error: incompatible type for argument 1 of 'setMajorIntervalLength:' error: request for member 'axisLabelOffset' in