Need Dynamic charting.

Thread is closed for posting
8 posts, 0 answers
  1. Muhammad Shoaib
    Muhammad Shoaib avatar
    3 posts
    Member since:
    May 2009

    Posted 24 Jun 2009 Link to this post

    Hi Every one,
    I want to build a class inherits from charts to make my charting dynamic. But when i try to make such class and add properties of chart control , it fails to set the properties and shows it read only.
    Regards
    Muhammad Shoaib.

  2. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 29 Jun 2009 Link to this post

    Hi Muhammad,

    Can you please provide more details about your scenario? I have created a small page to test it and it seems to work fine. You can find it attached.

    Sincerely,
    Ves
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Muhammad Shoaib
    Muhammad Shoaib avatar
    3 posts
    Member since:
    May 2009

    Posted 30 Jun 2009 Link to this post

    Hi Ves,
    Thanx for providing me the solution. It is very much useful for me, Now i have one more query about stacked bar chart. Actually i am new to telerik charts. I have 3 series named Space limit used, space limit projected, space limit total and i am providing it to my chart like this.


    ChartSeries cs = new ChartSeries();
            
            ChartSeries cs1 = new ChartSeries();
            ChartSeries cs2 = new ChartSeries();

            cs.AddItem(GetSpaceLimitUsed(), "Space Limit Used");
            cs.Name = "Used";        
            cs1.AddItem(4000, "Space Limit Projected");
            cs1.Name = "Projected";        
            cs2.AddItem(6000, "Space Limit Total");
            cs2.Name = "Total";
            
            objMyBarChart.Series.Add(cs);
            objMyBarChart.Series.Add(cs1);
            objMyBarChart.Series.Add(cs2);


    It will draw the chart image as three bars seperately ,but i want it to be drawn three bars one on another showing one stacked bar.
    Regards
    Muhammad Shoaib
  5. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 02 Jul 2009 Link to this post

    Hello Muhammad,

    Now all you need is to set the series type:

    cs.Type = ChartSeriesType.StackedBar;
    cs1.Type = ChartSeriesType.StackedBar;
    cs2.Type = ChartSeriesType.StackedBar;


    Best regards,
    Ves
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  6. Muhammad Shoaib
    Muhammad Shoaib avatar
    3 posts
    Member since:
    May 2009

    Posted 06 Jul 2009 Link to this post

    hi,
    i have another query .I am making dynamic chats controls, i am getting problems in settings colors of chart in plot area and text color of legend. I am passing colors in series items , the colors drawn in the chart is of gradient not solid. Secondly the legend items text color is not changed w r t skin. eg i am using black skin , all items of the chart has been changed to white except the legend color. note that i am making legend dynamically w . r. t series items.
    Here is my code.

            //passing series to chart , with series items and colors
            ChartSeries csud = new ChartSeries();      
            csud.Type = ChartSeriesType.Pie;
            csud.AddItem(7000, "Total",Color.Red);
            csud.AddItem(3500, "Projected",Color.Blue);
            csud.AddItem(2000, "Used",Color.Green);
            csud.Appearance.LegendDisplayMode = ChartSeriesLegendDisplayMode.Nothing;

    //making dynamic legend according to chart series items.
         if (RadChart1.Series.Count == 1)
            {
                int j = 0;
                for (j = 0; j < RadChart1.Series[0].Items.Count; j++)
                {
                    LabelItem lblitem = new LabelItem();
                    lblitem.TextBlock.Text = RadChart1.Series[0].Items[j].Label.TextBlock.Text;
                    RadChart1.Legend.Items.Add(lblitem);
                    RadChart1.Legend.Items[j].Marker.Appearance.FillStyle.MainColor = RadChart1.Series[0].Items[j].Appearance.FillStyle.MainColor;                
                }

            }
           

    Regards.
    Muhammad Shoaib
  7. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 09 Jul 2009 Link to this post

    Hi Muhammad,

    You can find attached a small example. Hope this will help.

    All the best,
    Ves
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  8. kiran
    kiran avatar
    2 posts
    Member since:
    May 2011

    Posted 09 Dec 2011 Link to this post

    i Have seen the solution .it is quite good.But i have a requirement like the  
    Space Limit Used
    Space Limit Projected
    Space Limit Total
    on the  x-axis
    but now i am getting a integer 1 i am attaching the image for your reference ......

    and Can i have some specify some space between the bars and i want to name x-axis (for ex -year ) and y-axis (sales)
    which mean for 12-01-2009(x-axis)        50% (Y-axis) sale 
    and so on and so forth.
    This is the same code 



            ChartSeries cs = new ChartSeries();


            ChartSeries cs1 = new ChartSeries();
            ChartSeries cs2 = new ChartSeries();
            cs.Type = ChartSeriesType.Bar;
            cs1.Type = ChartSeriesType.Bar;
            cs2.Type = ChartSeriesType.Bar;


            cs.AddItem(2000, "Space Limit Used");
            cs.Name = "Used";
            cs1.AddItem(4000, "Space Limit Projected");
            cs1.Name = "Projected";
            cs2.AddItem(6000, "Space Limit Total");
            cs2.Name = "Total";


            objMyBarChart.Series.Add(cs);
            objMyBarChart.Series.Add(cs1);
            objMyBarChart.Series.Add(cs2); 
     
  9. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 13 Dec 2011 Link to this post

    Hi Kiran,

    I am a bit confused here. First, there is a requirement about "Space Limit Used, Space Limit Projected, Space Limit Total, on the  x-axis" but later you mention dates for X axis.Can you please send us an image or a scratch, which shows how you would like the chart to look like with the data you have specified, so we can get back to you with a suggestion? Thanks.

    Best regards,
    Ves
    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017