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

RadHTMLChart Multiple Series from SQL

6 Answers 455 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
Thomas Cornelio
Top achievements
Rank 1
Thomas Cornelio asked on 20 Jan 2014, 11:19 AM
Hi,

I would like to plot a column chart similar to the one on your example : http://demos.telerik.com/aspnet-ajax/htmlchart/examples/charttypes/columnchart/defaultcs.aspx

In my case the X axis is the date and the Y axis is the Vehicle count as you can see from the attached image.

I am able to plot the date together with the vehicle count column on the Y axis as you can see on the attachment without any problems.

However i am unable to plot per day per the Nationality column as per my attachment with data. I am currently binding from SqlDataSource. 

In effect for each day i should have 5/6 different columns one per nationality.

Can you please assist as to how to accomplish this task?

Thanks.


6 Answers, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 21 Jan 2014, 11:05 AM
Hi Thomas,

It seems that you are trying to group the chart's data source. This feature is currently supported only by the RadChart and is illustrated in Grouping databound items help article.

Such an idea about the RadHtmlChart control has already been logged as a PITS item here, so that you can follow its progress cast you vote and/or leave a comment(e.g., how you would expect things to work).

For the time being you can manually group the data source of the chart, prior to binding it. Such an example is illustrated in the attached archive.

Regards,
Danail Vasilev
Telerik
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 the blog feed now.
0
Tommy
Top achievements
Rank 1
answered on 06 Feb 2014, 02:53 PM
Danail, 

I am trying to use the example that you gave for grouping a dataset and I am having an issue with this line in the code.
//Split current datatable to multiple datatables
dtarr[i] = oldDT.Select("Nationality='" + distinctValues.Rows[i][0].ToString() + "'").CopyToDataTable();

There is no definition for CopyToDataTable().  Can you point me in the right direction for this.  

Thanks 
Tommy 
0
Tommy
Top achievements
Rank 1
answered on 06 Feb 2014, 03:21 PM
I found the issue I was missing this reference. System.Data.DataSetExtensions
0
Asutosh
Top achievements
Rank 1
answered on 21 May 2014, 07:49 AM
hi
i am using the above code
its work for me
bt hoe can i bind x-axis data in above code 
u didnt show that
i want to make stack bar chart dril-down 
for that i nedd x-Axis data 
how can i bind that in above code which u attached in zip
0
Danail Vasilev
Telerik team
answered on 23 May 2014, 08:30 AM
Hello Asutosh,

The x-axis of the chart from the mentioned example is properly bound to the "YearMonth0" field from the data source. For example:

ASPX:
<telerik:RadHtmlChart ID="RadHtmlChart1" runat="server" Width="800" Height="500">
    <PlotArea>
        <XAxis DataLabelsField="YearMonth0">
            <LabelsAppearance RotationAngle="90">
                <TextStyle Bold="true" />
            </LabelsAppearance>
        </XAxis>
        <YAxis>
            <LabelsAppearance>
                <TextStyle Bold="true" />
            </LabelsAppearance>
        </YAxis>
    </PlotArea>
</telerik:RadHtmlChart>

You can make a test by running the provided example on 21-Jan-2014.

Regards,
Danail Vasilev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Danail Vasilev
Telerik team
answered on 14 Jul 2014, 02:26 PM
Hi All,

You can find the modified version of the RadHtmlChart's data source grouping example in the Group RadHtmlChart Data Source Code Library.

Regards,
Danail Vasilev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Chart (HTML5)
Asked by
Thomas Cornelio
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
Tommy
Top achievements
Rank 1
Asutosh
Top achievements
Rank 1
Share this question
or