public void InitializeChart() { PatientDetails details = (PatientDetails)SelectionHelper.GetRecordAtRowIndex(this.sfDataGrid1, this.sfDataGrid1.CurrentCell.RowIndex); this.chartControl1.Title.Visible = false; DateTime dt = DateTime.Now; Random r = new Random(); this.chartControl1.Series.Clear(); ChartSeries series = new ChartSeries("Temp", ChartSeriesType.Line); ChartSeries series1 = new ChartSeries("HR", ChartSeriesType.Line); ChartSeries series2 = new ChartSeries("RR", ChartSeriesType.Line); ChartSeries series3 = new ChartSeries("Sat", ChartSeriesType.Line); for (int i = 0; i < 7; i++) { series.Points.Add(dt.AddSeconds(i * 10), r.Next(10, 20)); series1.Points.Add(dt.AddSeconds(i * 10), r.Next(40, 50)); series2.Points.Add(dt.AddSeconds(i * 10), r.Next(70, 85)); series3.Points.Add(dt.AddSeconds(i * 10), r.Next(95, 110)); } series.Style.Border.Width = 4; series1.Style.Border.Width = 4; series2.Style.Border.Width = 4; series3.Style.Border.Width = 4; series.Style.Interior = new Syncfusion.Drawing.BrushInfo(ColorTranslator.FromHtml("#A2C133")); series1.Style.Interior = new Syncfusion.Drawing.BrushInfo(ColorTranslator.FromHtml("#339933")); series2.Style.Interior = new Syncfusion.Drawing.BrushInfo(ColorTranslator.FromHtml("#A05000")); series3.Style.Interior = new Syncfusion.Drawing.BrushInfo(ColorTranslator.FromHtml("#1BA1E2")); this.chartControl1.ChartArea.BackInterior = new Syncfusion.Drawing.BrushInfo(Color.FromArgb(133, 199, 117)); this.chartControl1.ChartInterior = new Syncfusion.Drawing.BrushInfo(Color.White); this.chartControl1.Series.Add(series); this.chartControl1.Series.Add(series1); this.chartControl1.Series.Add(series2); this.chartControl1.Series.Add(series3); this.chartControl1.ElementsSpacing = 0; this.chartControl1.ChartArea.ChartAreaMargins = new ChartMargins(0, 0, 0, 20); this.chartControl1.BackInterior = new Syncfusion.Drawing.BrushInfo(Color.Green); this.chartControl1.PrimaryXAxis.DrawGrid = false; this.chartControl1.PrimaryYAxis.GridLineType.ForeColor = Color.Gray; this.chartControl1.PrimaryXAxis.GridLineType.ForeColor = Color.Gray; this.chartControl1.PrimaryYAxis.LineType.ForeColor = Color.Transparent; this.chartControl1.PrimaryXAxis.LineType.ForeColor = Color.Transparent; this.chartControl1.PrimaryYAxis.TickColor = Color.Transparent; this.chartControl1.PrimaryXAxis.TickColor = Color.Transparent; this.chartControl1.PrimaryXAxis.ValueType = ChartValueType.DateTime; this.chartControl1.PrimaryXAxis.DateTimeRange = new ChartDateTimeRange(dt.AddSeconds(-10), dt.AddSeconds(70), 10, ChartDateTimeIntervalType.Seconds); this.chartControl1.PrimaryXAxis.DateTimeFormat = "hh:mm:ss \n MM/dd"; this.chartControl1.PrimaryYAxis.IsVisible = false; this.chartControl1.PrimaryYAxis.Range = new MinMaxInfo(0, 120, 30); this.chartControl1.PrimaryXAxis.ForeColor = Color.White; this.chartControl1.PrimaryYAxis.ForeColor = Color.White; this.chartControl1.PrimaryXAxis.HidePartialLabels = true; this.chartControl1.ShowLegend = false; this.chartControl1.ChartRegionMouseMove += chartControl1_ChartRegionMouseMove; this.chartControl1.Paint += chartControl1_Paint; }
private void GetCurrentRecordData() { object cd = SelectionHelper.GetRecordAtRowIndex(this.sfDataGrid1, this.sfDataGrid1.CurrentCell.RowIndex); label11.Text = ((PatientDetailsDemo.PatientDetails)(cd)).Name.ToString(); label8.Text = ((PatientDetailsDemo.PatientDetails)(cd)).HeartRate.ToString(); label6.Text = ((PatientDetailsDemo.PatientDetails)(cd)).RespirationRate.ToString(); label4.Text = ((PatientDetailsDemo.PatientDetails)(cd)).Saturation.ToString() + "%"; label10.Text = ((PatientDetailsDemo.PatientDetails)(cd)).Temperature.ToString(); label2.Text = (((PatientDetailsDemo.PatientDetails)(cd)).BloodPressure.ToString()) + "/" + (((PatientDetailsDemo.PatientDetails)(cd)).BloodPressure2.ToString()); }
public MainForm() { InitializeComponent(); Bitmap img = new Bitmap(Image.FromFile(imagepath + "App.ico")); this.Icon = Icon.FromHandle(img.GetHicon()); #region [ data source ] List <PatientDetails> list = new List <PatientDetails>(); List <PatientDetails> patientDetails = new List <PatientDetails>(); list = this.GetPatientDetails(); this.sfDataGrid1.DataSource = list; #endregion #region [ hide columns ] this.sfDataGrid1.Columns["ImageName"].Visible = false; this.sfDataGrid1.Columns["TileIntreval"].Visible = false;; this.sfDataGrid1.Columns["BloodPressure2"].Visible = false; this.sfDataGrid1.Columns["ID"].Visible = false; this.sfDataGrid1.Columns["RoomNo"].Visible = false; this.sfDataGrid1.Columns["Sex"].Visible = false; #endregion #region [ grid settings ] this.sfDataGrid1.ShowRowHeader = false; this.sfDataGrid1.Columns[10].HeaderText = "BP"; this.sfDataGrid1.Columns["Name"].HeaderText = "Full Name"; this.sfDataGrid1.Columns["HeartRate"].HeaderText = "Heart Rate"; this.sfDataGrid1.Columns["RespirationRate"].HeaderText = "Respiration Rate"; this.sfDataGrid1.NavigationMode = NavigationMode.Row; this.sfDataGrid1.Columns[0].CellStyle.HorizontalAlignment = HorizontalAlignment.Left; this.sfDataGrid1.Columns[5].CellStyle.HorizontalAlignment = HorizontalAlignment.Center; this.sfDataGrid1.AutoSizeColumnsMode = AutoSizeColumnsMode.Fill; this.sfDataGrid1.Style.HeaderStyle.BackColor = Color.FromArgb(51, 120, 158); this.sfDataGrid1.Style.HeaderStyle.TextColor = Color.White; this.sfDataGrid1.Style.HeaderStyle.PressedTextColor = Color.White; this.sfDataGrid1.Style.HeaderStyle.HoverTextColor = Color.White; this.sfDataGrid1.Style.HeaderStyle.Font.Size = 12f; this.sfDataGrid1.Style.HeaderStyle.HoverBackColor = Color.FromArgb(51, 120, 158); this.sfDataGrid1.Style.HeaderStyle.PressedBackColor = Color.FromArgb(51, 120, 158); this.sfDataGrid1.SelectionMode = GridSelectionMode.Single; this.sfDataGrid1.Style.CellStyle.VerticalAlignment = System.Windows.Forms.VisualStyles.VerticalAlignment.Center; this.sfDataGrid1.Style.CellStyle.HorizontalAlignment = HorizontalAlignment.Right; this.sfDataGrid1.Style.SelectionStyle.BackColor = Color.FromArgb(140, 198, 63); this.sfDataGrid1.Style.SelectionStyle.TextColor = Color.White; this.sfDataGrid1.RowHeight = (int)DpiAware.LogicalToDeviceUnits(40); this.sfDataGrid1.HeaderRowHeight = (int)DpiAware.LogicalToDeviceUnits(40); this.sfDataGrid1.IndentColumnWidth = 20; var record = SelectionHelper.GetRecordAtRowIndex(this.sfDataGrid1, 1); this.sfDataGrid1.SelectedItem = record; this.sfDataGrid1.BackColor = Color.White; this.sfDataGrid1.Style.CellStyle.Font.Size = 12f; this.sfDataGrid1.CellClick += sfDataGrid1_CellClick; this.sfDataGrid1.SelectionChanged += SfDataGrid1_SelectionChanged; //Chart label values GetCurrentRecordData(); #endregion #region Chart Initialize InitializeChart(); InitLiveChart(); this.timer1.Interval = 100; timer1.Tick += timer1_Tick; #endregion this.pictureBox2.Click += new EventHandler(pictureBox2_Click_2); this.pictureBox1.Click += new EventHandler(pictureBox1_Click_1); this.ResizeBegin += new EventHandler(MainForm_ResizeBegin); this.ResizeEnd += new EventHandler(MainForm_ResizeEnd); this.SizeChanged += new EventHandler(MainForm_SizeChanged); this.StartPosition = FormStartPosition.CenterScreen; ArrangeLocation(); }