1.github上的一個(gè)庫 ? 搜索一下就知道 (怎么導(dǎo)入 就不BB了)
2.創(chuàng)建 ? 使用
? ?self.aaChartView = [[AAChartView alloc]initWithFrame:CGRectMake(0, self.timeLab.bottom+20, JH_WIDTH, 300)];
AAChartModel*aaChartModel=AAObject(AAChartModel)
? ? .chartTypeSet(AAChartTypeAreaspline)//設(shè)置圖表的類型(這里以設(shè)置的為柱狀圖為例)
? ? //? ? .symbolStyle
? ? .titleSet(@"")//設(shè)置圖表標(biāo)題
? ? .subtitleSet(@"")//設(shè)置圖表副標(biāo)題
? ? .xAxisVisibleSet(false)
? ? .yAxisVisibleSet(true)
? ? .yAxisLineWidthSet(@0) //隱藏Y軸
? ? .yAxisGridLineWidthSet(@0) //隱藏 網(wǎng)格 橫向
? ? .markerRadiusSet(@0)? ? //圓點(diǎn)的 大小
? ? .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"])//圖表橫軸的內(nèi)容
? ? .yAxisTitleSet(@"攝氏度")//設(shè)置圖表 y 軸的單位
? ? .gradientColorsThemeEnabledSet(true)
? ? .seriesSet(@[
?? ? ? ? ? ? ? ? AASeriesElement.new
?? ? ? ? ? ? ? ? .nameSet(@"實(shí)時(shí)溫度")
?? ? ? ? ? ? ? ? .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叙赚、刷新數(shù)據(jù)
? ? NSArray*series =@[
? ? ? ? ? ? ? ? ? ? ? ? @{@"name":@"2019",
? ? ? ? ? ? ? ? ? ? ? ? ? @"type":@"line",
? ? ? ? ? ? ? ? ? ? ? ? ? @"categories":xLabels,
? ? ? ? ? ? ? ? ? ? ? ? ? @"data":pointArr},
? ? ? ? ? ? ? ? ? ? ? ? ];
? ? [_aaChartView aa_onlyRefreshTheChartDataWithChartModelSeries:series];
4. 問題。我要搞 能表示 實(shí)時(shí)溫度的曲線圖敬辣。瘦馍∠际疲可是這個(gè)框架 Y軸的坐標(biāo)會(huì)自動(dòng)適應(yīng) ? 卻不能實(shí)時(shí)刷新 底部X軸的坐標(biāo)文本意鲸。有點(diǎn)蒙蔽。 我想要X軸實(shí)時(shí)刷新 刷新 時(shí)間數(shù)據(jù)帚稠,沒能實(shí)現(xiàn)怎囚。