using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Collections;
using System.Diagnostics;
using System.Reflection;
using Infragistics.UltraChart.Core;
using Infragistics.UltraChart.Core.Primitives;

namespace _140195
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            this.ultraChart1.Tooltips.FormatString = "<MY_VALUE>";
            //this.ultraChart1.Axis.X.Labels.ItemFormatString = "<MY_VALUE>";
            Hashtable MyLabelHashTable = new Hashtable();
            MyLabelHashTable.Add("MY_VALUE", new MyLabelRenderer(ultraChart1));
            this.ultraChart1.LabelHash = MyLabelHashTable;

            ultraChart1.DataSource = GetBubbleData();
            ultraChart1.DataBind();
            dataGridView1.DataSource = (DataTable)ultraChart1.DataSource;
        }
        #region Data for Bubble Chart
        private DataTable GetBubbleData()
        {
            DataTable mydata = new DataTable();
            //Define the columns and their names
            mydata.Columns.Add("ColumnX", typeof(int));
            mydata.Columns.Add("ColumnY", typeof(int));
            mydata.Columns.Add("ColumnZ (Radius)", typeof(int));
            //Add the rows of data
            mydata.Rows.Add(new Object[] { 2, 1, 8 });
            mydata.Rows.Add(new Object[] { 2, 4, 4 });
            mydata.Rows.Add(new Object[] { 2, 1, 2 });
            mydata.Rows.Add(new Object[] { 4, 3, 1 });
            mydata.Rows.Add(new Object[] { 2, 2, 2 });
            mydata.Rows.Add(new Object[] { 1, 3, 1 });
            mydata.Rows.Add(new Object[] { 2, 1, 4 });
            mydata.Rows.Add(new Object[] { 3, 2, 2 });
            mydata.Rows.Add(new Object[] { 4, 4, 8 });
            return mydata;
        }
        #endregion

        
    }
}
