private void FillData(NVectorSeries vectorSeries)
        {
            double x = 0, y = 0;
            int    k = 0;

            for (int i = 0; i < 10; i++)
            {
                x  = 1;
                y += 1;

                for (int j = 0; j < 10; j++)
                {
                    x += 1;

                    double dx = Math.Sin(x / 3.0) * Math.Cos((x - y) / 4.0);
                    double dy = Math.Cos(y / 8.0) * Math.Cos(y / 4.0);

                    vectorSeries.XValues.Add(x);
                    vectorSeries.Values.Add(y);
                    vectorSeries.X2Values.Add(dx);
                    vectorSeries.Y2Values.Add(dy);

                    vectorSeries.ZValues.Add(y);
                    vectorSeries.Z2Values.Add(dy);

                    vectorSeries.BorderStyles[k] = new NStrokeStyle(1, ColorFromVector(dx, dy));
                    k++;
                }
            }
        }
Exemplo n.º 2
0
        public override void Initialize()
        {
            base.Initialize();

            // set a chart title
            NLabel title = new NLabel("Vector Direction Mode");

            title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic);
            title.TextStyle.FillStyle = new NColorFillStyle(GreyBlue);

            // no legend
            nChartControl1.Legends.Clear();

            // setup chart
            NChart chart = nChartControl1.Charts[0];

            //chart.Enable3D = true;
            chart.Width  = 55.0f;
            chart.Height = 55.0f;

            // setup X axis
            NLinearScaleConfigurator linearScale = new NLinearScaleConfigurator();

            chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = linearScale;
            linearScale.RoundToTickMin              = false;
            linearScale.RoundToTickMax              = false;
            linearScale.MajorGridStyle.ShowAtWalls  = new ChartWallType[] { };
            linearScale.InnerMajorTickStyle.Visible = false;

            // setup Y axis
            linearScale = new NLinearScaleConfigurator();
            chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator = linearScale;
            linearScale.RoundToTickMin              = false;
            linearScale.RoundToTickMax              = false;
            linearScale.MajorGridStyle.ShowAtWalls  = new ChartWallType[] { };
            linearScale.InnerMajorTickStyle.Visible = false;

            // setup shape series
            m_Vector                        = (NVectorSeries)chart.Series.Add(SeriesType.Vector);
            m_Vector.FillStyle              = new NColorFillStyle(Color.Red);
            m_Vector.BorderStyle.Color      = Color.DarkRed;
            m_Vector.DataLabelStyle.Visible = false;
            m_Vector.InflateMargins         = true;
            m_Vector.UseXValues             = true;
            //m_Vector.UseZValues = true;
            m_Vector.MinArrowHeadSize = new NSizeL(2, 3);
            m_Vector.MaxArrowHeadSize = new NSizeL(4, 6);
            m_Vector.MinVectorLength  = new NLength(8);
            m_Vector.MaxVectorLength  = new NLength(30);
            m_Vector.Mode             = VectorSeriesMode.Direction;

            // fill data
            FillData(m_Vector);

            // apply layout
            ConfigureStandardLayout(chart, title, null);

            MinVectorLengthNumericUpDown.Value = (decimal)m_Vector.MinVectorLength.Value;
            MaxVectorLengthNumericUpDown.Value = (decimal)m_Vector.MaxVectorLength.Value;
        }
