This is a migrated thread and some comments may be shown as answers.

show the Legends and Set the Opecity of Chartrt

2 Answers 35 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Raghvendra
Top achievements
Rank 1
Raghvendra asked on 03 Aug 2012, 05:38 AM

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 Answers, 1 is accepted

Sort by
0
Raghvendra
Top achievements
Rank 1
answered on 05 Aug 2012, 01:59 PM
Please Help Me, as there is urgency in the projects.
Please Let me know if this requirement can be addressed by Telerik chart
0
Petar Marchev
Telerik team
answered on 07 Aug 2012, 08:06 AM
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.
Tags
Chart (Obsolete)
Asked by
Raghvendra
Top achievements
Rank 1
Answers by
Raghvendra
Top achievements
Rank 1
Petar Marchev
Telerik team
Share this question
or