为什么使用自定义框架时,scatterPlotGraph 显示为实际图形的镜像?

发布于 2024-12-20 07:03:35 字数 553 浏览 5 评论 0原文

标题

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

酸甜透明夹心 2024-12-27 07:03:35

您的核心图代码看起来不错。确保 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文