For the time being the property can be set through the kendoWdiget: <script> function pageLoad() { var kendoWidget = $find("<%=RadHtmlChart1.ClientID%>")._chartObject; kendoWidget.options.series[0].labels.distance = 20; kendoWidget.redraw(); } </script> <telerik:RadHtmlChart ID="RadHtmlChart1" runat="server" Width="400px" Height="400px"> <PlotArea> <Series> <telerik:PieSeries> <SeriesItems> <telerik:PieSeriesItem Y="30" /> <telerik:PieSeriesItem Y="10" /> <telerik:PieSeriesItem Y="20" /> </SeriesItems> </telerik:PieSeries> </Series> </PlotArea> </telerik:RadHtmlChart>
The feature will be similar to Plot Bands (see http://demos.telerik.com/aspnet-ajax/htmlchart/examples/functionality/plot-bands/defaultcs.aspx demo), however, the width of lines will not be dependent on the y-axis scale.
For the time being the property can be set through the kendoWidget: Available options can be found here - http://docs.telerik.com/kendo-ui/api/dataviz/chart#configuration-categoryAxis.weekStartDay <script> function pageLoad() { var kendoWidget = $find("<%=RadHtmlChart1.ClientID%>")._chartObject; kendoWidget.options.categoryAxis.weekStartDay = 1; kendoWidget.redraw(); } </script> <telerik:RadHtmlChart runat="server" ID="RadHtmlChart1" Width="600px" Height="400px"> <PlotArea> <Series> <telerik:ColumnSeries Name="Product 1" DataFieldY="SellQuantity"> </telerik:ColumnSeries> </Series> <XAxis DataLabelsField="SellDate"> <LabelsAppearance DataFormatString="yyyy/MM/dd"></LabelsAppearance> </XAxis> </PlotArea> </telerik:RadHtmlChart>
In the Radchart there is a property called activeregion where the user can add a reference to html link. When the user clicks on the chart title, he can navigate to a new web page. This feature is not available in the new HtmlRadChart . We think that is suitable to have this function in the new HtmlRadchart. It can be even extended to axis labels of HtmlRadchart. Thank you for your help Best Regards AE
When user moved/resized RangeSelector it could be OnClientNavigationRangeChangedEvent fired, with new RangeSelector.From and RangeSelector.To values.
A workaround is to use the ClientTemplate and change the strings manually with some JavaScript (http://www.telerik.com/help/aspnet-ajax/htmlchart-client-templates-for-tooltips-and-labels-execute-javascript-and-display-html.html), e.g.: <telerik:RadHtmlChart runat="server" ID="RadHtmlChart1" Width="400px" Height="400px"> <PlotArea> <Series> <telerik:BarSeries> <LabelsAppearance> <ClientTemplate> #if (value > 0) {# $#=value# #} else {# -$#=value * -1# #} # </ClientTemplate> </LabelsAppearance> <SeriesItems> <telerik:CategorySeriesItem Y="20" /> <telerik:CategorySeriesItem Y="10" /> <telerik:CategorySeriesItem Y="-30" /> </SeriesItems> </telerik:BarSeries> </Series> </PlotArea> </telerik:RadHtmlChart>
Will be useful for pie/donut charts in responsive web page scenarios.
When the data passed to the RadHtmlChart with "stock" layout presents the highest and lowest base units, you must scroll the mouse wheel in order to navigate to the smallest base units. This issue can be handled for example by exposing a scroller in the navigator that let you select smaller date ranges.
I have a stacked bar RadHtmlChart that is created programmatically in the code behind. When I create the chart, and set the width to Unit.Pixel(1500), it works fine, as shown in Working.png. However, when I change the value to Unit.Percentage(90), the chart is not rendered properly at all. Any fixes/workarounds for this? Seán For the time being you must set percentage to the chart's wrapper. For example: CSS: <style type="text/css"> html, body, form { padding: 0; margin: 0; height: 100%; overflow: hidden; } .myChart { width: 100% !important; height: 100% !important; } </style> ASPX: <div style="width: 30%; height: 40%; border: 1px solid green;"> <telerik:RadHtmlChart runat="server" ID="RadHtmlChart1" CssClass="myChart" Width="600px" Height="400px"> <PlotArea> <Series> <telerik:ColumnSeries Name="Product 1"> <SeriesItems> <telerik:CategorySeriesItem Y="15000" /> <telerik:CategorySeriesItem Y="23000" /> <telerik:CategorySeriesItem Y="10000" /> </SeriesItems> </telerik:ColumnSeries> </Series> <XAxis> <Items> <telerik:AxisItem LabelText="1" /> <telerik:AxisItem LabelText="2" /> <telerik:AxisItem LabelText="3" /> </Items> </XAxis> </PlotArea> <ChartTitle Text="Product sales for 2011"> </ChartTitle> <Legend> <Appearance Position="Bottom" /> </Legend> </telerik:RadHtmlChart> </div>
For the time being you can utilize the Kendo UI charting scripts (http://demos.telerik.com/kendo-ui/bullet-charts/index) and API that RadHtmlChart use, in order to render a bullet chart: <form id="form1" runat="server"> <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager> <script> function createChart() { $telerik.$("#chart").kendoChart({ legend: { visible: false }, series: [{ type: "bullet", data: [[750, 762.5]] }], chartArea: { margin: { left: 0 } }, categoryAxis: { majorGridLines: { visible: false }, majorTicks: { visible: false } }, valueAxis: [{ plotBands: [{ from: 715, to: 752, color: "#ccc", opacity: .6 }, { from: 752, to: 772, color: "#ccc", opacity: .3 }], majorGridLines: { visible: false }, min: 715, max: 795, minorTicks: { visible: true } }], tooltip: { visible: true, template: "Maximum: #= value.target # <br /> Average: #= value.current #" } }); } function pageLoad() { createChart(); } </script> <div id="chart"></div> <telerik:RadHtmlChart ID="RadHtmlChart1" runat="server" style="display:none;"></telerik:RadHtmlChart> </form>
The option to generate a chart data table (based on the chart series) below a chart is available when using the RadChart control. A similar option/properties would be nice within the RadHtmlChart control. Thanks
Issue will be fixed for Q3 2014 release. For the time being you can manually set color to the selection hint: CSS: <style> .k-chart .k-navigator-hint .k-tooltip { color: black; } </style>
Adding a control from the JDash suite to the page breaks RadHtmlChart.
The lines can be similar to the ones in the box plot chart type - http://www.telerik.com/help/aspnet-ajax/htmlchart-types-box-plot-chart.html . For the time being you can use transparent box plot series in order to simulate this. For example: ASPX: <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager> <script> function pageLoad() { //Attach the legendItemClick event on pageLoad: var chart = $find("<%=RadHtmlChart1.ClientID%>")._chartObject.bind("legendItemClick", OnLegendClicked); } function OnLegendClicked(e) { if (e.seriesIndex >= 3) { var meanSeriesVisible = e.sender.options.series[3].visible; var medianSeriesVisible = e.sender.options.series[4].visible; if (meanSeriesVisible == medianSeriesVisible) { if (e.series.visible == false) { e.sender.options.series[5].visible = false; } } else { if (e.series.visible == false) { e.preventDefault(); e.sender.options.series[3].visible = false; e.sender.options.series[4].visible = false; e.sender.options.series[5].visible = true; e.sender.options.transitions = false; e.sender.redraw(); } } } } </script> <telerik:RadHtmlChart runat="server" ID="RadHtmlChart1" Width="1000" Height="500"> <PlotArea> <Series> <telerik:ColumnSeries Name="Germany Gold" GroupName="Germany" Gap="1"> <Appearance> <FillStyle BackgroundColor="#DDD9C3" /> </Appearance> <SeriesItems> <telerik:CategorySeriesItem Y="13" /> <telerik:CategorySeriesItem Y="12" /> <telerik:CategorySeriesItem Y="16" /> </SeriesItems> <TooltipsAppearance ClientTemplate="#= series.name# medals: #= dataItem.value#" /> <LabelsAppearance Visible="false"></LabelsAppearance> </telerik:ColumnSeries> <telerik:ColumnSeries Name="Germany Silver" GroupName="Germany"> <Appearance> <FillStyle BackgroundColor="#C4BD97" /> </Appearance> <SeriesItems> <telerik:CategorySeriesItem Y="17" /> <telerik:CategorySeriesItem Y="16" /> <telerik:CategorySeriesItem Y="10" /> </SeriesItems> <TooltipsAppearance ClientTemplate="#= series.name# medals: #= dataItem.value#" /> <LabelsAppearance Visible="false"></LabelsAppearance> </telerik:ColumnSeries> <telerik:ColumnSeries Name="Germany Bronze" GroupName="Germany"> <Appearance> <FillStyle BackgroundColor="#948A54" /> </Appearance> <SeriesItems> <telerik:CategorySeriesItem Y="26" /> <telerik:CategorySeriesItem Y="20" /> <telerik:CategorySeriesItem Y="15" /> </SeriesItems> <TooltipsAppearance ClientTemplate="#= series.name# medals: #= dataItem.value#" Color="White" /> <LabelsAppearance Visible="false"></LabelsAppearance> </telerik:ColumnSeries> <telerik:BoxPlotSeries Name="Mean" Visible="true"> <Appearance> <FillStyle BackgroundColor="Transparent" /> </Appearance> <SeriesItems> <telerik:BoxPlotSeriesItem Mean="11" Median="0" Lower="0" Upper="0" Q1="0" Q3="0"></telerik:BoxPlotSeriesItem> <telerik:BoxPlotSeriesItem Mean="15" Median="0" Lower="0" Upper="0" Q1="0" Q3="0"></telerik:BoxPlotSeriesItem> <telerik:BoxPlotSeriesItem Mean="14" Median="0" Lower="0" Upper="0" Q1="0" Q3="0"></telerik:BoxPlotSeriesItem> </SeriesItems> </telerik:BoxPlotSeries> <telerik:BoxPlotSeries Name="Median" Visible="false"> <Appearance> <FillStyle BackgroundColor="Transparent" /> </Appearance> <SeriesItems> <telerik:BoxPlotSeriesItem Mean="0" Median="12" Lower="0" Upper="0" Q1="0" Q3="0"></telerik:BoxPlotSeriesItem> <telerik:BoxPlotSeriesItem Mean="0" Median="10" Lower="0" Upper="0" Q1="0" Q3="0"></telerik:BoxPlotSeriesItem> <telerik:BoxPlotSeriesItem Mean="0" Median="13" Lower="0" Upper="0" Q1="0" Q3="0"></telerik:BoxPlotSeriesItem> </SeriesItems> </telerik:BoxPlotSeries> <telerik:BoxPlotSeries Name="Mean and Median" Visible="false"> <Appearance> <FillStyle BackgroundColor="Transparent" /> </Appearance> <SeriesItems> <telerik:BoxPlotSeriesItem Mean="11" Median="12" Lower="0" Upper="0" Q1="0" Q3="0"></telerik:BoxPlotSeriesItem> <telerik:BoxPlotSeriesItem Mean="15" Median="10" Lower="0" Upper="0" Q1="0" Q3="0"></telerik:BoxPlotSeriesItem> <telerik:BoxPlotSeriesItem Mean="14" Median="13" Lower="0" Upper="0" Q1="0" Q3="0"></telerik:BoxPlotSeriesItem> </SeriesItems> </telerik:BoxPlotSeries> </Series> <YAxis> <TitleAppearance Text="Number of Medals" /> </YAxis> <XAxis> <LabelsAppearance DataFormatString="Year {0}" /> <Items> <telerik:AxisItem LabelText="2000" /> <telerik:AxisItem LabelText="2004" /> <telerik:AxisItem LabelText="2008" /> </Items> </XAxis> </PlotArea> <ChartTitle Text="Olympic Medals Per Country Over the Years"> </ChartTitle> <Legend> <Appearance Position="Right" /> </Legend> </telerik:RadHtmlChart>
For the time being the property can be set through the chartObject. For example: <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> </telerik:RadScriptManager> <script> function pageLoad() { var chart = $find("<%=RadHtmlChart1.ClientID%>"); //DashType: dash, dashDot, dot, longDash, longDashDot, longDashDotDot, solid chart._chartObject.options.categoryAxis.majorGridLines.dashType = "dot"; chart._chartObject.options.categoryAxis.minorGridLines.dashType = "dot"; chart._chartObject.options.valueAxis.majorGridLines.dashType = "dot"; chart._chartObject.options.valueAxis.minorGridLines.dashType = "dot"; chart.repaint(); } </script> <telerik:RadHtmlChart ID="RadHtmlChart1" runat="server" Width="600px" Height="400px"> <PlotArea> <Series> <telerik:LineSeries Name="Series 1"> <SeriesItems> <telerik:CategorySeriesItem Y="30" /> <telerik:CategorySeriesItem Y="10" /> <telerik:CategorySeriesItem Y="20" /> </SeriesItems> </telerik:LineSeries> </Series> <XAxis> <Items> <telerik:AxisItem LabelText="item 1" /> <telerik:AxisItem LabelText="item 2" /> <telerik:AxisItem LabelText="item 3" /> </Items> </XAxis> </PlotArea> </telerik: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; }
For the time being you can do that manually with an initially hidden panel that stores the text/image and display it only when there is no data in the chart. This can be done on the server-side as well as on the client-side. For example: Server-side code: ASPX: <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager> <telerik:RadHtmlChart runat="server" ID="RadHtmlChart1" Skin="Black" Width="400px" Height="200px"> </telerik:RadHtmlChart> <asp:Panel runat="server" Visible="false" ID="panelImage" Width="200" Height="200"> <asp:Label ID="Label1" Text="There is not data in the chart" runat="server" /> <asp:Image ID="image1" runat="server" ImageUrl="telerik_new-logo.png" Width="200" /> </asp:Panel> C#: protected void Page_Load(object sender, EventArgs e) { BarSeries bar = new BarSeries(); //CategorySeriesItem csi = new CategorySeriesItem() { Y = 10 }; //bar.SeriesItems.Add(csi); RadHtmlChart1.PlotArea.Series.Add(bar); //If there isn't any items in the first series hide the chart and display the panel if ((RadHtmlChart1.PlotArea.Series[0] as BarSeries).SeriesItems.Count == 0) { RadHtmlChart1.Visible = false; panelImage.Visible = true; } } Client-side code: ASPX: <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager> <telerik:RadHtmlChart runat="server" ID="RadHtmlChart1" Skin="Black" Width="400px" Height="200px"> </telerik:RadHtmlChart> <asp:Panel runat="server" ID="panelImage" Width="200" Height="200" Style="display: none;"> <asp:Label ID="Label1" Text="There is not data in the chart" runat="server" /> <asp:Image ID="image1" runat="server" ImageUrl="telerik_new-logo.png" Width="200" /> </asp:Panel> <script type="text/javascript"> function pageLoad() { var chart = $find("<%=RadHtmlChart1.ClientID%>"); //Hide the chart and display the panel when there is no data in the first series if (chart._chartObject.options.series[0].data.length == 0) { chart.get_element().style.display = "none"; $get("<%=panelImage.ClientID%>").style.display = "block"; } } </script> C#: protected void Page_Load(object sender, EventArgs e) { BarSeries bar = new BarSeries(); //CategorySeriesItem csi = new CategorySeriesItem() { Y = 10 }; //bar.SeriesItems.Add(csi); RadHtmlChart1.PlotArea.Series.Add(bar); }