Completed
Last Updated: 08 Apr 2014 16:05 by Saqib
ADMIN
Danail Vasilev
Created on: 26 Jun 2013 12:58
Category: HtmlChart
Type: Feature Request
3
Improve the type of MinValue and MaxValue properties for DateAxes in RadHtmlChart
Currently MinValue and MaxValue properties of the Axes accepts only decimal, so that when the axes are of date type, Min and Max dates cannot be set.

The workaround is to obtain the min and max values from the datasource field used for populating XAxis labels and set these values explicitly to the XAxis through the chartObject. For example:
<script type="text/javascript">
    function pageLoad() {
        //Get reference to the chart
        var chart = $find("<%=RadHtmlChart1.ClientID%>");
  
        //Obtain charts datasource
        var currDataSource = eval(chart.get_dataSourceJSON());
  
         //Get minValue for the datasource field used for populating XAxis Labels. In this example the field is named myDataSourceField
        var minValue = currDataSource[0].myDataSourceField;
  
        //Get maxValue for the datasource field used for populating XAxis Labels. In this example the field is named myDataSourceField
        var maxValue = currDataSource[currDataSource.length - 1].myDataSourceField;
  
        //Reference the chartObject's min and max properties
        chart._chartObject.options.xAxis.min = minValue;
        chart._chartObject.options.xAxis.max = maxValue;
  
        //Repaint the chart
        chart.repaint();
    }
</script>
2 comments
Saqib
Posted on: 08 Apr 2014 16:05
How can we do this for Asp.net ajax v.2013.3.1324.45?
ADMIN
Danail Vasilev
Posted on: 13 Feb 2014 14:13
The improvement will take effect in Q1 2014