RadHTMLChart Multiple Series from SQL

7 posts, 0 answers
  1. Thomas Cornelio
    Thomas Cornelio avatar
    5 posts
    Member since:
    Feb 2010

    Posted 20 Jan 2014 Link to this post

    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.


  2. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1490 posts

    Posted 21 Jan 2014 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Tommy
    Tommy avatar
    7 posts
    Member since:
    Jun 2013

    Posted 06 Feb 2014 in reply to Danail Vasilev Link to this post

    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 
  5. Tommy
    Tommy avatar
    7 posts
    Member since:
    Jun 2013

    Posted 06 Feb 2014 in reply to Tommy Link to this post

    I found the issue I was missing this reference. System.Data.DataSetExtensions
  6. Asutosh
    Asutosh avatar
    130 posts
    Member since:
    Sep 2013

    Posted 21 May 2014 in reply to Danail Vasilev Link to this post

    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
  7. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1490 posts

    Posted 23 May 2014 Link to this post

    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.

     
  8. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1490 posts

    Posted 14 Jul 2014 Link to this post

    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.

     
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017