How to change slider range on chart load

半世苍凉 提交于 2019-12-12 05:18:29

问题


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


回答1:


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



来源:https://stackoverflow.com/questions/40484376/how-to-change-slider-range-on-chart-load

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!