Exemplo n.º 3
0
        private void FillData(NVectorSeries vectorSeries)
        {
            double x = 0, y = 0, z = 0;
            int    k = 0;

            for (int w = 0; w < 5; w++)
            {
                y  = 0;
                z += 1;

                for (int i = 0; i < 5; i++)
                {
                    x  = 0;
                    y += 1;

                    for (int j = 0; j < 5; j++)
                    {
                        x += 1;

                        double dx = Math.Sin(x / 4.0) * Math.Sin(x / 4.0);
                        double dy = Math.Cos(y / 8.0) * Math.Cos(w / 4.0);

                        vectorSeries.XValues.Add(x);
                        vectorSeries.Values.Add(y);
                        vectorSeries.ZValues.Add(z);
                        vectorSeries.X2Values.Add(x + dx);
                        vectorSeries.Y2Values.Add(y + dy);
                        vectorSeries.Z2Values.Add(z - 0.5);

                        vectorSeries.BorderStyles[k] = new NStrokeStyle(1, ColorFromVector(dx, dy));
                        k += 1;
                    }
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            nChartControl1.BackgroundStyle.FrameStyle.Visible = false;

            // set a chart title
            NLabel title = new NLabel("Vector Legend Scale");

            title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 14, FontStyle.Italic);
            title.TextStyle.FillStyle = new NColorFillStyle(GreyBlue);

            // setup chart
            NChart chart = nChartControl1.Charts[0];

            chart.Width  = 55.0f;
            chart.Height = 55.0f;

            chart.Width  = 55.0f;
            chart.Height = 55.0f;

            // setup X axis
            NLinearScaleConfigurator linearScale = new NLinearScaleConfigurator();

            chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = linearScale;
            linearScale.RoundToTickMin              = false;
            linearScale.RoundToTickMax              = false;
            linearScale.MajorGridStyle.ShowAtWalls  = new ChartWallType[] { };
            linearScale.InnerMajorTickStyle.Visible = false;

            // setup Y axis
            linearScale = new NLinearScaleConfigurator();
            chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator = linearScale;
            linearScale.RoundToTickMin              = false;
            linearScale.RoundToTickMax              = false;
            linearScale.MajorGridStyle.ShowAtWalls  = new ChartWallType[] { };
            linearScale.InnerMajorTickStyle.Visible = false;

            // setup shape series
            NVectorSeries vector = (NVectorSeries)chart.Series.Add(SeriesType.Vector);

            vector.FillStyle              = new NColorFillStyle(Color.Red);
            vector.BorderStyle.Color      = Color.DarkRed;
            vector.DataLabelStyle.Visible = false;
            vector.InflateMargins         = true;
            vector.UseXValues             = true;
            vector.MinArrowHeadSize       = new NSizeL(2, 3);
            vector.MaxArrowHeadSize       = new NSizeL(4, 6);
            vector.MinVectorLength        = new NLength(8);
            vector.MaxVectorLength        = new NLength(30);
            vector.Mode        = VectorSeriesMode.Direction;
            vector.Legend.Mode = SeriesLegendMode.SeriesLogic;

            // fill data
            FillData(vector);

            // apply layout
            ApplyLayoutTemplate(0, nChartControl1, chart, title, nChartControl1.Legends[0]);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Called to initialize the example
        /// </summary>
        /// <param name="chartControl"></param>
        public override void Create()
        {
            // set a chart title
            NLabel title = new NLabel("2D Vector Field");

            title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, System.Drawing.FontStyle.Italic);
            title.TextStyle.FillStyle = new NColorFillStyle(GreyBlue);

            // no legend
            nChartControl1.Legends.Clear();

            // setup chart
            NChart chart = nChartControl1.Charts[0];

            chart.Enable3D = false;
            chart.Width    = 55.0f;
            chart.Height   = 55.0f;

            // setup X axis
            NLinearScaleConfigurator linearScale = new NLinearScaleConfigurator();

            chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = linearScale;
            linearScale.RoundToTickMin              = false;
            linearScale.RoundToTickMax              = false;
            linearScale.MajorGridStyle.ShowAtWalls  = new ChartWallType[] { };
            linearScale.InnerMajorTickStyle.Visible = false;

            // setup Y axis
            linearScale = new NLinearScaleConfigurator();
            chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator = linearScale;
            linearScale.RoundToTickMin              = false;
            linearScale.RoundToTickMax              = false;
            linearScale.MajorGridStyle.ShowAtWalls  = new ChartWallType[] { };
            linearScale.InnerMajorTickStyle.Visible = false;

            // setup shape series
            NVectorSeries vectorSeries = (NVectorSeries)chart.Series.Add(SeriesType.Vector);

            vectorSeries.FillStyle              = new NColorFillStyle(Color.Red);
            vectorSeries.BorderStyle.Color      = Color.DarkRed;
            vectorSeries.DataLabelStyle.Visible = false;
            vectorSeries.InflateMargins         = true;
            vectorSeries.UseXValues             = true;
            vectorSeries.MinArrowHeadSize       = new NSizeL(2, 3);
            vectorSeries.MaxArrowHeadSize       = new NSizeL(4, 6);

            // fill data
            FillData(vectorSeries);

            // apply layout
            ConfigureStandardLayout(chart, title, null);

            nChartControl1.Refresh();
        }
Exemplo n.º 6
0
        private void FillData(NVectorSeries vectorSeries)
        {
            double x = 0, y = 0;
            int    k = 0;

            for (int i = 0; i < 10; i++)
            {
                x  = 1;
                y += 1;

                for (int j = 0; j < 10; j++)
                {
                    x += 1;

                    double dx = Math.Sin(x / 3.0) * Math.Cos((x - y) / 4.0);
                    double dy = Math.Cos(y / 8.0) * Math.Cos(y / 4.0);

                    NColor color = ColorFromVector(dx, dy);
                    vectorSeries.DataPoints.Add(new NVectorDataPoint(x, y, x + dx, y + dy, new NColorFill(color), new NStroke(1, color)));
                    k++;
                }
            }
        }
Exemplo n.º 7
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        protected override NWidget CreateExampleContent()
        {
            NChartView chartView = CreateCartesianChartView();

            // configure title
            chartView.Surface.Titles[0].Text = "Standard Vector";

            // configure chart
            m_Chart = (NCartesianChart)chartView.Surface.Charts[0];

            m_Chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XOrdinalYLinear);

            // setup X axis
            NLinearScale linearScale = new NLinearScale();

            m_Chart.Axes[ENCartesianAxis.PrimaryX].Scale = linearScale;

            // setup Y axis
            linearScale = new NLinearScale();
            m_Chart.Axes[ENCartesianAxis.PrimaryY].Scale = linearScale;

            // setup shape series
            NVectorSeries vectorSeries = new NVectorSeries();

            m_Chart.Series.Add(vectorSeries);
            vectorSeries.DataLabelStyle   = new NDataLabelStyle(false);
            vectorSeries.InflateMargins   = false;
            vectorSeries.UseXValues       = true;
            vectorSeries.MinArrowheadSize = new NSize(2, 3);
            vectorSeries.MaxArrowheadSize = new NSize(4, 6);

            // fill data
            FillData(vectorSeries);

            return(chartView);
        }
        public override void Initialize()
        {
            base.Initialize();

            // set a chart title
            NLabel title = new NLabel("Vector Legend Scale");

            title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic);
            title.TextStyle.FillStyle = new NColorFillStyle(GreyBlue);


            nChartControl1.Legends[0].Header.Text = "Vector Length";

            // setup chart
            NChart chart = nChartControl1.Charts[0];

            chart.Width  = 55.0f;
            chart.Height = 55.0f;

            // setup X axis
            NLinearScaleConfigurator linearScale = new NLinearScaleConfigurator();

            chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = linearScale;
            linearScale.RoundToTickMin              = false;
            linearScale.RoundToTickMax              = false;
            linearScale.MajorGridStyle.ShowAtWalls  = new ChartWallType[] { };
            linearScale.InnerMajorTickStyle.Visible = false;

            // setup Y axis
            linearScale = new NLinearScaleConfigurator();
            chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator = linearScale;
            linearScale.RoundToTickMin              = false;
            linearScale.RoundToTickMax              = false;
            linearScale.MajorGridStyle.ShowAtWalls  = new ChartWallType[] { };
            linearScale.InnerMajorTickStyle.Visible = false;

            // setup shape series
            m_Vector                        = (NVectorSeries)chart.Series.Add(SeriesType.Vector);
            m_Vector.FillStyle              = new NColorFillStyle(Color.Red);
            m_Vector.BorderStyle.Color      = Color.DarkRed;
            m_Vector.DataLabelStyle.Visible = false;
            m_Vector.InflateMargins         = true;
            m_Vector.UseXValues             = true;
            //m_Vector.UseZValues = true;
            m_Vector.MinArrowHeadSize = new NSizeL(2, 3);
            m_Vector.MaxArrowHeadSize = new NSizeL(4, 6);
            m_Vector.MinVectorLength  = new NLength(8);
            m_Vector.MaxVectorLength  = new NLength(30);
            m_Vector.Mode             = VectorSeriesMode.Direction;
            m_Vector.Legend.Mode      = SeriesLegendMode.SeriesLogic;

            // fill data
            FillData(m_Vector);

            // apply layout
            ConfigureStandardLayout(chart, title, nChartControl1.Legends[0]);

            VectorLengthScaleModeComboBox.FillFromEnum(typeof(VectorLengthScaleMode));
            VectorLengthScaleModeComboBox.SelectedIndex = (int)m_Vector.VectorLengthScale.Mode;
            TextOffsetNumericUpDown.Value             = (decimal)m_Vector.VectorLengthScale.TextOffset.Value;
            TableCellOffsetNumericUpDown.Value        = (decimal)m_Vector.VectorLengthScale.TableCellOffset.Value;
            VectorLengthScaleStepsNumericUpDown.Value = (decimal)m_Vector.VectorLengthScale.Steps;
            RoundValuesCheckBox.Checked = m_Vector.VectorLengthScale.RoundValues;

            VectorLengthScaleModeCombo_SelectedIndexChanged(null, null);
        }
