为什么使用自定义框架时,scatterPlotGraph 显示为实际图形的镜像?
标题
我正在使用 CorePlot 库来绘制 scatterPlot 图形。当我使用自定义框架来创建 CPTXYGraph 和 CPTGraphHostingView 实例时,图形显示为实际图形的镜像(即以还原方式)。谁能告诉我,我在哪里做错了。 请帮忙。这是我的代码:
graph = [[CPTXYGraph alloc] initWithFrame:CGRectMake(0, 0, 320, 300)];
CPTTheme *theme = [CPTTheme themeNamed:kCPTDarkGradientTheme];
[graph applyTheme:theme];
CPTGraphHostingView *hostingView = [[CPTGraphHostingView alloc] initWithFrame:CGRectMake(0, 0, 320, 300)];
[self.view addSubview:hostingView];
hostingView.collapsesLayers = NO;
hostingView.hostedGraph = graph;
Heading
I am using CorePlot Library for drawing scatterPlot graph. When i use customized frame for creating CPTXYGraph and CPTGraphHostingView instance, graph appears as the mirrror image of the actual graph (i.e. in reverted way). Can anyone tell me , whre i am doing mistake.
Please Help. Here is my code :
graph = [[CPTXYGraph alloc] initWithFrame:CGRectMake(0, 0, 320, 300)];
CPTTheme *theme = [CPTTheme themeNamed:kCPTDarkGradientTheme];
[graph applyTheme:theme];
CPTGraphHostingView *hostingView = [[CPTGraphHostingView alloc] initWithFrame:CGRectMake(0, 0, 320, 300)];
[self.view addSubview:hostingView];
hostingView.collapsesLayers = NO;
hostingView.hostedGraph = graph;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的核心图代码看起来不错。确保 self.view 没有应用任何可能会翻转图形的变换和/或子视图变换。
Your Core Plot code looks fine. Make sure
self.view
doesn't have any transform and/or subview transform applied that might be flipping the graph.