예제 #1
0
        public void InitChart()
        {
            if (ChartData.ChartStyle.ChartBorderCornerRadius == 0)
            {
                Chart = new Plot((int)(0.94 * ChartData.ChartStyle.Width), (int)(0.94 * ChartData.ChartStyle.Height));
            }
            else
            {
                var d = (int)(2 * 0.5 * ChartData.ChartStyle.ChartBorderCornerRadius);
                Chart = new Plot(ChartData.ChartStyle.Width - d, ChartData.ChartStyle.Height - d);
            }


            Chart.AntiAlias(true, true, true);
            Chart.Grid(enable: false);
        }
예제 #2
0
        private void BtnSave_Click(object sender, EventArgs e)
        {
            var settings = plt.GetSettings();

            // vertical axis
            plt.YLabel(tbYlabel.Text);
            plt.Ticks(displayTicksYminor: cbYminor.Checked, dateTimeY: cbYdateTime.Checked);
            double y1, y2;

            double.TryParse(tbY1.Text, out y1);
            double.TryParse(tbY2.Text, out y2);
            plt.Axis(y1: y1, y2: y2);

            // horizontal axis
            plt.XLabel(tbXlabel.Text);
            plt.Ticks(displayTicksXminor: cbXminor.Checked, dateTimeX: cbXdateTime.Checked);
            double x1, x2;

            double.TryParse(tbX1.Text, out x1);
            double.TryParse(tbX2.Text, out x2);
            plt.Axis(x1: x1, x2: x2);

            // tick display options
            plt.Ticks(useOffsetNotation: cbTicksOffset.Checked, useMultiplierNotation: cbTicksMult.Checked);

            // image quality
            plt.AntiAlias(figure: rbQualityHigh.Checked, data: rbQualityHigh.Checked);
            //plt.mouseTracker.lowQualityWhileInteracting = cbQualityLowWhileDragging.Checked;

            // misc
            plt.Grid(enable: cbGrid.Checked);
            plt.Legend(enableLegend: cbLegend.Checked);
            if (cbStyle.Text != "")
            {
                Style newStyle = (Style)Enum.Parse(typeof(Style), cbStyle.Text);
                plt.Style(newStyle);
            }

            Close();
        }
예제 #3
0
            public void Render(Plot plt)
            {
                int pointCount = 51;

                double[] x   = DataGen.Consecutive(pointCount);
                double[] sin = DataGen.Sin(pointCount);
                double[] cos = DataGen.Cos(pointCount);

                plt.PlotScatter(x, sin, label: "Sin");
                plt.PlotScatter(x, cos, label: "Cos");

                plt.Title("Plot Title");
                plt.XLabel("Horizontal Axis");
                plt.YLabel("Vertical Axis");
                plt.Legend();

                plt.AntiAlias(figure: false, data: false, legend: false);

                // NOTE: anti-aliasing is automatically in the user control
                // while the mouse button is held down to improve performance
                // while panning and zooming. You can disable this feature by:
                // formsPlot1.Configure(lowQualityWhileDragging = false);
            }
예제 #4
0
 private void RbQualityLow_CheckedChanged(object sender, EventArgs e)
 {
     plt.AntiAlias(rbQualityHigh.Checked, rbQualityHigh.Checked);
 }