/////////////////// 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.Data.OleDb; namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void chart1_Click(object sender, EventArgs e) { chart1.ChartAreas.Add("area"); chart1.ChartAreas["area"].AxisX.Minimum = 0; chart1.ChartAreas["area"].AxisX.Maximum = 20; chart1.ChartAreas["area"].AxisX.Interval =1 ; chart1.ChartAreas["area"].AxisY.Minimum = 0; chart1.ChartAreas["area"].AxisY.Interval =10 ; chart1.Series.Add("Meranie"); chart1.Series["Meranie"].Color=Color.Green; chart1.Series["Meranie"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; // } private void Form1_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'databaseDataSet.Meranie' table. You can move, or remove it, as needed. // this.meranieTableAdapter.Fill(this.databaseDataSet.Meranie); } private void X_Click(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { /* OleDbConnection conn = new OleDbConnection(); conn.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Users\Peto\Documents\Visual Studio 2010\Projects\Meranie vzduchu\Meranie vzduchu\bin\Tabulky.xls;Extended Properties= ""Excel 8.0;HDR=YES;"";"; OleDbCommand command1 = new OleDbCommand ( "SELECT Meno " + "FROM [Studenti$]", conn ); OleDbCommand command2 = new OleDbCommand ( "SELECT Priezvisko " + "FROM [Studenti$]", conn ); DataSet dsMeno = new DataSet(); DataSet dsPriezvisko = new DataSet(); OleDbDataAdapter adapter1 = new OleDbDataAdapter(command1); adapter1.Fill(dsMeno); OleDbDataAdapter adapter2 = new OleDbDataAdapter(command2); adapter2.Fill(dsPriezvisko); */ } private void chart1_Enter(object sender, EventArgs e) { chart1.ChartAreas.Add("area"); chart1.ChartAreas["area"].AxisX.Minimum = 0; chart1.ChartAreas["area"].AxisX.Maximum = 20; chart1.ChartAreas["area"].AxisX.Interval = 1; chart1.ChartAreas["area"].AxisY.Minimum = 0; chart1.ChartAreas["area"].AxisY.Interval = 10; chart1.Series.Add("Meranie"); chart1.Series["Meranie"].Color = Color.Green; chart1.Series["Meranie"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; /////////////////////////////////////////////////////////////////// // need some code ...... I need get data from excel and put graph ////////////////////////////////////////////////////////////// } private void button2_Click(object sender, EventArgs e) { OleDbConnection conn = new OleDbConnection(); conn.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Users\Peto\Documents\Visual Studio 2010\Projects\Meranie vzduchu\Meranie vzduchu\bin\Tabulky.xls; Extended Properties= ""Excel 8.0;HDR=YES;"";";
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)