private void chkShow3D_CheckedChanged(object sender, System.EventArgs e) { bool is3d = chkShow3D.Checked; c1Chart1.ChartGroups[0].Use3D = is3d; hScrollBar1.Visible = is3d; vScrollBar1.Visible = is3d; labDepth.Visible = is3d; updnDepth.Visible = is3d; LabelsCollection labs = c1Chart1.ChartLabels.LabelsCollection; if (labs.Count > 0) { labs["hbar"].Visible = is3d; labs["vbar"].Visible = is3d; } // add and remove chart margins so there is room for chart labels Area area = c1Chart1.ChartArea; if (is3d) { area.Margins.Left = 10; area.Margins.Right = 10; c1Chart1.Header.Text = "3D Step Chart"; } else { area.Margins.Left = 0; area.Margins.Right = 0; c1Chart1.Header.Text = "2D Step Chart"; } }
private void StepChart_Resize(object sender, System.EventArgs e) { int cw = ClientSize.Width - hScrollBar1.Left - 1; int ch = ClientSize.Height - vScrollBar1.Top - 1; if (cw < 10) { cw = 10; } if (ch < 10) { ch = 10; } hScrollBar1.Width = cw; vScrollBar1.Height = ch; c1Chart1.Size = new Size(cw, ch); LabelsCollection labs = c1Chart1.ChartLabels.LabelsCollection; if (labs.Count > 1) { if (chkShow3D.Checked) { labs["hbar"].Size = new Size(cw, 12); labs["vbar"].Size = new Size(12, ch); } } }
public void AnnotateSlicewithImage(C1.Win.C1Chart.C1Chart chart, int seriesIndex) { ChartDataSeriesCollection series = chart.ChartGroups[0].ChartData.SeriesList; LabelsCollection labels = c1Chart1.ChartLabels.LabelsCollection; C1.Win.C1Chart.Label label; label = labels.AddNewLabel(); label.Image = imageList1.Images[seriesIndex]; label.Style.BackColor = Color.Transparent; label.Style.Border.BorderStyle = BorderStyleEnum.None; label.Style.GradientStyle = GradientStyleEnum.None; label.Style.ImageAlignment = AlignImageEnum.Top; label.Size = label.Image.Size + new Size(0, 20); label.Compass = LabelCompassEnum.Radial; label.Offset = 30; label.Connected = false; label.Visible = true; label.AttachMethod = AttachMethodEnum.DataIndex; label.Text = String.Format("{0:C0}", series[seriesIndex].Y[0]); AttachMethodData am = label.AttachMethodData; am.GroupIndex = 0; am.SeriesIndex = seriesIndex; am.PointIndex = 0; }
private void setLabelsStatus(bool labelsOn) { LabelsCollection labels = c1Chart1.ChartLabels.LabelsCollection; foreach (C1.Win.C1Chart.Label lab in labels) { lab.Visible = labelsOn; } }
private void UpdateTagsList() { LabelsCollection.Clear(); foreach (string CurrentTag in _LabelsList) { LabelsCollection.Add(new StringObject { Value = CurrentTag }); } }
/// <summary> /// If chart is running and no data received, last value is copied /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void _oneSecondTimer_Tick(object sender, EventArgs e) { if (SamplesCollection[0].Values.Count > 0) { SamplesCollection[0].Values.Add(SamplesCollection[0].Values[SamplesCollection[0].Values.Count - 1]); } else { SamplesCollection[0].Values.Add(0.0); } LabelsCollection.Add(DateTime.Now.ToString()); }
public void RemoveSliceImage(C1.Win.C1Chart.C1Chart chart, int seriesIndex) { LabelsCollection labels = c1Chart1.ChartLabels.LabelsCollection; for (int i = 0; i < labels.Count; i++) { if (labels[i].AttachMethodData.SeriesIndex == seriesIndex) { labels.RemoveAt(i); } } }
/// <summary> /// Main point of collection data, all class from ISamples send dataReceived event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void _data_DataReceived(object sender, List <double> e) { _oneSecondTimer.Stop(); var newSamples = new ObservableCollection <double>(e); foreach (var item in newSamples) { SamplesCollection[0].Values.Add(item); LabelsCollection.Add(DateTime.Now.ToString()); } _oneSecondTimer.Start(); }
private static void ExtractLabel(ref string line, int number) { var match = Regex.Match(line, @"\b([\w]*)\s*\:"); if (match.Success) { var gp = match.Groups[1].Value.ToUpper(); line = line.Replace(match.Groups[0].Value, string.Empty); if (!LabelsCollection.ContainsKey(gp)) { LabelsCollection.Add(gp, number); } } }