This is a migrated thread and some comments may be shown as answers.

Stock Chart baseUnitStep problem

1 Answer 69 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Burak
Top achievements
Rank 1
Burak asked on 11 Apr 2014, 11:29 AM
Hello,

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

Sort by
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.

 
Tags
Charts
Asked by
Burak
Top achievements
Rank 1
Answers by
Hristo Germanov
Telerik team
Share this question
or