In my stock chart I use the baseUnitStep = "auto" option, but I wish to know the current baseUnitStep, whether "weeks" or "days" or "months" even thought it is auto all the time... Is there a way to get this value? It is imperative for me to get this option dynamically!
Thanks
1 Answer, 1 is accepted
0
Hristo Germanov
Telerik team
answered on 15 Apr 2014, 10:50 AM
Hi Burak,
Only the axis instance hold the baseUnit but it will be retrieve after the chart is rendered.
You can get the axis instance from the chart plot area after the chart rendering with this piece of code:
$("yourDivSelector").getKendoStockChart({
...
dataBound: function() {
setTimeout(function(){
var axes = $("#stock-chart").getKendoStockChart()._plotArea.axes;
var axis;
for (var i = 0; i < axes.length; i++) {
var item = axes[i];
if (item.options.name === "_navigator_labels") {
axis = item;
break;
}
}
console.log(axis.options.baseUnit);
}, 1);
}
});
Regards,
Hristo Germanov
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.