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

首頁資訊商務(wù)會(huì)員鋼材特鋼不銹爐料鐵礦煤焦鐵合金有色化工水泥財(cái)經(jīng)指數(shù)人才會(huì)展鋼廠海外研究統(tǒng)計(jì)數(shù)據(jù)手機(jī)期貨論壇百科搜索導(dǎo)航短信English
鋼鐵博客  _潛伏_
鋼之家社區(qū)
鋼之家 | 鋼鐵博客 | 鋼鐵論壇 | 鋼鐵百科
歡迎登陸博客    s_1_586的辯論
主人信息
_潛伏_(公開)
Blog主人:s_1_586
Blog分類:休閑娛樂類
Blog積分:779.0
日志數(shù)量:1
開啟時(shí)間:2011-09-27
瀏覽次數(shù):8096
評論數(shù)量:0
最后更新:2011-09-27
最新文章
 ·【原創(chuàng)】Core Plot自定義Axis Label
最新評論
日歷
<< < 2026年8月 > >>
      1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31      
熱門文章TOP10   更多
總?cè)藬?shù)40
會(huì)員數(shù)0
游客數(shù)40

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

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

自定義NumberFormatter,初始化時(shí)輸入包含自定義標(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)用時(shí),只要把相應(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;//每兩個(gè)大刻度中有多少個(gè)小刻度,5等分的話,這個(gè)值為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】個(gè)人意見,與【鋼之家鋼鐵博客】立場無關(guān).※ ※ ※

該日志尚無評論!


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

萝北县| 昌黎县| 额济纳旗| 邮箱| 望奎县| 鄂州市| 凌云县| 区。| 康保县| 兴化市| 义马市| 南投市| 泗阳县| 通化县| 巴林右旗| 宜章县| 连山| 嘉峪关市| 阿巴嘎旗| 巴林左旗| 青海省| 新邵县| 禹城市| 凤阳县| 西贡区| 白山市| 米林县| 五常市| 日土县| 三都| 巴彦淖尔市| 仲巴县| 奉贤区| 尤溪县| 宁乡县| 房产| 朝阳区| 东乌珠穆沁旗| 乌拉特中旗| 远安县| 东源县|