Esempio n. 1
0
 private Envision.Components.Utils.PlotControl _createPlot(double[] x, double[] y)
 {
     if (!Hold || (plotControl.Window == null || plotControl.Window.IsDisposed))
     {
         plotControl = Utils.Plot(Title + " (" + this.ID + ")", x, y, true, UseDockableWindow);
         plotControl.Curve.GetXAxis(plotControl.Control.GraphPane).Title.Text = XLabel;
         plotControl.Curve.GetYAxis(plotControl.Control.GraphPane).Title.Text = YLabel;
     }
     if (Hold)
     {
         plotControl.Curve.Clear();
         for (int i = 0; i < x.Length; i++)
         {
             plotControl.Curve.AddPoint(x[i], y[i]);
         }
         plotControl.Control.AxisChange();
         plotControl.Control.Invalidate();
     }
     return(plotControl);
 }
Esempio n. 2
0
        private void _createPlot(double[] x, double[] y)
        {
            plotControl = Utils.Plot("Spectrum (" + this.ID + ")", x, y, true, this.UseDockableWindow);
            plotControl.Curve.GetXAxis(plotControl.Control.GraphPane).Title.Text = "Frequency(Hz)";
            plotControl.Curve.GetYAxis(plotControl.Control.GraphPane).Title.Text = "Power(Linear-Scale)";
            if (ShowPointValues)
            {
                var myPane = plotControl.Control.GraphPane;
                myPane.AxisChange(plotControl.Control.CreateGraphics());

                foreach (PointPair pt in plotControl.Points)
                {
                    string  label = pt.X.ToString();
                    TextObj text  = new TextObj(label, (float)pt.X, (float)pt.Y,
                                                CoordType.AxisXYScale, AlignH.Left, AlignV.Bottom);
                    text.FontSpec.Border.IsVisible = false;
                    myPane.GraphObjList.Add(text);
                }
            }
        }