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轴实时刷新 刷新 时间数据,没能实现。


©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 一、实验目的 学习使用 weka 中的常用分类器,完成数据分类任务。 二、实验内容 了解 weka 中 explo...
    yigoh阅读 8,638评论 5 4
  • 图表控件库 MPAndroidChart 的使用 使用方法 项目源码地址,包含了很多类型的图标 https://g...
    jinchuang阅读 835评论 0 0
  • 基础篇NumPy的主要对象是同种元素的多维数组。这是一个所有的元素都是一种类型、通过一个正整数元组索引的元素表格(...
    oyan99阅读 5,156评论 0 18
  • 8. Setting Colors Since release v1.4.0, the ColorTemplate...
    ngugg阅读 747评论 0 0
  • 我的笔尖曾写下过你的名字, 一笔一划都藏在字里行间, 而你却早已消失在我世界里; 我的梦里曾有你来过的身影, 一举...
    白欢欢阅读 888评论 0 0