Regarding Rad html chart

4 posts, 0 answers
  1. mysoona
    mysoona avatar
    7 posts
    Member since:
    Aug 2014

    Posted 08 Aug 2014 Link to this post



    Hi,

    Good evening.

    I need some technical help Regarding the chart.

    I want to pass string value in the select parameter.

    Link referred

    http://demos.telerik.com/aspnet-ajax/htmlchart/examples/drilldownchart/defaultcs.aspx

     

    In design:

    here we have used the select parameter as year which is
    integer(in my code I wnt to use string like ‘Monday’ and ‘july 2014’ how can I
    achieve this),

    <asp:SqlDataSource
    ID="SqlDataSource2"
    runat="server"
    ConnectionString="<%$
    ConnectionStrings:TelerikConnectionString %>"

              SelectCommand="SELECT
    Sum(Revenue) as Rev, Quarter FROM Revenue WHERE Year=@Year GROUP BY
    Quarter">

              <SelectParameters>

                   <asp:Parameter Name="Year"></asp:Parameter>

              </SelectParameters>

         </asp:SqlDataSource>

     

    Code behind:

     

    Here I want to use the string value in the highlighted area as
    mentioned above.Please help to fix this issue.

     

    public
    int Year

              {

                   get

                   {

                        if (ViewState["Year"]
    == null)

                        {

                             return 2003;

                        }

                        return (int)ViewState["Year"];

                   }

                   set

                   {

                        ViewState["Year"]
    = value;

                   }

              }

     

              protected
    void RadAjaxManager1_AjaxRequest(object
    sender,
    AjaxRequestEventArgs e)

              {

                   string
    seriesName =
    RadHtmlChart1.PlotArea.Series[0].Name;

     

                   if
    (seriesName ==
    "Years")

                   {

     

                        Year = int.Parse(e.Argument);

                        SqlDataSource2.SelectParameters[0].DefaultValue
    = Year.ToString();

                        RadHtmlChart1.PlotArea.XAxis.DataLabelsField
    = "Quarter";

                        RadHtmlChart1.PlotArea.Series[0].DataFieldY
    = "Rev";

                        RadHtmlChart1.PlotArea.Series[0].Name
    = "Quarters";

                        RadHtmlChart1.DataSourceID
    = "SqlDataSource2";

                   }

     

     

    Thanks
    & Regards

    Mysoona

  2. mysoona
    mysoona avatar
    7 posts
    Member since:
    Aug 2014

    Posted 08 Aug 2014 Link to this post

    wherever year comes i want to pass string value.So provide the suggestion asap.Its very critical.
  3. mysoona
    mysoona avatar
    7 posts
    Member since:
    Aug 2014

    Posted 11 Aug 2014 Link to this post

    hi can u please provide me some solution.Here instead of binding a chart in the series click i want to bind a radgrid.Suggest me a solution ASAP.Please.

    Thanks in advance.
  4. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1492 posts

    Posted 12 Aug 2014 Link to this post

    Hi Mysoona,

    Your question is not directly related to Telerik UI controls but general ASP.NET knowledge related to configuring declarative data sources.

    Nevertheless you may find useful this, this and this online resources that shed more light on the matter.


    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