Ejemplo n.º 1
0
        private void btnLoad_Click(object sender, EventArgs e)
        {
            GraphDataModel testData = new GraphDataModel("Ethnic Groups in Nepal", "Percentage", "Ethnic Group");

            testData.AddItem("Chhetteri", 16.6);
            testData.AddItem("Brahman - Hill", 16.6);
            testData.AddItem("Magar", 7.1);
            testData.AddItem("Tharu", 6.6);
            testData.AddItem("Tamang", 5.8);
            testData.AddItem("Newar", 5);
            testData.AddItem("Kami", 4.8);
            testData.AddItem("Muslim", 4.4);
            testData.AddItem("Yadav", 4);
            testData.AddItem("Rai", 2.3);
            testData.AddItem("Gurung", 2);
            testData.AddItem("Damai / Dholii", 1.8);
            testData.AddItem("Thakuri", 1.6);
            testData.AddItem("Limbu", 1.5);
            testData.AddItem("Sarki", 1.4);
            testData.AddItem("Teli", 1.4);
            testData.AddItem("Chamar / Harijan / Ram", 1.3);
            testData.AddItem("Kooiri / Kushwaha", 1.2);
            testData.AddItem("Other", 19);

            Random           rnd   = new Random();
            List <ItemModel> items = testData.GetItemList();

            foreach (ItemModel item in items)
            {
                testData.ChangeItemAt(items.IndexOf(item), item.Name, item.Data, Color.FromArgb(rnd.Next(256), rnd.Next(256), rnd.Next(256)));
            }
            testData.gType = 0;
            graphData      = testData;
            UpdateForm(1);
        }
Ejemplo n.º 2
0
 public graphFrm(GraphDataModel graphData)
 {
     InitializeComponent();
     this.graphData = graphData;
     canvas         = lblPanel.CreateGraphics();
     SetPen(Color.Blue, 1);
     GType = graphData.gType;
 }