我有一个非常简单的图表,我想启用触摸,我的第一部分工作:
plotSpace.delegate = self;
和方法:
-(BOOL)plotSpace:(CPPlotSpace *)space
shouldHandlePointingDeviceDownEvent:(id)event atPoint:(CGPoint)point
{
NSLog(@"touched at: x: %f y: %f", point.x, point.y);
}
Run Code Online (Sandbox Code Playgroud)
如何将点"点"转换为图形的绘图空间?
我可以看到方法,但我不确定如何使用它们,doco,虽然很大,并没有真正描述它们:)
非常感谢马克
我是Core Plot框架的初学者.现在,我能够在屏幕上渲染条形图.
但是,我需要绘制一个水平条形图,其条形图从Y轴延伸,如下所示:
^
y|
|****
|*******
|**********
|******
|---------------> x
Run Code Online (Sandbox Code Playgroud)
我如何在Core Plot中实现这样的水平条形图?
我现在正在使用Core-plot进行iPhone图表开发.但它有一些我无法达到的要求.
我现在正在使用CorePlot 0.4,示例代码AAPLot进行开发
请看下面的图片,然后你会知道我的问题是什么非常感谢你...
我真的需要帮助解决这个问题,谢谢


我希望我的结果像这个应用程序


我现在正在使用Core-plot来开发应用程序.我正在寻找一些触摸事件,用户触摸图表的一个点,然后它显示价格.
当我看一下CorePlot网站时,它有一个应用程序显示我需要的内容 http://code.google.com/p/core-plot/wiki/AppsUsingCorePlot

我真的想通过Core-plot来做这个功能,我现在正在使用CorePlot 0.4我想做以下功能


我真的想要一个触摸事件,它可以显示点用户触摸的指定价格.
非常感谢你!!
我正在使用核心情节绘制图表.我试图在绘图区域绘制我的图形,但它包含白色背景.但我想用我自己的背景绘制图形.这是我的代码.
// setting frame of graph
CGRect frame = [self.hostingView bounds];
self.graph = [[[CPTXYGraph alloc] initWithFrame:frame] autorelease];
// Add some padding to the graph, with more at the bottom for axis labels.
self.graph.plotAreaFrame.paddingTop = 10.0f;
self.graph.plotAreaFrame.paddingRight = 10.0f;
self.graph.plotAreaFrame.paddingBottom = 25.0f;
self.graph.plotAreaFrame.paddingLeft = 30.0f;
// set background color of plot area by fill property and CPTColor
self.graph.plotAreaFrame.plotArea.fill=[(CPTFill *)[CPTFill alloc] initWithColor: [CPTColor colorWithComponentRed:0.8 green:0.8 blue:0.8 alpha:1.0]];
// add graph to hosting view by hostedGraph property of hostingView
self.hostingView.hostedGraph = self.graph;
Run Code Online (Sandbox Code Playgroud)
在上面的代码中,我试图改变颜色,但我想在y轴上绘制每个刻度线的水平虚线.
我正在使用Core Plot绘制折线图,我希望Y轴标签显示为整数.例如,我的范围是0到10,间隔为1,但图表当前显示的是1.0,2.0,3.0等轴标签.
如何使Core Plot将标签显示为1,2,3等?
我希望能够将背景颜色放在y轴网格线之间的空间中.这可以通过核心情节来实现吗?如果是这样,怎么样?
任何帮助和/或示例代码将非常感激.
谢谢,
斯托
在iOS核心图上,我的数据是实时的,我希望它在数据滴答时向左滚动.我还希望用户能够水平平移,同时始终看到左侧可见的y轴.从一些谷歌搜索似乎曾经有过CPTAxis上的isFloatingAxis属性,但那已经不存在了.我该怎么办?我不认为设置约束是我需要的,因为我想要自由水平滚动来查看左右两侧的数据.
我正在尝试使用Core-Plot更改条形图中标签的默认位置.我正在使用这种方法:
-(CPTLayer *)dataLabelForPlot:(CPTPlot *)plot recordIndex:(NSUInteger)idx;
Run Code Online (Sandbox Code Playgroud)
我回来了:
return textLayer = [[CPTTextLayer alloc] initWithText:@"2222" style:textStyle];
Run Code Online (Sandbox Code Playgroud)
我得到这个结果:

但我想表现如下:

任何的想法?我试图在文档上找到答案,但我一直不可能.
嘿,最近使用CorePlot,但问题是,我设置的标签没有显示,我能看到的一件事是主要和次要TickLine,但也只在x线以上而不是下面.
这是我的代码:
subViewGraph=[[CPGraphHostingView alloc]init];
subViewGraph.frame=CGRectMake(0, 40, 320, 280);
subViewGraph.bounds=CGRectMake(0, 40, 320,280);
[self.view addSubview:subViewGraph];
graph = [[CPXYGraph alloc] initWithFrame:subViewGraph.bounds];
CPTheme *theme = [CPTheme themeNamed:kCPPlainWhiteTheme];
[graph applyTheme:theme];
subViewGraph.hostedGraph=graph;
graph.paddingBottom=40;
// Define some custom labels for the data elements
CPXYAxisSet *axisSet = (CPXYAxisSet *)graph.axisSet;
CPXYAxis *x=axisSet.xAxis;
CPLineStyle *lineStyle = [CPLineStyle lineStyle];
lineStyle.lineColor = [CPColor redColor];
lineStyle.lineWidth = 2.0f;
x.majorIntervalLength = [[NSDecimalNumber decimalNumberWithString:@"2"]decimalValue];
x.minorTicksPerInterval = 4;
x.majorTickLineStyle = lineStyle;
x.minorTickLineStyle = lineStyle;
x.axisLineStyle = lineStyle;
x.minorTickLength = 5.0f;
x.majorTickLength = 10.0f;
x.labelOffset=3.0;
x.labelRotation = …Run Code Online (Sandbox Code Playgroud) core-plot ×10
iphone ×6
ios ×5
charts ×2
objective-c ×2
background ×1
colors ×1
cptbarplot ×1
graph ×1
grid ×1
label ×1
labels ×1
position ×1