show the Legends and Set the Opecity of Chartrt

Thread is closed for posting
3 posts, 0 answers
  1. Raghvendra
    Raghvendra avatar
    2 posts
    Member since:
    Aug 2012

    Posted 03 Aug 2012 Link to this post

    Problem 1: My requirement is to show 4 spline area series in one chart, and whenever two chart overlap to other series should be transparent (ex. In attached image Investment chart is overlapping the Home chart, but due to transparency in Investment chart Home Chart is visible.
    Problem 2: How to show the Rad circled Legends in the Chart (refer chart.jpg )

    My code to create the Spline Area series is as below

     

    ASPX Code is

    <telerik:RadChart ID="RadChart1" runat="server"></telerik:RadChart>

     

    And code is as below

       protected void BindChart()

            {

     

                RadChart1.Height = System.Web.UI.WebControls.Unit.Pixel(1000);

                RadChart1.Width = System.Web.UI.WebControls.Unit.Pixel(1000);

     

                ChartSeries series1 = new ChartSeries("Series 1");

                series1.Appearance.LineSeriesAppearance.Color = System.Drawing.Color.Pink;

                series1.Type = ChartSeriesType.SplineArea;

               

                foreach (GraphDetail data in DebtGraph)

                {

                    ChartSeriesItem item = new ChartSeriesItem();

                    item.XValue = data.Age;

                    item.YValue = data.Dollar;

                    item.Label.Appearance.Visible = false;

                    series1.Items.Add(item);

                }

     

                RadChart1.Series.Add(series1);

     

                ChartSeries series2 = new ChartSeries("Series 2");

                series2.Appearance.LineSeriesAppearance.Color = System.Drawing.Color.Green;

                series2.Type = ChartSeriesType.SplineArea;

                foreach (GraphDetail data in HomeGraph)

                {

                    ChartSeriesItem item = new ChartSeriesItem();

     

                    item.XValue = data.Age;

                    item.YValue = data.Dollar;

                    item.Label.Appearance.Visible = false;

                    series2.Items.Add(item);

                }

     

                RadChart1.Series.Add(series2);

     

                ChartSeries series3 = new ChartSeries("Series 3");

                series3.Appearance.LineSeriesAppearance.Color = System.Drawing.Color.Red;

                series3.Type = ChartSeriesType.SplineArea;

                foreach (GraphDetail data in InvestmentGraph)

                {

                    ChartSeriesItem item = new ChartSeriesItem();

                    item.XValue = data.Age;

                    item.YValue = data.Dollar;

                    item.Label.Appearance.Visible = false;

                    series3.Items.Add(item);

                }

     

                RadChart1.Series.Add(series3);

              

            }

    this code gives me the Out put attached in myimplementation.jpg

     

  2. Raghvendra
    Raghvendra avatar
    2 posts
    Member since:
    Aug 2012

    Posted 05 Aug 2012 Link to this post

    Please Help Me, as there is urgency in the projects.
    Please Let me know if this requirement can be addressed by Telerik chart
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 07 Aug 2012 Link to this post

    Hello,

    1. To control the opacity of the series you can simply set the MainColor and SecondColor to be colors with the opacity in mind ( Appearance-FillStyle-MainColor="#33FF0000" ).  

    2. The legends you are referring to, look like some custom annotations. Unfortunately the asp.net RadChart only offers Marked Zone annotations, so I can only suggest you use the labels of the SeriesItem for this. I have attached a simple app to demonstrate the suggestion.

    Kind regards,
    Petar Marchev
    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