How to change slider range on chart load

2019-09-04 06:51发布

I am working on anychart investment portfolio dashboard anychart investment portfolio dashboard .
enter image description here How i can minimize date range of slider for one month only(on chart load) and it should be resizable.

标签: anychart
1条回答
不美不萌又怎样
2楼-- · 2019-09-04 07:01

Use selectRange method:

You can specify given dates: http://playground.anychart.com/api/7.12.0/charts/anychart.charts.Stock.selectRange-plain

Specify some interval from the start or end using anchors:

http://playground.anychart.com/api/7.12.0/charts/anychart.charts.Stock.selectRange_set_asUnit-plain

Or use preset range types:

http://playground.anychart.com/api/7.12.0/charts/anychart.charts.Stock.selectRange_set_as_Type-plain

Easy sample showing this for "one month only":

chart.selectRange("MTD");

Is here: http://jsfiddle.net/97kc1jpw/

As for sample itself, we decided it is a good idea to upgrade it, use the latest version and add the option you describe right in it, along with a new nice range selector, please pull the latest changes from https://github.com/anychart-solutions/investment-portfolio-dashboard

You are interested in this particular line: Line 313 in dashboard.js

查看更多
登录 后发表回答