核心图:如何隐藏图,轴和标签? [英] Core plot: How to hide the plot, axis and labels?

查看:64
本文介绍了核心图:如何隐藏图,轴和标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个图,其中在默认图空间上绘制了Y和X轴以及主要图,然后我为辅助图提供了单独的图空间,每个辅助图都有自己的Y轴(所有地块)。

I have a graph with Y and X axises drawn on the default plot space along with the primary plot, and then I have separate plot spaces for auxiliary plots each with their own Y-axes (the X-axis is the same for all plots).

我正在实现用于打开和关闭辅助图的按钮,我希望这基本上包括整个图空间(图,自定义y轴和标签)自定义y轴)。绘图空间似乎没有任何隐藏属性,并且所有粗糙的绘图和轴都具有隐藏属性,将这些属性设置为 YES会使轴标签可见。

I'm implementing buttons to switch the auxiliary plots on and off and I would like this to include basically the whole plot space (plot, custom y-axis, and labels of the custom y-axis). There doesn't seem to be any 'hidden' property for the plot space, and all-tough the plot and the axis both have 'hidden' properties, setting these to 'YES' leaves the axis-labels visible.


  • 完全隐藏绘图空间内容而不导致不必要的重绘的最佳方法是什么?

我想一种方法可能是完全删除绘图空间并从图形中绘图,但这感觉并不直观。

I guess one way could be to remove the plot space and plot from the graph completely, but this feels unintuitive.

推荐答案

您还可以将所有标签设置为隐藏

you may also set all labels hidden

CPTAxis *axis = someAxis;
hidden = YES;

axis.hidden = hidden;
for (CPTAxisLabel *axisLabel in axis.axisLabels) {
    axisLabel.contentLayer.hidden = hidden;
}

这篇关于核心图:如何隐藏图,轴和标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