RadChart Issue

9 posts, 0 answers
  1. Sumair
    Sumair avatar
    3 posts
    Member since:
    Apr 2012

    Posted 29 Jan 2014 Link to this post


    I am using RadChart in Asp.Net
  2. Sumair
    Sumair avatar
    3 posts
    Member since:
    Apr 2012

    Posted 29 Jan 2014 in reply to Sumair Link to this post



    Please see this image
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1490 posts

    Posted 31 Jan 2014 Link to this post

    Hi Sumair,

    In order to handle that you can set an appropriate MinValue for the y-axis and/or align series items label on top of the items. For example:
    ASPX:
    <telerik:RadChart ID="RadChart2" runat="Server" Width="495px" Skin="Mac">
        <ClientSettings EnableZoom="false" ScrollMode="XOnly" XScale="4"></ClientSettings>
        <Series>
            <telerik:ChartSeries DataYColumn="MyColumn" Type="StackedBar">
                <Appearance></Appearance>
                <Appearance FillStyle-MainColor="223, 87, 60">
                </Appearance>
            </telerik:ChartSeries>
            <telerik:ChartSeries DataYColumn="MyColumn" Type="StackedBar">
            </telerik:ChartSeries>
            <telerik:ChartSeries DataYColumn="MyColumn" Type="StackedBar">
            </telerik:ChartSeries>
        </Series>
        <PlotArea>
            <YAxis MinValue="-3" MaxValue="30" AutoScale="false"></YAxis>
        </PlotArea>
        <Legend Visible="false"></Legend>
        <ChartTitle TextBlock-Text="Scrolling only (initial XScale applied)">
        </ChartTitle>
    </telerik:RadChart>

    C#:
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            DataTable dt = new DataTable();
            dt.Columns.Add(new DataColumn("MyColumn", typeof(int)));
            for (int i = 0; i < 10; i++)
            {
                DataRow dr = dt.NewRow();
                dr[0] = i;
                dt.Rows.Add(dr);
            }
            RadChart2.DataSource = dt;
            RadChart2.DataBind();
        }
    }

    I can also suggest that you try the newer HtmlChart control that render entirely on the client as SVG and its Data Navigation functionality (see also Zoom and Scroll Data Over Time with RadHtmlChart for ASP.NET AJAX blog post).

    More information on the pros and cons of both charts can be found in RadHtmlChart vs. RadChart, round 2. Which one is right for me? blog post. You may also useful Migrating from RadChart to RadHtmlChart
    set of articles
    that sheds more light on how to migrate the basic chart setup from RadChart to RadHtmlChart.


    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 UI for ASP.NET AJAX, subscribe to the blog feed now.
  5. Sumair
    Sumair avatar
    3 posts
    Member since:
    Apr 2012

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

    Thanks Danail for the response but unfortunately this is not solve my problem. if i set min value equals to minus 3 then i have to describe the maximum value of y-axis which i don't know. I have seen after setting y axis value minus 3 then automatically my y axis max value is around 8 . 
  6. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1490 posts

    Posted 04 Feb 2014 Link to this post

    Hello Sumair,

    I am sorry to say that there is not an easier way to handle that appearance issue. What I can suggest is that you try one of the following approaches:
    • Obtain the Max value from the data source and set it to the y-axis.
    • Keep the AutoScale property of the y-axis to true and just align the series labels on top of the items.
    • Try the newer RadHtmlChart control and its Data Navigation functionality.

    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 UI for ASP.NET AJAX, subscribe to the blog feed now.
  7. Ajay
    Ajay avatar
    3 posts
    Member since:
    Feb 2014

    Posted 20 Feb 2014 Link to this post

    I want to display my item name instead of yvalue.Currently it's displaying the item value.How can I do that?

    <telerik:RadChart ID="RadChart1" runat="server">
    <PlotArea>
    <XAxis MaxValue="5" MinValue="1" Step="1">
    </XAxis>
    <YAxis MaxValue="25" Step="5">
    </YAxis>
    <YAxis2 MaxValue="5" MinValue="1" Step="1">
    </YAxis2>
    </PlotArea>
    <Series>
    <telerik:ChartSeries Name="Series 1" Type="Pie">
    <Appearance LegendDisplayMode="Nothing" />
    <Items>
    <telerik:ChartSeriesItem YValue="4" Name="Severe">
    </telerik:ChartSeriesItem>
    <telerik:ChartSeriesItem YValue="5" Name="Critical">
    </telerik:ChartSeriesItem>
    <telerik:ChartSeriesItem YValue="12" Name="High">
    </telerik:ChartSeriesItem>
    <telerik:ChartSeriesItem YValue="8" Name="Moderate">
    </telerik:ChartSeriesItem>
    <telerik:ChartSeriesItem YValue="1" Name="Complaints Issued">
    </telerik:ChartSeriesItem>
    </Items>
    </telerik:ChartSeries>
    </Series>
    </telerik:RadChart>
  8. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1490 posts

    Posted 24 Feb 2014 Link to this post

    Hello Ajay,

    You can handle the OnBeforeLayout event where you can assign the series items labels with the series items names. For example:
    ASPX:
    <telerik:RadChart ID="RadChart1" runat="server" Width="600px" Height="400px" OnBeforeLayout="RadChart1_BeforeLayout">
        <PlotArea>
            <XAxis MaxValue="5" MinValue="1" Step="1">
            </XAxis>
            <YAxis MaxValue="25" Step="5">
            </YAxis>
            <YAxis2 MaxValue="5" MinValue="1" Step="1">
            </YAxis2>
        </PlotArea>
        <Series>
            <telerik:ChartSeries Name="Series 1" Type="Pie">
                <Appearance LegendDisplayMode="Nothing" />
                <Items>
                    <telerik:ChartSeriesItem YValue="4" Name="Severe">
                    </telerik:ChartSeriesItem>
                    <telerik:ChartSeriesItem YValue="5" Name="Critical">
                    </telerik:ChartSeriesItem>
                    <telerik:ChartSeriesItem YValue="12" Name="High">
                    </telerik:ChartSeriesItem>
                    <telerik:ChartSeriesItem YValue="8" Name="Moderate">
                    </telerik:ChartSeriesItem>
                    <telerik:ChartSeriesItem YValue="1" Name="Complaints Issued">
                    </telerik:ChartSeriesItem>
                </Items>
            </telerik:ChartSeries>
        </Series>
    </telerik:RadChart>

    C#:
    protected void RadChart1_BeforeLayout(object sender, EventArgs e)
    {
        for (int i = 0; i < RadChart1.Series[0].Items.Count; i++)
        {
            RadChart1.Series[0].Items[i].Label.TextBlock.Text = RadChart1.Series[0].Items[i].Name;
        }
    }


    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 UI for ASP.NET AJAX, subscribe to the blog feed now.
  9. sree
    sree avatar
    2 posts
    Member since:
    Sep 2015

    Posted 12 Sep 2015 Link to this post

    Hi i need help in displaying my radchart.

    My datatable looks like below

    DataTable dt = new DataTable();
    dt.Columns.Add("Country");
    dt.Columns.Add("Jan");
    dt.Columns.Add("Feb");
    dt.Columns.Add("Mar");
    dt.Columns.Add("Apr");
    dt.Rows.Add("US",134,1657.5,10.8,10);   //for every month i have some amounts associated for country

    i am having months as columns and for country wise i am having data for months in currency.

    want to display radchart with currency on y-axis for all the months on x-axis using colors for countrywise data

    like for "US" want to show red for my bars for every month data similarly for other countries.

    my month names should appear on x-axis labels and my country names as legend items.

     

    Please help me in achieving this. 

     

  10. sree
    sree avatar
    2 posts
    Member since:
    Sep 2015

    Posted 12 Sep 2015 Link to this post

    country  Jan     Feb         mar
    US       10.25   130.00   175.24
    INDIA   11.00   15.00      160.05

     

    country    2013     2014
    US           10.25    130
    INDIA       11         15

     

    the above are the datatables i am getting based on user selection either year or month.

    I want to display the amounts in radchart ( bar type ) where my x-axis defaultlabelnames should be monthname or year and legend items should be the country names and individual colors for country bases bars.

     

    how to display the above datatable in radchart from codebehind??

     

     

     

     

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