Exemplo n.º 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            nChartControl1.BackgroundStyle.FrameStyle.Visible = false;

            // set a chart title
            NLabel title = new NLabel("3D Vector Field");

            title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 14, FontStyle.Italic);
            title.TextStyle.FillStyle = new NColorFillStyle(GreyBlue);

            // no legend
            nChartControl1.Legends.Clear();

            // setup chart
            NChart chart = nChartControl1.Charts[0];

            chart.Enable3D             = true;
            chart.Projection.Type      = ProjectionType.Perspective;
            chart.Projection.Rotation  = -18;
            chart.Projection.Elevation = 13;
            chart.Depth  = 55.0f;
            chart.Width  = 55.0f;
            chart.Height = 55.0f;

            // setup X axis
            NLinearScaleConfigurator linearScale = new NLinearScaleConfigurator();

            chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = linearScale;
            linearScale.RoundToTickMin             = false;
            linearScale.RoundToTickMax             = false;
            linearScale.MajorGridStyle.ShowAtWalls = new ChartWallType[] { };

            // setup Y axis
            linearScale = new NLinearScaleConfigurator();
            chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator = linearScale;
            linearScale.RoundToTickMin             = false;
            linearScale.RoundToTickMax             = false;
            linearScale.MajorGridStyle.ShowAtWalls = new ChartWallType[] { };

            // setup Z axis
            linearScale = new NLinearScaleConfigurator();
            chart.Axis(StandardAxis.Depth).ScaleConfigurator = linearScale;
            linearScale.RoundToTickMin             = false;
            linearScale.RoundToTickMax             = false;
            linearScale.MajorGridStyle.ShowAtWalls = new ChartWallType[] { };

            // setup shape series
            NVectorSeries vectorSeries = (NVectorSeries)chart.Series.Add(SeriesType.Vector);

            vectorSeries.FillStyle              = new NColorFillStyle(Color.Red);
            vectorSeries.BorderStyle.Color      = Color.DarkRed;
            vectorSeries.Legend.Mode            = SeriesLegendMode.None;
            vectorSeries.DataLabelStyle.Visible = false;
            vectorSeries.InflateMargins         = true;
            vectorSeries.UseXValues             = true;
            vectorSeries.UseZValues             = true;

            vectorSeries.MinArrowHeadSize = new NSizeL(2, 3);
            vectorSeries.MaxArrowHeadSize = new NSizeL(4, 6);

            // fill data
            FillData(vectorSeries);

            // apply layout
            ApplyLayoutTemplate(0, nChartControl1, chart, title, null);
        }
