核心图-设置缩放级别以仅显示图形的一部分 [英] Core Plot - set zoom level to show only part of graph

查看:59
本文介绍了核心图-设置缩放级别以仅显示图形的一部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个图:

X轴上的每个刻度都表示日历中的一天。但是如您所见,日期很难读,因此我想将缩放级别设置为仅显示7天而不是11天(如现在)。请查看下面的屏幕截图:

Every tick on the X-axis represents a day in the calendar. But as you can see, the date is very hard to read so I would like to set the the zoom level to show only 7 days instead of 11 (like right now). Please see screenshot below:

但是拥有更多可用数据很重要,因此用户可以向左滚动并仍然显示日期。

But it's important to have more data available, so users can scroll to the left and there will still be dates shown.

我该怎么做?

预先感谢。

推荐答案

您需要设置xRange和globallXRange属性才能正常工作。

You need to set the xRange and globallXRange properties to get work.

plotSpace.xRange = [CPPlotRange 
                    plotRangeWithLocation:CPDecimalFromFloat(0.0) 
                    length:CPDecimalFromUnsignedInteger(10)];

[plotSpace setGlobalXRange:[CPTPlotRange 
                    plotRangeWithLocation:CPTDecimalFromFloat(0.0) 
                    length:CPDecimalFromUnsignedInteger(50)]];

正确传递位置和长度值。

Pass location and length values correctly.

这篇关于核心图-设置缩放级别以仅显示图形的一部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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