AAChartKit 曲线图使用

1.github上的一个库   搜索一下就知道 (怎么导入 就不BB了)

2.创建   使用

   self.aaChartView = [[AAChartView alloc]initWithFrame:CGRectMake(0, self.timeLab.bottom+20, JH_WIDTH, 300)];

AAChartModel*aaChartModel=AAObject(AAChartModel)

    .chartTypeSet(AAChartTypeAreaspline)//设置图表的类型(这里以设置的为柱状图为例)

    //    .symbolStyle

    .titleSet(@"")//设置图表标题

    .subtitleSet(@"")//设置图表副标题

    .xAxisVisibleSet(false)

    .yAxisVisibleSet(true)

    .yAxisLineWidthSet(@0) //隐藏Y轴

    .yAxisGridLineWidthSet(@0) //隐藏 网格 横向

    .markerRadiusSet(@0)    //圆点的 大小

    .yAxisTickPositionsSet(@[@0, @10, @20, @30,@40])

//    .legendEnabledSet(NO)  //下面按钮是否显示

    //    .animationTypeSet(AAChartAnimationLinear)


//    .categoriesSet(@[@"12:30",@"12:30",@"12:30",@"12:30", @"12:30",@"12:30",@"12:30",@"12:30",@"12:30"])//图表横轴的内容

    .yAxisTitleSet(@"摄氏度")//设置图表 y 轴的单位

    .gradientColorsThemeEnabledSet(true)

    .seriesSet(@[

                 AASeriesElement.new

                 .nameSet(@"实时温度")

                 .dataSet(@[@0, @0, @0, @0,@0, @0, @0, @0, @0, @0, @0, @0,@0, @0, @0, @0, @0])

                 .colorSet((id)gradientColorDic1)

                 .stepSet((id)@(true))

                 ,


                 ])

    ;

    [_aaChartView aa_drawChartWithChartModel:aaChartModel];

3、刷新数据

    NSArray*series =@[

                        @{@"name":@"2019",

                          @"type":@"line",

                          @"categories":xLabels,

                          @"data":pointArr},

                        ];



    [_aaChartView aa_onlyRefreshTheChartDataWithChartModelSeries:series];

4. 问题。我要搞 能表示 实时温度的曲线图。。可是这个框架 Y轴的坐标会自动适应   却不能实时刷新 底部X轴的坐标文本。有点蒙蔽。 我想要X轴实时刷新 刷新 时间数据,没能实现。


AAChartKit 曲线图使用_第1张图片

你可能感兴趣的:(AAChartKit 曲线图使用)