好紧好涨好大,国产亚洲精品999,在线激情视品,草av在线观看,制服av五区,香蕉伊人小说网,国产99热久久99,久久涩涩久久,日韩入B视频

首頁資訊商務(wù)會員鋼材特鋼不銹爐料鐵礦煤焦鐵合金有色化工水泥財經(jīng)指數(shù)人才會展鋼廠海外研究統(tǒng)計數(shù)據(jù)手機(jī)期貨論壇百科搜索導(dǎo)航短信English
鋼鐵博客  _潛伏_
鋼之家社區(qū)
鋼之家 | 鋼鐵博客 | 鋼鐵論壇 | 鋼鐵百科
歡迎登陸博客    s_1_586的辯論
主人信息
_潛伏_(公開)
Blog主人:s_1_586
Blog分類:休閑娛樂類
Blog積分:778.8
日志數(shù)量:1
開啟時間:2011-09-27
瀏覽次數(shù):8094
評論數(shù)量:0
最后更新:2011-09-27
最新文章
 ·【原創(chuàng)】Core Plot自定義Axis Label
最新評論

 【原創(chuàng)】Core Plot自定義Axis Label

字體: 評論:0 點(diǎn)擊:4286
Core Plot是支持Mac OS X和iOS的開源圖形框架,可生成各類柱狀圖、線型圖、餅圖。默認(rèn)的坐標(biāo)顯示為數(shù)值,但可以使用自定義的NumberFormatter來顯示各種坐標(biāo)標(biāo)簽。

自定義NumberFormatter,初始化時輸入包含自定義標(biāo)簽的數(shù)組(這里是一組日期),重寫stringForObjectValue方法,這樣就可以根據(jù)索引值返回所需的自定義標(biāo)簽了。

PHP 代碼:
 #import <Foundation/Foundation.h>
@interface ChartDateFormatter NSNumberFormatter
{
    
NSArray *dates
}
-(
idinitWithDates: (NSArray *)inDates;
@
end
@implementation ChartDateFormatter
- (id)init
{
    
self = [super init];
    if (
self) {
        
// Initialization code here.
    
}
    return 
self;
}
- (
id)initWithDates: (NSArray *)inDates
{
    if(
self = [super init])
    {
        
dates inDates;
    }
    return 
self;
}
- (
NSString *)stringForObjectValue: (NSDecimalNumber *)coordinateValue {
    return [
dates objectAtIndex:coordinateValue.intValue];
}
@
end 


調(diào)用時,只要把相應(yīng)坐標(biāo)的labelFormatter設(shè)為自定義的NumberFormatter就可以了,坐標(biāo)的值是自定義標(biāo)簽數(shù)組的索引值。

PHP 代碼:
 CPTXYAxisSet *axisSet = (CPTXYAxisSet *)graph.axisSet;
    
CPTXYAxis *axisSet.xAxis;
    
CPTXYAxis *axisSet.yAxis;
    
//x.labelingPolicy = CPTAxisLabelingPolicyNone;
    
CPTConstraints x2Constraints = {CPTConstraintFixedCPTConstraintFixed};
    
x.isFloatingAxis YES;
    
x.constraints x2Constraints;
    
x.majorIntervalLength CPTDecimalFromString(@"10");
    
x.minorTicksPerInterval 4;//每兩個大刻度中有多少個小刻度,5等分的話,這個值為4
    
x.orthogonalCoordinateDecimal CPTDecimalFromString(@"0");
    
x.labelRotation M_PI 4;
    
x.majorTickLength 5;
    
x.minorTickLength 2;
    
ChartDateFormatter *myFormatter = [[[ChartDateFormatter allocinitWithDates:datesautorelease];
    
x.labelFormatter myFormatter

※ ※ ※ 本文純屬【s_1_586】個人意見,與【鋼之家鋼鐵博客】立場無關(guān).※ ※ ※

該日志尚無評論!


您希望聯(lián)系哪位客服?(單擊選擇)

雷山县| 阿克苏市| 兴山县| 中山市| 伊宁县| 永和县| 宜宾县| 齐河县| 拉萨市| 铁力市| 靖宇县| 萝北县| 郁南县| 富民县| 汝南县| 天祝| 伊吾县| 洪江市| 互助| 原阳县| 锡林郭勒盟| 海安县| 临武县| 翁牛特旗| 玛纳斯县| 余姚市| 临桂县| 新宾| 时尚| 凌海市| 修水县| 沁阳市| 乡城县| 麻栗坡县| 河源市| 张家口市| 安多县| 璧山县| 神池县| 友谊县| 贡嘎县|