Exemplo n.º 10
0
        public override void Initialize()
        {
            base.Initialize();

            nChartControl1.Controller.Tools.Add(new NPanelSelectorTool());
            nChartControl1.Controller.Tools.Add(new NTrackballTool());

            // set a chart title
            NLabel title = new NLabel("3D Vector Field");

            title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic);
            title.TextStyle.FillStyle = new NColorFillStyle(GreyBlue);

            // no legend
            nChartControl1.Legends.Clear();

            // setup chart
            NChart chart = nChartControl1.Charts[0];

            chart.Enable3D             = true;
            chart.Projection.Type      = ProjectionType.Perspective;
            chart.Projection.Rotation  = -18;
            chart.Projection.Elevation = 13;
            chart.Depth  = 55.0f;
            chart.Width  = 55.0f;
            chart.Height = 55.0f;

            // setup X axis
            NLinearScaleConfigurator linearScale = new NLinearScaleConfigurator();

            chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = linearScale;
            linearScale.RoundToTickMin             = false;
            linearScale.RoundToTickMax             = false;
            linearScale.MajorGridStyle.ShowAtWalls = new ChartWallType[] { };

            // setup Y axis
            linearScale = new NLinearScaleConfigurator();
            chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator = linearScale;
            linearScale.RoundToTickMin             = false;
            linearScale.RoundToTickMax             = false;
            linearScale.MajorGridStyle.ShowAtWalls = new ChartWallType[] { };

            // setup Z axis
            linearScale = new NLinearScaleConfigurator();
            chart.Axis(StandardAxis.Depth).ScaleConfigurator = linearScale;
            linearScale.RoundToTickMin             = false;
            linearScale.RoundToTickMax             = false;
            linearScale.MajorGridStyle.ShowAtWalls = new ChartWallType[] { };

            // setup shape series
            NVectorSeries vectorSeries = (NVectorSeries)chart.Series.Add(SeriesType.Vector);

            vectorSeries.FillStyle              = new NColorFillStyle(Color.Red);
            vectorSeries.BorderStyle.Color      = Color.DarkRed;
            vectorSeries.Legend.Mode            = SeriesLegendMode.None;
            vectorSeries.DataLabelStyle.Visible = false;
            vectorSeries.InflateMargins         = true;
            vectorSeries.UseXValues             = true;
            vectorSeries.UseZValues             = true;

            vectorSeries.MinArrowHeadSize = new NSizeL(2, 3);
            vectorSeries.MaxArrowHeadSize = new NSizeL(4, 6);

            // fill data
            FillData(vectorSeries);

            // apply layout
            ConfigureStandardLayout(chart, title, null);
        }