PDA

View Full Version : حرفه ای: عدم رفرش کنترل چارت



safa.net
سه شنبه 03 بهمن 1396, 20:53 عصر
با سلام
این کد فقط یکبار اجرا میشه لطفا اگه کسی میتونه درستش کنه.
ممنون


Chart chart1 = new Chart();


// Create Chart Area
ChartArea chartArea1 = new ChartArea();


// Add Chart Area to the Chart
chart1.ChartAreas.Add(chartArea1);

// Create a data series
Series series1 = new Series();
chart1.Series.Clear();
chart1.Titles.Clear();
chart1.Series.Add("series1");




Connection cn = new Connection();
cn.GetConnection();
cn.Open();
DataSet ds = new DataSet();
SqlDataAdapter adapt = new SqlDataAdapter("select count(*) as Total,DATEPART(month,sabtdatefa) [Month] from xx", cn.GetConnection());
adapt.Fill(ds);
chart1.DataSource = ds;
chart1.DataBind();
cn.Close();
//set the member of the chart data source used to data bind to the X-values of the series
chart1.Series["series1"].XValueMember = "Month";
//set the member columns of the chart data source used to data bind to the X-values of the series
chart1.Series["series1"].YValueMembers = "Total";

chart1.Titles.Add("نمودار آماری");
// Show data points values as labels
chart1.Series["series1"].IsValueShownAsLabel = true;
// Set chart control location
chart1.Location = new System.Drawing.Point(16, 48);
// Set Chart control size
chart1.Size = new System.Drawing.Size(360, 260);
// Add chart control to the form
this.Controls.AddRange(new System.Windows.Forms.Control[] { chart1 });
chart1.Parent = tabControl1.TabPages[2];
chart1.Series["series1"].ChartType = SeriesChartType.Bubble;

abdullah20
جمعه 06 بهمن 1396, 12:22 عصر
سلام
میخواید هر چند وقت یکبار بروز بشه؟

safa.net
چهارشنبه 11 بهمن 1396, 15:06 عصر
بازدن دکمه رفرش شه خوبه ...:لبخند: