Completed
Last Updated: 05 Aug 2015 14:48 by Leandro Mussi Silva
ADMIN
Danail Vasilev
Created on: 20 Jun 2014 11:50
Category: HtmlChart
Type: Feature Request
5
ADD autoBaseUnitSteps property for the x-axis in RadHtmlChart
The property will be like similar to http://docs.telerik.com/kendo-ui/api/dataviz/chart#configuration-categoryAxis.autoBaseUnitSteps.
For the time being the property can be set through the kendo widget:
ASPX:
		<script type="text/javascript">
			function pageLoad() {
				var kendoWidget = $find("<%=RadHtmlChart1.ClientID%>").get_kendoWidget();
				kendoWidget.options.categoryAxis.baseUnitStep = "auto";
				kendoWidget.options.categoryAxis.autoBaseUnitSteps = { months: [4] };
				kendoWidget.redraw();
			}
		</script>
		<telerik:RadHtmlChart ID="RadHtmlChart1" runat="server" Width="600" Height="400">
			<PlotArea>
				<Series>
					<telerik:ColumnSeries DataFieldY="SellQuantity">
					</telerik:ColumnSeries>
				</Series>
				<XAxis DataLabelsField="SellDate" >
					<LabelsAppearance DataFormatString="MM/yyyy" RotationAngle="45"></LabelsAppearance>
				</XAxis>
			</PlotArea>
		</telerik:RadHtmlChart>
C#:
	protected void Page_Load(object sender, EventArgs e)
	{
		RadHtmlChart1.DataSource = GetData();
		RadHtmlChart1.DataBind();
	}

	protected DataTable GetData()
	{
		DataTable dt = new DataTable();

		dt.Columns.Add("ID", typeof(int));
		dt.Columns.Add("SellQuantity", typeof(int));
		dt.Columns.Add("SellDate", typeof(DateTime));

		dt.Rows.Add(1, 2, new DateTime(2011, 01, 01));
		dt.Rows.Add(1, 2, new DateTime(2011, 06, 01));
		dt.Rows.Add(2, 5, new DateTime(2011, 12, 01));
		dt.Rows.Add(3, 6, new DateTime(2012, 06, 01));
		dt.Rows.Add(4, 4, new DateTime(2012, 09, 01));
		dt.Rows.Add(5, 7, new DateTime(2013, 03, 01));

		return dt;
	}
3 comments
Leandro Mussi Silva
Posted on: 12 Aug 2014 13:35
Totally necessary
Dan
Posted on: 30 Jun 2014 12:48
This is an excellent suggestion and would be hugely beneficial... gets my vote!
Darryl
Posted on: 30 Jun 2014 12:44
This feature is essential to making more data points show on the screen, allowing to also have more data with minimal scrolling. Additionally, the ability to add a scrollbar to the navigator, allowing for more data points would be greatly beneficial too.