Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Can any one help me with code,I want to know how to drilldown the chart which I have already created into any drill need an example how to achieve this

What I have tried:

C#
<pre>using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;

using dotnetCHARTING;

namespace dotnetpro
{
    public partial class sample1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            
            Chart.TitleBox.Label.Text = "Student Progress";
            Chart.Width = 750;
            Chart.Height = 550;
            dotnetCHARTING.SeriesCollection mySC = Calculate();
            Chart.XAxis.Label.Text = "Marks";
            Chart.YAxis.Label.Text = "No of Students";
            Chart.SeriesCollection.Add(Calculate());
            Chart.DefaultSeries.DefaultElement.URL = "JavaScript: myAlert(\'%Name Marks %SeriesName \')";
            Chart.TitleBox.Position = TitleBoxPosition.Full;
            Chart.TitleBox.Label.Font = new Font("TimesRoman", 10, FontStyle.Bold | FontStyle.Italic);
            Chart.TitleBox.Label.Alignment = StringAlignment.Center;
            Chart.TitleBox.Label.Color = Color.DarkBlue;
            Chart.TitleBox.Background.Color = Color.FromArgb(225, 122, 212);
            Chart.TitleBox.Padding = 7;
            Chart.LegendBox.DefaultEntry.LabelStyle.Font = new Font("Arial", 10, FontStyle.Italic);
            Chart.LegendBox.Line.Color = Color.FromArgb(56, 66, 177);
            Chart.LegendBox.Line.Width = 2;
            Chart.LegendBox.Background = new Background(Color.FromArgb(165, 174, 255), Color.FromArgb(233, 235, 240), 45);
            Chart.LegendBox.Orientation = dotnetCHARTING.Orientation.Bottom;
        }
       dotnetCHARTING.SeriesCollection Calculate()
        {
            dotnetCHARTING.SeriesCollection SC = new dotnetCHARTING.SeriesCollection();
            Random myR = new Random(1);
            for (int a = 0; a < 4; a++)
            {
                dotnetCHARTING.Series s = new dotnetCHARTING.Series();
                s.Name = "Series " + a.ToString();
                for (int b = 0; b < 1; b++)
                {
                    Element e = new Element();
                    e.Name = "Element " + b.ToString();
                    e.YValue = myR.Next(50);
                    s.Elements.Add(e);
                }

                SC.Add(s);
            }
            SC[0].Element.Color = Color.FromArgb(49, 255, 49);
            SC[0].Elements[0].Name = "English";
            SC[0].LegendEntry.Value = "13";
            SC[0].LegendEntry.Name = "Between 10-15";

            SC[1].Element.Color = Color.FromArgb(255, 255, 0);
            SC[1].Elements[0].Name = "Maths";
            SC[1].LegendEntry.Value = "32";
            SC[1].LegendEntry.Name = "Between 10-40";

            SC[2].Element.Color = Color.FromArgb(255, 99, 49);
            SC[2].Elements[0].Name = "Science";
            SC[2].LegendEntry.Value = "6";
            SC[2].LegendEntry.Name = "Between 0-10";

            SC[3].Element.Color = Color.FromArgb(0, 156, 255);
            SC[3].Elements[0].Name = "Computer";
            SC[3].LegendEntry.Value = "18";
            SC[3].LegendEntry.Name = "Between 15-30";
            return SC;
        }


    }
}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900