Site Map Mail This To A Friend PrivacyPolicy Subscribe to MakeLogic RSS Feed

Sample Applications Written in C#

MicroGraphs Screenshot

See : Samples in VB .NET
Samples can be written in any language that supports the CLR (Common Language Runtime) of the .NET Compact Framework

PieGraph Sample in C#

/*******************************************
*
* This program demonstrates the use of PieGraph component of the MicroGraphs
*
* Product Of : MakeLogic
* URL : http://www.makelogic.com
* Author : Madanu Ujjwal Kumar
* Date : 10 November, 2002
* Last Modified : 15 October, 2007
* email : madanuuk@makelogic.com AND madanuuk2@yahoo.com
*
*
*********************************************/

using System;
using System.Drawing;
using System.Collections;
using System.Windows.Forms;
using System.Data;
using MakeLogic.MG;

namespace PieGraphDemo
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class PieGraphDemo : System.Windows.Forms.Form
{
PieGraph pieGraph;

public PieGraphDemo()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();

/**********************************************************************
*
* MAKELOGIC code
* 1. Define size
* 2. Define the values and string label arrays
* 3. Assign some random data set to be plot on the PieGraph
* 4. Add PieGraph to the Form
*
* ********************************************************************/

int size = 5;
double[] values = new double[size];
string[] labels = new String[size];

Random random = new Random();
for(int i=0;i<size;i++)
{
values[i] = 4+(int)(random.NextDouble()*10);
labels[i] = "Data:"+(i+1);
}
try
{
pieGraph = new PieGraph(this.Width,this.Height);
pieGraph.Data = values;
pieGraph.Labels = labels;
}
catch(PieDataException e)
{
MessageBox.Show(e.Message,"PieGraph");
Application.Exit();
}

/***********************************************
*
* Properties - Testing
* 1. The following code helps in testing the various properties supported by the PieGraph
* 2. Uncomment one line at a time, recompile and run it to see the results
*
* ***********************************************/

//pieGraph.AxesColor = Color.Red;
//pieGraph.BackgroundColor =Color.Red;
//pieGraph.BorderColor = Color.Red;
//pieGraph.BorderOn = false;
//pieGraph.EventsButtonSize = 15;
//pieGraph.EventsEnabled = false;
//pieGraph.GraphBgColor = Color.Red;
//pieGraph.Insets = 50;
//pieGraph.LabelColor = Color.Red;
//pieGraph.LabelsFont = new Font("Verdana",16,FontStyle.Bold);
//pieGraph.PieFillColor = Color.Red;
//pieGraph.PieShade = Color.Red;
//pieGraph.Precision = 3;
//pieGraph.Title= "MakeLogic";
//pieGraph.TitleColor = Color.Red;
//pieGraph.TitleFont = new Font("Verdana",16,FontStyle.Bold);
//pieGraph.TitleOn = false;
//pieGraph.XAxisOn = false;
//pieGraph.XShift = 30;
//pieGraph.YAxisOn = false;
//pieGraph.YShift = 30;







this.Controls.Add(pieGraph);
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Text = "PieGraph: MakeLogic";

}
#endregion

/// <summary>
/// The main entry point for the application.
/// </summary>

static void Main()
{
Application.Run(new PieGraphDemo());
}
}
}
Was this information helpful to you?
Rock The Vote Next Poll Question

RSS Feeds
Subscribe to MakeLogic RSS Feed Add to My Yahoo! Add to Google
NewsLetter