如何在图表加载时更改滑块范围 [英] How to change slider range on chart load
问题描述
我正在研究Anychart投资组合仪表板
我如何才能将滑块的日期范围最小化仅一个月(在图表加载时),并且应该调整大小。
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.
推荐答案
使用 selectRange 方法:
您可以指定给定日期: http://playground.anychart.com/api/7.12.0/charts/anychart.charts。 Stock.selectRange-plain
You can specify given dates: http://playground.anychart.com/api/7.12.0/charts/anychart.charts.Stock.selectRange-plain
http://playground.anychart.com /api/7.12.0/charts/anychart.charts.Stock.selectRange_set_asUnit-plain
或使用预设的范围类型:
显示仅一个月的简单示例:
Easy sample showing this for "one month only":
chart.selectRange("MTD");
在这里: http://jsfiddle.net/97kc1jpw/
对于示例本身,我们认为升级它是个好主意,使用最新版本并在其中添加您描述的选项以及新的不错的范围选择器,请从 https://github.com/anychart-solutions/investment-portfolio-dashboard
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
您对此特别感兴趣行:仪表板中的第313行.js
You are interested in this particular line: Line 313 in dashboard.js
这篇关于如何在图表加载时更改滑块范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!