Charts: how to drag the LineChartView

Created on 26 Jan 2018  ·  9Comments  ·  Source: danielgindi/Charts

i have a question,i add the linechartView in uiview. the uiview add in a controller's view such
self.view addSubview:_firstIV self.chartView = [LineChartView new];
[_firstIV addSubview:_chartView]; i want to use the functions such as , i have total 12 months,but in the linchartview just display 6 month ,and another 6 months need i drag the linchartview to see it , to dispaly another 6 months . seems like move in scrollview. how can i achieve this behavior . wheather the chats libary support this functions.

Most helpful comment

Hi, I have found the solution. There is a function called "setVisibleXRangeMaximum". It means that you can set the 6 months data that will display in the chartView, and you can scroll the chart to see other 6 months data.
Hope it can help you!

All 9 comments

I also need this feature, how to achieve it?

Hi, I have found the solution. There is a function called "setVisibleXRangeMaximum". It means that you can set the 6 months data that will display in the chartView, and you can scroll the chart to see other 6 months data.
Hope it can help you!

@weifengsmile I have set the property, but it still doesn't work for me... I have set the maxVisibleCount and setVisibleXRangeMaximum. Plus, the dataArray's count is greater than the both. So I have no idea how to scroll the Chart without a ScrollView

Oh, I just set the property after the chart's data has been set then it can be scrolled.

use setVisibleXRange or similar proerties like moveViewToX

@liuxuan30 when i use HorizontalBarChartView, i also need display partial data, scroll to display other data. But i set setVisibleXRangeMaximum or setVisibleXRangeWithMinXRange:<#(double)#> maxXRange:<#(double)#> still doesn't work. can you help me how to solve it? thank.

我这边需求 一共可能30条数据,然后默认只显示五条,其余的通过左滑
已经进行了如下设置
[_lineView setVisibleXRangeMaximum:10];// 最大显示
[_lineView setVisibleXRangeMinimum:4];// 最小显示
[_lineView moveViewToX:19];// 移动到那个点 x轴坐标
现在不能进行拖拽,不知道如何解决
lineChartView.dragEnabled = YES;//启用拖拽图标
这个也已经设了,请问下如何解决呢?

我这边需求 一共可能30条数据,然后默认只显示五条,其余的通过左滑
已经进行了如下设置
[_lineView setVisibleXRangeMaximum:10];// 最大显示
[_lineView setVisibleXRangeMinimum:4];// 最小显示
[_lineView moveViewToX:19];// 移动到那个点 x轴坐标
现在不能进行拖拽,不知道如何解决
lineChartView.dragEnabled = YES;//启用拖拽图标
这个也已经设了,请问下如何解决呢?

请问你解决了吗 我也是

你好,你解决了吗。我也有这个问题

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PrashantKT picture PrashantKT  ·  3Comments

heumn picture heumn  ·  3Comments

brytnvmg picture brytnvmg  ·  4Comments

newbiebie picture newbiebie  ·  3Comments

coop44483 picture coop44483  ·  3Comments