You think Creating Circuler Graph is a difficult task ...........!!!

Not difficult as much as I thogh, to create circular graphs
 /*
//User can use this method to rtive data from DB 
  string q9 = "select DISTINCT testcode from soilfinalcal order by testcode";
            DataSet st1 = MVCAController.db_access.SelectData(q9);

            if (st1 != null)
            {
                cmbCircleGraph.DataSource = st1.Tables[0];
                cmbCircleGraph.ValueMember = "testcode";
                cmbCircleGraph.DisplayMember = "testcode";
                cmbCircleGraph.Text = "";
            }
            else
                cmbCircleGraph.DataSource = null;
*/

        double[] xax = new double[180];
        double[] yax = new double[180];

        double radius = 77.24;
        double x = 177.24;
        double y = 0;

        double[] xax1 = new double[180];
        double[] yax1 = new double[180];

        double radius1 = 111.17;
        double x1 = 261.17;
        double y1 = 0;

        double[] xax2 = new double[180];
        double[] yax2 = new double[180];

        double radius2 = 87.66;
        double x2 = 287.66;
        double y2 = 0;
            for (int i = 0; i < 180; i++)
            {
                xax[i] = x + radius * Math.Cos(i * Math.PI / 180);
                yax[i] = y + radius * Math.Sin(i * Math.PI / 180);

                xax1[i] = x1 + radius1 * Math.Cos(i * Math.PI / 180);
                yax1[i] = y1 + radius1 * Math.Sin(i * Math.PI / 180);

                xax2[i] = x2 + radius2 * Math.Cos(i * Math.PI / 180);
                yax2[i] = y2 + radius2 * Math.Sin(i * Math.PI / 180);
            }

            Soilgrapcircle1.Series["Series1"].Points.DataBindXY(xax, yax);
            Soilgrapcircle1.Series["Series2"].Points.DataBindXY(xax1, yax1);
            Soilgrapcircle1.Series["Series3"].Points.DataBindXY(xax2, yax2);


code above  can generate below graph. You can change variable values and modify the graphs.



Comments

Popular posts from this blog

Find Country from URI

Encrypt and Decrypt text using alphabet shifting method

How to Call Stored Procedure