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

X-axis and Legends Not Populating from SQL datasource

1 Answer 83 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
Tom
Top achievements
Rank 1
Tom asked on 05 Jul 2012, 10:48 AM
Hi,

I've been creating some graphs using the new Telerik HtmlChart control and have had some issues when trying to allocate a DataLabelField to the X-axis. I have ensured that the table headings have no spaces in them as I read that may be a problem.

I am using :

RadHtmlChart1.PlotArea.XAxis.DataLabelsField = "PriorityID"

The data is displayed in the graph correctly but any attempt to set the x axis is not being applied. The SQL I use provides a column of int (1-12) under the "PriorityID" column heading and a count column of int next to it for the actual data points.

Also on a similar vein is an issue based around legends. Again the data is being populated but unfortunately displaying a legend that is not being shown correctly. It seems to appear as a line of colours but very small and missing any labels to explain the data. I have included a picture to demonstrate the issue.

Both these issues are causing serious problems despite the actual graphing of the data being produced, as both limit the relevance of the data shown. Is this due to a shortcoming of the initial version of the control? Or possibly a mismatch between the mappings to take the axis/ legend data out of the datatable?

Thanks in advance,

Tom

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 06 Jul 2012, 09:02 AM
Hi Tom,

A PieChart does not have axes at all and this is explained in its online documentation:
http://www.telerik.com/help/aspnet-ajax/htmlchart-types-pie-chart.html
http://www.telerik.com/help/aspnet-ajax/htmlchart-structure-elements.html
The note paragraphs in each section expose this information.

On the subject of the legend and its configuration - I advise that you examine the PieChart online demo and go through its configurators right below the chart itself to see how it works and which properties are related to the appearance of the chart: http://demos.telerik.com/aspnet-ajax/htmlchart/examples/charttypes/piechart/defaultcs.aspx. Note that the text in the legend is taken from the name of the seriesItems. Currently they can be set in the code-behind by looping through the items of the series and setting their Name property.

Kind regards,
Marin Bratanov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Chart (HTML5)
Asked by
Tom
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or