Exemple #1
0
        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";
            }
        }
Exemple #2
0
        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);
                }
            }
        }
Exemple #3
0
        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;
            }
        }
Exemple #5
0
 private void UpdateTagsList()
 {
     LabelsCollection.Clear();
     foreach (string CurrentTag in _LabelsList)
     {
         LabelsCollection.Add(new StringObject {
             Value = CurrentTag
         });
     }
 }
Exemple #6
0
 /// <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());
 }
Exemple #7
0
        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);
                }
            }
        }
Exemple #8
0
        /// <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();
        }
Exemple #9
0
        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);
                }
            }
        }