Unplanned
Last Updated: 05 May 2015 06:32 by ADMIN
ADMIN
Danail Vasilev
Created on: 05 May 2015 06:31
Category: HtmlChart
Type: Feature Request
1
ADD selection functionality in RadHtmlChart
The selection (http://demos.telerik.com/kendo-ui/chart-api/selection) can be configured through the kendo widget:
		<script>
			function pageLoad(args) {
				var kendoWidget = $find("<%=RadHtmlChart1.ClientID%>").get_kendoWidget();
				kendoWidget.options.categoryAxis.select = { from: 1, to: 2 };
				kendoWidget.bind("selectStart", onSelectStart);
				kendoWidget.bind("select", onSelect);
				kendoWidget.bind("selectEnd", onSelectEnd);

				kendoWidget.redraw();
			}

			function formatRange(e) {
				var categories = e.axis.categories;

				return kendo.format("{0} - {1} ({2} - {3})",
					e.from, e.to,
					categories[e.from],
					// The last category included in the selection is at (to - 1)
					categories[e.to - 1]
				);
			}

			function onSelectStart(e) {
				console.log(kendo.format("Select start :: {0}", formatRange(e)));
			}

			function onSelect(e) {
				console.log(kendo.format("Select :: {0}", formatRange(e)));
			}

			function onSelectEnd(e) {
				console.log(kendo.format("Select end :: {0}", formatRange(e)));
			}
		</script>
		<telerik:RadHtmlChart runat="server" ID="RadHtmlChart1" Width="600px" Height="400px">
			<PlotArea>
				<Series>
					<telerik:ColumnSeries Name="Product 1">
						<SeriesItems>
							<telerik:CategorySeriesItem Y="1" />
							<telerik:CategorySeriesItem Y="2" />
							<telerik:CategorySeriesItem Y="3" />
							<telerik:CategorySeriesItem Y="4" />
							<telerik:CategorySeriesItem Y="2" />
						</SeriesItems>
					</telerik:ColumnSeries>
				</Series>
				<XAxis>
					<Items>
						<telerik:AxisItem LabelText="1" />
						<telerik:AxisItem LabelText="2" />
						<telerik:AxisItem LabelText="3" />
						<telerik:AxisItem LabelText="4" />
						<telerik:AxisItem LabelText="5" />
					</Items>
				</XAxis>
			</PlotArea>
		</telerik:RadHtmlChart>
0 comments