Пример #1
0
        /// <summary>
        /// Called to initialize the example
        /// </summary>
        /// <param name="chartControl"></param>
        public override void Create()
        {
            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("3D Smooth Area");

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

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

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

            chart.Enable3D = true;
            chart.Width    = 65;
            chart.Height   = 40;
            chart.Axis(StandardAxis.Depth).Visible = false;
            chart.Projection.SetPredefinedProjection(PredefinedProjection.Perspective1);
            chart.LightModel.SetPredefinedLightModel(PredefinedLightModel.GlitterLeft);

            // add interlaced stripe
            NLinearScaleConfigurator linearScale = chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator as NLinearScaleConfigurator;
            NScaleStripStyle         stripStyle  = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);

            stripStyle.Interlaced = true;
            stripStyle.SetShowAtWall(ChartWallType.Back, true);
            stripStyle.SetShowAtWall(ChartWallType.Left, true);
            linearScale.StripStyles.Add(stripStyle);

            // add the area series
            NSmoothAreaSeries area = (NSmoothAreaSeries)chart.Series.Add(SeriesType.SmoothArea);

            area.DataLabelStyle.Visible = false;
            area.MarkerStyle.Visible    = true;
            area.MarkerStyle.PointShape = PointShape.Cylinder;
            area.MarkerStyle.AutoDepth  = true;
            area.MarkerStyle.Width      = new NLength(1.4f, NRelativeUnit.ParentPercentage);
            area.MarkerStyle.Height     = new NLength(1.4f, NRelativeUnit.ParentPercentage);

            GenreateYValues(nValuesCount);

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

            // apply style sheet
            NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.Fresh);

            styleSheet.Apply(nChartControl1.Document);

            // configure interactivity
            nChartControl1.Controller.Tools.Add(new NPanelSelectorTool());
            nChartControl1.Controller.Tools.Add(new NTrackballTool());

            // init form controls
            ShowMarkersCheckBox.IsChecked   = true;
            ShowDropLinesCheckBox.IsChecked = false;
            NExampleHelpers.FillComboWithEnumValues(AreaOriginModeComboBox, typeof(SeriesOriginMode));
            AreaOriginModeComboBox.SelectedIndex = 0;
            OriginValueTextBox.Text = "0";
        }
Пример #2
0
        private NLinearScaleConfigurator ConfigureScale(NFillStyle rulerFillStyle, Color tickColor)
        {
            NLinearScaleConfigurator scale = new NLinearScaleConfigurator();

            scale.RulerStyle.FillStyle                = (NFillStyle)rulerFillStyle.Clone();
            scale.RulerStyle.Shape                    = ScaleLevelShape.Bar;
            scale.RulerStyle.Height                   = new NLength(5, NGraphicsUnit.Point);
            scale.RulerStyle.BorderStyle.Color        = tickColor;
            scale.OuterMajorTickStyle.LineStyle.Color = tickColor;
            scale.InnerMajorTickStyle.LineStyle.Color = tickColor;
            scale.MajorGridStyle.LineStyle.Color      = tickColor;

            NScaleStripStyle strip = new NScaleStripStyle();

            strip.StrokeStyle = null;
            strip.FillStyle   = (NFillStyle)rulerFillStyle.Clone();
            strip.FillStyle.SetTransparencyPercent(80);
            strip.SetShowAtWall(ChartWallType.Back, true);
            strip.SetShowAtWall(ChartWallType.Left, true);
            scale.StripStyles.Add(strip);

            scale.MajorGridStyle.SetShowAtWall(ChartWallType.Back, true);
            scale.MajorGridStyle.SetShowAtWall(ChartWallType.Left, true);

            return(scale);
        }
Пример #3
0
        public override void Initialize()
        {
            base.Initialize();

            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("Series Marker Attribute");

            title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic);
            title.ContentAlignment    = ContentAlignment.BottomCenter;
            title.Location            = new NPointL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(2, NRelativeUnit.ParentPercentage));

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

            chart.Projection.SetPredefinedProjection(PredefinedProjection.Perspective1);
            chart.LightModel.SetPredefinedLightModel(PredefinedLightModel.GlitterLeft);
            chart.Enable3D = true;

            // add interlaced stripe to the Y axis
            NScaleStripStyle stripStyle = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);

            stripStyle.SetShowAtWall(ChartWallType.Back, true);
            stripStyle.SetShowAtWall(ChartWallType.Left, true);
            stripStyle.Interlaced = true;
            ((NStandardScaleConfigurator)chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator).StripStyles.Add(stripStyle);

            chart.Axis(StandardAxis.Depth).Visible = false;

            m_Line = (NLineSeries)chart.Series.Add(SeriesType.Line);
            m_Line.LineSegmentShape = LineSegmentShape.Tape;
            m_Line.InflateMargins   = true;
            m_Line.DepthPercent     = 50;
            m_Line.Legend.Mode      = SeriesLegendMode.DataPoints;
            m_Line.Name             = "Line Series";
            m_Line.Values.FillRandom(Random, 6);
            m_Line.DataLabelStyle.Visible = false;
            m_Line.ShadowStyle.Type       = ShadowType.GaussianBlur;
            m_Line.ShadowStyle.Offset     = new NPointL(2, 2);
            m_Line.ShadowStyle.Color      = Color.FromArgb(88, 0, 0, 0);
            m_Line.ShadowStyle.FadeLength = new NLength(5);
            m_Line.MarkerStyle.Visible    = true;

            NMarkerStyle marker = new NMarkerStyle();

            marker.FillStyle       = new NColorFillStyle(Color.Red);
            marker.PointShape      = PointShape.Cylinder;
            marker.Visible         = true;
            m_Line.MarkerStyles[3] = marker;

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

            StyleCombo.FillFromEnum(typeof(PointShape));

            SelectMarkerCombo.Items.Add("Edit Default Marker");
            SelectMarkerCombo.Items.Add("Edit Marker #3");
            SelectMarkerCombo.SelectedIndex = 0;

            VisibleCheck.Checked = true;
        }
Пример #4
0
        /// <summary>
        /// Called to initialize the example
        /// </summary>
        /// <param name="chartControl"></param>
        public override void Create()
        {
            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("Bubble Palette");

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

            // configure the chart
            m_Chart = nChartControl1.Charts[0];
            m_Chart.Projection.SetPredefinedProjection(PredefinedProjection.Orthogonal);
            m_Chart.LightModel.SetPredefinedLightModel(PredefinedLightModel.GlitterLeft);
            m_Chart.Axis(StandardAxis.Depth).Visible = false;

            NLinearScaleConfigurator linearScale = m_Chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator as NLinearScaleConfigurator;

            linearScale.MajorGridStyle.LineStyle.Pattern = LinePattern.Dot;

            // add interlace stripe
            NScaleStripStyle stripStyle = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);

            stripStyle.Interlaced = true;
            stripStyle.SetShowAtWall(ChartWallType.Back, true);
            stripStyle.SetShowAtWall(ChartWallType.Left, true);
            linearScale.StripStyles.Add(stripStyle);

            NOrdinalScaleConfigurator ordinalScale = m_Chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator as NOrdinalScaleConfigurator;

            ordinalScale.MajorGridStyle.LineStyle.Pattern = LinePattern.Dot;
            ordinalScale.MajorGridStyle.SetShowAtWall(ChartWallType.Back, true);

            // add a bubble series
            m_Bubble = (NBubbleSeries)m_Chart.Series.Add(SeriesType.Bubble);
            m_Bubble.DataLabelStyle.VertAlign = VertAlign.Center;
            m_Bubble.DataLabelStyle.Visible   = false;
            m_Bubble.Legend.Mode   = SeriesLegendMode.DataPoints;
            m_Bubble.Legend.Format = "Size <size>, Value <value>";
            m_Bubble.MinSize       = new NLength(7.0f, NRelativeUnit.ParentPercentage);
            m_Bubble.MaxSize       = new NLength(16.0f, NRelativeUnit.ParentPercentage);

            for (int i = 0; i < 10; i++)
            {
                m_Bubble.Values.Add(i);
                m_Bubble.Sizes.Add(i * 10 + 10);
            }

            m_Bubble.InflateMargins = true;

            NPalette palette = new NPalette();

            palette.SmoothPalette = true;
            palette.Clear();
            palette.Add(0, Color.Green);
            palette.Add(60, Color.Yellow);
            palette.Add(120, Color.Red);

            m_Bubble.Palette = palette;

            // apply layout
            ConfigureStandardLayout(m_Chart, title, nChartControl1.Legends[0]);
        }
Пример #5
0
        public override void Initialize()
        {
            base.Initialize();

            // set a chart title
            NLabel title = new NLabel("DateTime Step Line");

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

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

            // configure the chart
            NChart chart = nChartControl1.Charts[0];

            chart.Width      = 90;
            chart.BoundsMode = BoundsMode.Stretch;

            NLinearScaleConfigurator linearScale = chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator as NLinearScaleConfigurator;

            // add interlace stripe
            NScaleStripStyle stripStyle = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);

            stripStyle.Interlaced = true;
            stripStyle.SetShowAtWall(ChartWallType.Back, true);
            stripStyle.SetShowAtWall(ChartWallType.Left, true);
            linearScale.StripStyles.Add(stripStyle);

            // switch the X axis in date time scale mode
            NDateTimeScaleConfigurator dateTimeScale = new NDateTimeScaleConfigurator();

            chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = dateTimeScale;
            dateTimeScale.LabelGenerationMode = LabelGenerationMode.Stagger2;
            dateTimeScale.MajorGridStyle.SetShowAtWall(ChartWallType.Back, true);

            // setup step line series
            NStepLineSeries line = (NStepLineSeries)chart.Series.Add(SeriesType.StepLine);

            line.Name                   = "Step Line Series";
            line.InflateMargins         = true;
            line.UseXValues             = true;
            line.UseZValues             = false;
            line.DataLabelStyle.Visible = false;
            line.ShadowStyle.Type       = ShadowType.Solid;
            line.ShadowStyle.Color      = Color.FromArgb(15, 0, 0, 0);
            line.MarkerStyle.PointShape = PointShape.Cylinder;
            line.MarkerStyle.Width      = new NLength(1.2f, NRelativeUnit.ParentPercentage);
            line.MarkerStyle.Height     = new NLength(1.2f, NRelativeUnit.ParentPercentage);

            GenerateYValues(nValuesCount);
            GenerateXValues(nValuesCount);

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

            // apply style sheet
            NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.Fresh);

            styleSheet.Apply(nChartControl1.Document);
        }
Пример #6
0
        public override void Initialize()
        {
            base.Initialize();

            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("Smooth Line Chart");

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

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

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

            chart.BoundsMode = BoundsMode.Stretch;

            NLinearScaleConfigurator linearScale = (NLinearScaleConfigurator)chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator;

            linearScale.MajorGridStyle.LineStyle.Pattern = LinePattern.Dot;
            linearScale.MajorGridStyle.SetShowAtWall(ChartWallType.Back, true);

            // add interlaced stripe
            NScaleStripStyle stripStyle = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);

            stripStyle.Interlaced = true;
            stripStyle.SetShowAtWall(ChartWallType.Back, true);
            stripStyle.SetShowAtWall(ChartWallType.Left, true);
            linearScale.StripStyles.Add(stripStyle);

            // add the line
            NSmoothLineSeries line = (NSmoothLineSeries)chart.Series.Add(SeriesType.SmoothLine);

            line.Name                   = "Smooth Line";
            line.Legend.Mode            = SeriesLegendMode.Series;
            line.UseXValues             = false;
            line.UseZValues             = false;
            line.DataLabelStyle.Visible = false;
            line.MarkerStyle.Visible    = true;
            line.MarkerStyle.PointShape = PointShape.Cylinder;
            line.MarkerStyle.AutoDepth  = false;
            line.MarkerStyle.Width      = new NLength(1.4f, NRelativeUnit.ParentPercentage);
            line.MarkerStyle.Height     = new NLength(1.4f, NRelativeUnit.ParentPercentage);
            line.MarkerStyle.Depth      = new NLength(1.4f, NRelativeUnit.ParentPercentage);

            GenerateYValues(nValuesCount);

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

            // apply style sheet
            NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.Fresh);

            styleSheet.Apply(nChartControl1.Document);

            // init form controls
            InflateMarginsCheck.Checked = true;
            RoundToTickCheck.Checked    = true;
        }
        public override void Initialize(NThinChartControl control)
        {
            control.BackgroundStyle.FrameStyle.Visible = false;
            control.Panels.Clear();
            control.Width  = 600;
            control.Height = 300;
            NStandardFrameStyle frame = control.BackgroundStyle.FrameStyle as NStandardFrameStyle;

            frame.InnerBorderWidth = new NLength(0);

            // set a chart title
            // set a chart title
            NLabel title = control.Labels.AddHeader("Auto Update");

            title.TextStyle.FontStyle        = new NFontStyle("Times New Roman", 14, FontStyle.Italic);
            title.TextStyle.ShadowStyle.Type = ShadowType.LinearBlur;

            // setup Line chart
            NCartesianChart chart = new NCartesianChart();

            control.Panels.Add(chart);
            NRangeTimelineScaleConfigurator rangeTimeline = new NRangeTimelineScaleConfigurator();

            rangeTimeline.FirstRow.MinTickDistance = new NLength(40);
            chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = rangeTimeline;

            // setup Y axis
            NLinearScaleConfigurator scaleY = (NLinearScaleConfigurator)chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator;

            scaleY.MajorGridStyle.LineStyle.Pattern = LinePattern.Dot;

            // add interlace stripe
            NScaleStripStyle stripStyle = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);

            stripStyle.Interlaced = true;
            stripStyle.SetShowAtWall(ChartWallType.Back, true);
            stripStyle.SetShowAtWall(ChartWallType.Left, true);
            scaleY.StripStyles.Add(stripStyle);

            NLineSeries line = new NLineSeries();

            line.UseXValues             = true;
            line.DataLabelStyle.Visible = false;
            line.BorderStyle.Color      = Color.DarkOrange;
            line.BorderStyle.Width      = new NLength(2);
            chart.Series.Add(line);

            // generate some data
            GenerateNewData(control);

            ApplyLayoutTemplate(0, control, chart, title, null);

            // set auto update Callback
            control.AutoUpdateCallback = new NAutoUpdateCallback();

            // enable auto update
            control.ServerSettings.AutoUpdateInterval = 200;
            control.ServerSettings.EnableAutoUpdate   = true;
        }
        public override void Initialize()
        {
            base.Initialize();

            // set a chart title
            NLabel title = new NLabel("Step Line Intersections");

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

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

            // configure the chart
            NChart chart = nChartControl1.Charts[0];

            NLinearScaleConfigurator linearScale = chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator as NLinearScaleConfigurator;

            // add interlace stripe
            NScaleStripStyle stripStyle = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);

            stripStyle.Interlaced = true;
            stripStyle.SetShowAtWall(ChartWallType.Back, true);
            stripStyle.SetShowAtWall(ChartWallType.Left, true);
            linearScale.StripStyles.Add(stripStyle);

            m_Line                        = (NStepLineSeries)chart.Series.Add(SeriesType.StepLine);
            m_Line.Name                   = "Series 1";
            m_Line.DepthPercent           = 50;
            m_Line.LineSize               = 2;
            m_Line.DataLabelStyle.Visible = false;
            m_Line.MarkerStyle.Visible    = false;
            m_Line.Values.FillRandom(Random, 12);

            m_Point                        = (NPointSeries)chart.Series.Add(SeriesType.Point);
            m_Point.UseXValues             = true;
            m_Point.DataLabelStyle.Visible = false;
            m_Point.Size                   = new NLength(6);

            m_XCursor = new NAxisCursor();
            m_XCursor.BeginEndAxis = (int)StandardAxis.PrimaryY;
            m_YCursor = new NAxisCursor();
            m_YCursor.BeginEndAxis = (int)StandardAxis.PrimaryX;

            chart.Axis(StandardAxis.PrimaryX).Cursors.Add(m_XCursor);
            chart.Axis(StandardAxis.PrimaryY).Cursors.Add(m_YCursor);

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

            // apply style sheet
            NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.Fresh);

            styleSheet.Apply(nChartControl1.Document);

            LineSegmentRouteCombo.FillFromEnum(typeof(LineSegmentRoute));
            LineSegmentRouteCombo.SelectedIndex = 1;

            nChartControl1.MouseMove += new MouseEventHandler(OnChartControl1MouseMove);
        }
Пример #9
0
        public override void Initialize()
        {
            base.Initialize();

            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("DateTime Bars");

            title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic);
            title.ContentAlignment    = ContentAlignment.BottomCenter;
            title.Location            = new NPointL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(2, NRelativeUnit.ParentPercentage));

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

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

            chart.BoundsMode = BoundsMode.Stretch;

            NLinearScaleConfigurator linearScale = chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator as NLinearScaleConfigurator;

            linearScale.MajorGridStyle.LineStyle.Pattern = LinePattern.Dot;

            // add interlace stripes to the Y axis
            NScaleStripStyle stripStyle = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 2, 1);

            stripStyle.SetShowAtWall(ChartWallType.Back, true);
            stripStyle.SetShowAtWall(ChartWallType.Left, true);
            stripStyle.Interlaced = true;
            linearScale.StripStyles.Add(stripStyle);

            NDateTimeScaleConfigurator dateTimeScale = new NDateTimeScaleConfigurator();

            dateTimeScale.LabelFitModes       = new LabelFitMode[] { LabelFitMode.AutoScale };
            dateTimeScale.LabelGenerationMode = LabelGenerationMode.Stagger2;
            chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = dateTimeScale;

            // setup bar series
            NBarSeries bar = (NBarSeries)chart.Series.Add(SeriesType.Bar);

            bar.Name                   = "Bar Series";
            bar.InflateMargins         = true;
            bar.UseXValues             = true;
            bar.UseZValues             = false;
            bar.DataLabelStyle.Visible = false;
            bar.ShadowStyle.Type       = ShadowType.Solid;
            bar.ShadowStyle.Color      = Color.FromArgb(30, 0, 0, 0);

            GenerateYValues(nValuesCount);
            GenerateXValues(nValuesCount);

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

            // apply style sheet
            NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.Fresh);

            styleSheet.Apply(nChartControl1.Document);
        }
Пример #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 = nChartControl1.Labels.AddHeader("Multi Series Area Chart");

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

            // apply predefined projection and lighting
            m_Chart          = nChartControl1.Charts[0];
            m_Chart.Enable3D = true;
            m_Chart.Projection.SetPredefinedProjection(PredefinedProjection.Perspective1);
            m_Chart.LightModel.SetPredefinedLightModel(PredefinedLightModel.GlitterLeft);
            m_Chart.Width  = 65.0f;
            m_Chart.Height = 40.0f;
            m_Chart.Depth  = 40.0f;

            // add interlace stripe
            NLinearScaleConfigurator linearScale = m_Chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator as NLinearScaleConfigurator;
            NScaleStripStyle         stripStyle  = new NScaleStripStyle(new NColorFillStyle(), null, true, 0, 0, 1, 1);

            stripStyle.Interlaced = true;
            stripStyle.SetShowAtWall(ChartWallType.Back, true);
            stripStyle.SetShowAtWall(ChartWallType.Left, true);
            linearScale.StripStyles.Add(stripStyle);

            // add the first area
            m_Area1 = (NAreaSeries)m_Chart.Series.Add(SeriesType.Area);
            m_Area1.MultiAreaMode          = MultiAreaMode.Series;
            m_Area1.DataLabelStyle.Visible = false;
            m_Area1.Name = "Area 1";
            m_Area1.Values.FillRandomRange(Random, 15, 10, 40);

            // add the second area
            m_Area2 = (NAreaSeries)m_Chart.Series.Add(SeriesType.Area);
            m_Area2.MultiAreaMode          = MultiAreaMode.Series;
            m_Area2.DataLabelStyle.Visible = false;
            m_Area2.Name = "Area 2";
            m_Area2.Values.FillRandomRange(Random, 15, 30, 60);

            // add the third area
            m_Area3 = (NAreaSeries)m_Chart.Series.Add(SeriesType.Area);
            m_Area3.MultiAreaMode          = MultiAreaMode.Series;
            m_Area3.DataLabelStyle.Visible = false;
            m_Area3.Name = "Area 3";
            m_Area3.Values.FillRandomRange(Random, 15, 50, 80);

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

            // apply style sheet
            NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.Fresh);

            styleSheet.Apply(nChartControl1.Document);
        }
        /// <summary>
        /// Called to initialize the example
        /// </summary>
        /// <param name="chartControl"></param>
        public override void Create()
        {
            // set a chart title
            NLabel title = new NLabel("3D Step Line Chart");

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

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

            // configure the chart
            m_Chart          = nChartControl1.Charts[0];
            m_Chart.Enable3D = true;
            m_Chart.Width    = 65;
            m_Chart.Height   = 40;
            m_Chart.Axis(StandardAxis.Depth).Visible = false;
            m_Chart.Projection.SetPredefinedProjection(PredefinedProjection.Perspective1);
            m_Chart.LightModel.SetPredefinedLightModel(PredefinedLightModel.GlitterLeft);

            NLinearScaleConfigurator linearScale = m_Chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator as NLinearScaleConfigurator;

            // add interlace stripe
            NScaleStripStyle stripStyle = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);

            stripStyle.Interlaced = true;
            stripStyle.SetShowAtWall(ChartWallType.Back, true);
            stripStyle.SetShowAtWall(ChartWallType.Left, true);
            linearScale.StripStyles.Add(stripStyle);

            m_Line                        = (NStepLineSeries)m_Chart.Series.Add(SeriesType.StepLine);
            m_Line.Name                   = "Series 1";
            m_Line.DepthPercent           = 50;
            m_Line.LineSize               = 2;
            m_Line.DataLabelStyle.Visible = false;
            m_Line.DataLabelStyle.Format  = "<value>";
            m_Line.MarkerStyle.Visible    = true;
            m_Line.Values.FillRandom(Random, 8);

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

            // apply style sheet
            NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.Fresh);

            styleSheet.Apply(nChartControl1.Document);

            // configure interactivity
            nChartControl1.Controller.Tools.Add(new NPanelSelectorTool());
            nChartControl1.Controller.Tools.Add(new NTrackballTool());

            NExampleHelpers.FillComboWithEnumValues(LineStyleComboBox, typeof(LineSegmentShape));
            LineStyleComboBox.SelectedIndex       = 1;
            LeftAxisRoundToTickCheckBox.IsChecked = true;
            InflateMarginsCheckBox.IsChecked      = true;

            LineDepthScrollBar.Value = m_Line.DepthPercent / 100.0f;
            LineSizeScrollBar.Value  = m_Line.LineSize / 10.0f;
        }
Пример #12
0
/*		protected Label Label1;
 *              protected Label Label2;
 *              protected Label Label3;
 *              protected DropDownList BarStyleDropDownList;
 *              protected DropDownList WidthPercentDropDownList;
 *              protected DropDownList DepthPercentDropDownList;*/

        protected void Page_Load(object sender, EventArgs e)
        {
            nChartControl1.BackgroundStyle.FrameStyle.Visible = false;

            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("DateTime Float Bar");

            title.TextStyle.FontStyle        = new NFontStyle("Times New Roman", 14, FontStyle.Italic);
            title.TextStyle.ShadowStyle.Type = ShadowType.LinearBlur;

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

            chart.BoundsMode = BoundsMode.Stretch;

            // setup Y axis
            NLinearScaleConfigurator scaleY = (NLinearScaleConfigurator)chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator;

            // add interlace stripe
            NScaleStripStyle stripStyle = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);

            stripStyle.Interlaced = true;
            stripStyle.SetShowAtWall(ChartWallType.Back, true);
            stripStyle.SetShowAtWall(ChartWallType.Left, true);
            scaleY.StripStyles.Add(stripStyle);

            // setup X axis
            NDateTimeScaleConfigurator scaleX = new NDateTimeScaleConfigurator();

            scaleX.LabelStyle.Angle = new NScaleLabelAngle(90);
            chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = scaleX;

            // create the float bar series
            NFloatBarSeries floatBar = (NFloatBarSeries)chart.Series.Add(SeriesType.FloatBar);

            floatBar.UseXValues               = true;
            floatBar.UseZValues               = false;
            floatBar.InflateMargins           = true;
            floatBar.DataLabelStyle.Visible   = false;
            floatBar.ShadowStyle.Type         = ShadowType.Solid;
            floatBar.ShadowStyle.Color        = Color.FromArgb(30, 0, 0, 0);
            floatBar.Values.ValueFormatter    = new NNumericValueFormatter("0.0");
            floatBar.EndValues.ValueFormatter = new NNumericValueFormatter("0.0");

            // show the begin end values in the legend
            floatBar.Legend.Format = "<begin> - <end>";
            floatBar.Legend.Mode   = SeriesLegendMode.DataPoints;

            GenerateData(floatBar);

            // apply style sheet
            NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.FreshMultiColor);

            styleSheet.Apply(nChartControl1.Document);

            // apply layout
            ApplyLayoutTemplate(0, nChartControl1, chart, title, nChartControl1.Legends[0]);
        }
Пример #13
0
        public override void Initialize()
        {
            base.Initialize();

            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("Vector Image Export");

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

            // configure the chart
            m_Chart          = nChartControl1.Charts[0];
            m_Chart.Enable3D = false;
            m_Chart.Axis(StandardAxis.Depth).Visible = false;
            m_Chart.Projection.SetPredefinedProjection(PredefinedProjection.Perspective1);
            m_Chart.LightModel.SetPredefinedLightModel(PredefinedLightModel.BrightCameraLight);

            // add interlace stripe
            NLinearScaleConfigurator linearScale = m_Chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator as NLinearScaleConfigurator;
            NScaleStripStyle         stripStyle  = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);

            stripStyle.Interlaced = true;
            stripStyle.SetShowAtWall(ChartWallType.Back, true);
            stripStyle.SetShowAtWall(ChartWallType.Left, true);
            linearScale.StripStyles.Add(stripStyle);

            // add the first bar
            m_Bar1                        = (NBarSeries)m_Chart.Series.Add(SeriesType.Bar);
            m_Bar1.Name                   = "Bar1";
            m_Bar1.MultiBarMode           = MultiBarMode.Series;
            m_Bar1.DataLabelStyle.Visible = false;

            // add the second bar
            m_Bar2                        = (NBarSeries)m_Chart.Series.Add(SeriesType.Bar);
            m_Bar2.Name                   = "Bar2";
            m_Bar2.MultiBarMode           = MultiBarMode.Stacked;
            m_Bar2.DataLabelStyle.Visible = false;

            // add the third bar
            m_Bar3                        = (NBarSeries)m_Chart.Series.Add(SeriesType.Bar);
            m_Bar3.Name                   = "Bar3";
            m_Bar3.MultiBarMode           = MultiBarMode.Stacked;
            m_Bar3.DataLabelStyle.Visible = false;

            PositiveDataButton_Click(null, null);

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

            // apply style sheet
            NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.Fresh);

            styleSheet.Apply(nChartControl1.Document);

            // init form controls
            BarShapeCombo.FillFromEnum(typeof(BarShape));
            BarShapeCombo.SelectedIndex = 0;
        }
Пример #14
0
        /// <summary>
        /// Called to initialize the example
        /// </summary>
        /// <param name="chartControl"></param>
        public override void Create()
        {
            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("3D Line Chart");

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

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

            // configure the chart
            NChart chart = nChartControl1.Charts[0];

            chart.Enable3D = true;
            chart.Width    = 65;
            chart.Height   = 40;
            chart.Axis(StandardAxis.Depth).Visible = false;
            chart.Projection.SetPredefinedProjection(PredefinedProjection.Perspective2);
            chart.LightModel.SetPredefinedLightModel(PredefinedLightModel.GlitterLeft);

            // add interlaced stripe to the Y axis
            NScaleStripStyle stripStyle = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);

            stripStyle.SetShowAtWall(ChartWallType.Back, true);
            stripStyle.SetShowAtWall(ChartWallType.Left, true);
            stripStyle.Interlaced = true;
            ((NStandardScaleConfigurator)chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator).StripStyles.Add(stripStyle);

            // add a line series
            NLineSeries line = (NLineSeries)chart.Series.Add(SeriesType.Line);

            line.Name                   = "Line Series";
            line.InflateMargins         = true;
            line.DataLabelStyle.Visible = false;
            line.MarkerStyle.Visible    = true;
            line.MarkerStyle.PointShape = PointShape.Cylinder;
            line.MarkerStyle.Width      = new NLength(1.5f, NRelativeUnit.ParentPercentage);
            line.MarkerStyle.Height     = new NLength(1.5f, NRelativeUnit.ParentPercentage);
            line.Values.FillRandom(new Random(), 8);

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

            // apply style sheet
            NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.Fresh);

            styleSheet.Apply(nChartControl1.Document);

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

            NExampleHelpers.FillComboWithEnumValues(LineStyleComboBox, typeof(LineSegmentShape));
            LineStyleComboBox.SelectedIndex = (int)line.LineSegmentShape;

            AxisRoundToTickCheckBox.IsChecked = true;
            InflateMarginsCheckBox.IsChecked  = true;
        }
Пример #15
0
        public override void Initialize()
        {
            base.Initialize();

            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("2D Point Chart Droplines");

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

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

            chart.Enable3D = true;
            chart.Width    = chart.Height = chart.Depth = 50;
            chart.Axis(StandardAxis.Depth).Visible = true;
            chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = new NLinearScaleConfigurator();
            chart.Axis(StandardAxis.Depth).ScaleConfigurator    = new NLinearScaleConfigurator();

            // add interlace stripe
            NLinearScaleConfigurator linearScale = chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator as NLinearScaleConfigurator;
            NScaleStripStyle         stripStyle  = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);

            stripStyle.Interlaced = true;
            stripStyle.SetShowAtWall(ChartWallType.Back, true);
            stripStyle.SetShowAtWall(ChartWallType.Left, true);
            linearScale.StripStyles.Add(stripStyle);

            // setup point series
            m_Point                        = (NPointSeries)chart.Series.Add(SeriesType.Point);
            m_Point.Name                   = "Point Series";
            m_Point.InflateMargins         = true;
            m_Point.UseXValues             = true;
            m_Point.UseZValues             = true;
            m_Point.Size                   = new NLength(10, NGraphicsUnit.Point);
            m_Point.DataLabelStyle.Visible = false;

            Random random = new Random();

            for (int i = 0; i < 100; i += 5)
            {
                m_Point.Values.Add(random.Next(200) - 100);
                m_Point.XValues.Add(random.Next(200) - 100);
                m_Point.ZValues.Add(random.Next(200) - 100);
            }

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

            // apply interactivity
            nChartControl1.Controller.Tools.Add(new NPanelSelectorTool());
            nChartControl1.Controller.Tools.Add(new NTrackballTool());

            // init form controls
            ShowVerticalDropLinesCheckBox.Checked   = true;
            ShowHorizontalDropLinesCheckBox.Checked = true;
            ShowDepthDropLinesCheckBox.Checked      = true;
        }
Пример #16
0
        /// <summary>
        /// Called to initialize the example
        /// </summary>
        /// <param name="chartControl"></param>
        public override void Create()
        {
            // set a chart title
            NLabel title = new NLabel("3D Bar Chart");

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

            // configure chart
            NCartesianChart chart = (NCartesianChart)nChartControl1.Charts[0];

            chart.Enable3D = true;
            chart.Width    = 65;
            chart.Height   = 40;
            chart.Axis(StandardAxis.Depth).Visible = false;
            chart.Projection.SetPredefinedProjection(PredefinedProjection.Perspective1);
            chart.LightModel.SetPredefinedLightModel(PredefinedLightModel.GlitterLeft);

            // add interlaced stripe
            NLinearScaleConfigurator linearScale = chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator as NLinearScaleConfigurator;
            NScaleStripStyle         stripStyle  = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);

            stripStyle.Interlaced = true;
            stripStyle.SetShowAtWall(ChartWallType.Back, true);
            stripStyle.SetShowAtWall(ChartWallType.Left, true);
            linearScale.StripStyles.Add(stripStyle);

            // setup a bar series
            NBarSeries bar = (NBarSeries)chart.Series.Add(SeriesType.Bar);

            bar.Name = "Bar Series";
            bar.DataLabelStyle.Visible = true;
            bar.HasBottomEdge          = false;

            // add some data to the bar series
            bar.AddDataPoint(new NDataPoint(18, "C++"));
            bar.AddDataPoint(new NDataPoint(15, "Ruby"));
            bar.AddDataPoint(new NDataPoint(21, "Python"));
            bar.AddDataPoint(new NDataPoint(23, "Java"));
            bar.AddDataPoint(new NDataPoint(27, "Javascript"));
            bar.AddDataPoint(new NDataPoint(29, "C#"));
            bar.AddDataPoint(new NDataPoint(26, "PHP"));

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

            // init form controls
            NExampleHelpers.FillComboWithEnumValues(BarStyleComboBox, typeof(BarShape));
            BarStyleComboBox.SelectedIndex = 0;

            NExampleHelpers.FillComboWithValues(BarEdgePercentComboBox, 0, 50, 10);
            BarEdgePercentComboBox.SelectedIndex = 5;

            HasTopEdgeCheckBox.IsChecked          = bar.HasTopEdge;
            HasBottomEdgeCheckBox.IsChecked       = bar.HasBottomEdge;
            DifferentFIllStylesCheckBox.IsChecked = true;
            DifferentFillStylesCheckBox_Checked(null, null);
        }
Пример #17
0
        public override void Initialize()
        {
            base.Initialize();

            // set a chart title
            NLabel title = new NLabel("3D Bar Chart");

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

            // configure chart
            NCartesianChart chart = (NCartesianChart)nChartControl1.Charts[0];

            chart.Enable3D = true;
            chart.Width    = 65;
            chart.Height   = 40;
            chart.Axis(StandardAxis.Depth).Visible = false;
            chart.Projection.SetPredefinedProjection(PredefinedProjection.Perspective1);
            chart.LightModel.SetPredefinedLightModel(PredefinedLightModel.GlitterLeft);

            // add interlaced stripe
            NLinearScaleConfigurator linearScale = chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator as NLinearScaleConfigurator;
            NScaleStripStyle         stripStyle  = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);

            stripStyle.Interlaced = true;
            stripStyle.SetShowAtWall(ChartWallType.Back, true);
            stripStyle.SetShowAtWall(ChartWallType.Left, true);
            linearScale.StripStyles.Add(stripStyle);

            // setup a bar series
            NBarSeries bar = (NBarSeries)chart.Series.Add(SeriesType.Bar);

            bar.Name = "Bar Series";
            bar.DataLabelStyle.Visible = true;
            bar.HasBottomEdge          = false;

            // add some data to the bar series
            bar.AddDataPoint(new NDataPoint(18, "C++"));
            bar.AddDataPoint(new NDataPoint(15, "Ruby"));
            bar.AddDataPoint(new NDataPoint(21, "Python"));
            bar.AddDataPoint(new NDataPoint(23, "Java"));
            bar.AddDataPoint(new NDataPoint(27, "Javascript"));
            bar.AddDataPoint(new NDataPoint(29, "C#"));
            bar.AddDataPoint(new NDataPoint(26, "PHP"));

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

            // init form controls
            StyleCombo.FillFromEnum(typeof(BarShape));
            StyleCombo.SelectedIndex      = (int)BarShape.SmoothEdgeBar;
            OriginModeCombo.SelectedIndex = 0;
            OriginValueTextBox.Text       = "0";
            EdgePercentScrollBar.Value    = (int)bar.BarEdgePercent;
            HasTopEdge.Checked            = bar.HasTopEdge;
            HasBottomEdge.Checked         = bar.HasBottomEdge;
            DifferentFillStyles.Checked   = true;
        }
Пример #18
0
        public override void Initialize()
        {
            base.Initialize();

            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("Axis Titles");

            title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic);
            title.ContentAlignment    = ContentAlignment.BottomCenter;
            title.Location            = new NPointL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(2, NRelativeUnit.ParentPercentage));

            nChartControl1.Legends[0].Mode = LegendMode.Disabled;

            m_Chart            = nChartControl1.Charts[0];
            m_Chart.BoundsMode = BoundsMode.Stretch;

            NStandardScaleConfigurator scaleConfiguratorY = (NStandardScaleConfigurator)m_Chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator;

            // add interlaced stripe
            NScaleStripStyle stripStyle = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);

            stripStyle.SetShowAtWall(ChartWallType.Back, true);
            stripStyle.SetShowAtWall(ChartWallType.Left, true);
            stripStyle.Interlaced = true;
            scaleConfiguratorY.StripStyles.Add(stripStyle);

            NStandardScaleConfigurator scaleConfiguratorX = (NStandardScaleConfigurator)m_Chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator;

            NBarSeries bar = (NBarSeries)m_Chart.Series.Add(SeriesType.Bar);

            bar.Values.FillRandom(Random, 20);
            bar.Name = "Bars";
            bar.DataLabelStyle.Visible = false;

            // apply style sheet
            NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.FreshMultiColor);

            styleSheet.Apply(nChartControl1.Document);

            // init form controls
            YTitleTextBox.Text = "Y Axis Title";
            XTitleTextBox.Text = "X Axis Title";

            YOffsetScrollBar.Value = 10;
            XOffsetScrollBar.Value = 10;

            YAlignmentComboBox.Items.Add("Top");
            YAlignmentComboBox.Items.Add("Middle");
            YAlignmentComboBox.Items.Add("Bottom");
            YAlignmentComboBox.SelectedIndex = 1;

            XAlignmentComboBox.Items.Add("Left");
            XAlignmentComboBox.Items.Add("Center");
            XAlignmentComboBox.Items.Add("Right");
            XAlignmentComboBox.SelectedIndex = 1;
        }
Пример #19
0
        public override void Initialize()
        {
            base.Initialize();

            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("2D Line Chart");

            title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic);
            title.ContentAlignment    = ContentAlignment.BottomCenter;
            title.Location            = new NPointL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(2, NRelativeUnit.ParentPercentage));

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

            // configure the chart
            NChart chart = nChartControl1.Charts[0];

            chart.Axis(StandardAxis.Depth).Visible = false;

            // add interlaced stripe to the Y axis
            NScaleStripStyle stripStyle = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);

            stripStyle.SetShowAtWall(ChartWallType.Back, true);
            stripStyle.SetShowAtWall(ChartWallType.Left, true);
            stripStyle.Interlaced = true;
            ((NStandardScaleConfigurator)chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator).StripStyles.Add(stripStyle);

            NLineSeries line = (NLineSeries)chart.Series.Add(SeriesType.Line);

            line.Name                   = "Line Series";
            line.InflateMargins         = true;
            line.DataLabelStyle.Format  = "<value>";
            line.MarkerStyle.Visible    = true;
            line.MarkerStyle.PointShape = PointShape.Cylinder;
            line.MarkerStyle.Width      = new NLength(1.5f, NRelativeUnit.ParentPercentage);
            line.MarkerStyle.Height     = new NLength(1.5f, NRelativeUnit.ParentPercentage);
            line.ShadowStyle.Type       = ShadowType.GaussianBlur;
            line.ShadowStyle.Offset     = new NPointL(3, 3);
            line.ShadowStyle.FadeLength = new NLength(5);
            line.ShadowStyle.Color      = Color.FromArgb(55, 0, 0, 0);
            line.Values.FillRandom(Random, 8);

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

            // apply style sheet
            NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.Fresh);

            styleSheet.Apply(nChartControl1.Document);

            // init form controls
            LineStyleCombo.FillFromEnum(typeof(LineSegmentShape));
            LineStyleCombo.SelectedIndex = 0;
            RoundToTickCheck.Checked     = true;
            InflateMarginsCheck.Checked  = true;
        }
        /// <summary>
        /// Called to initialize the example
        /// </summary>
        /// <param name="chartControl"></param>
        public override void Create()
        {
            // create a title
            NLabel title = new NLabel("2D Bar Chart");

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

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

            chart.Axis(StandardAxis.Depth).Visible = false;

            // add interlace stripe
            NLinearScaleConfigurator linearScale = chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator as NLinearScaleConfigurator;
            NScaleStripStyle         stripStyle  = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);

            stripStyle.Interlaced = true;
            stripStyle.SetShowAtWall(ChartWallType.Back, true);
            stripStyle.SetShowAtWall(ChartWallType.Left, true);
            linearScale.StripStyles.Add(stripStyle);

            // setup a bar series
            NBarSeries bar = (NBarSeries)chart.Series.Add(SeriesType.Bar);

            bar.Name = "Bar Series";
            bar.BorderStyle.Width      = new NLength(0, NGraphicsUnit.Pixel);
            bar.ShadowStyle.Type       = ShadowType.GaussianBlur;
            bar.ShadowStyle.Offset     = new NPointL(2, 2);
            bar.ShadowStyle.Color      = Color.FromArgb(80, 0, 0, 0);
            bar.ShadowStyle.FadeLength = new NLength(5);
            bar.HasBottomEdge          = false;

            // add some data to the bar series
            bar.AddDataPoint(new NDataPoint(18, "C++"));
            bar.AddDataPoint(new NDataPoint(15, "Ruby"));
            bar.AddDataPoint(new NDataPoint(21, "Python"));
            bar.AddDataPoint(new NDataPoint(23, "Java"));
            bar.AddDataPoint(new NDataPoint(27, "Javascript"));
            bar.AddDataPoint(new NDataPoint(29, "C#"));
            bar.AddDataPoint(new NDataPoint(26, "PHP"));

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

            // init form controls
            NExampleHelpers.FillComboWithEnumValues(BarStyleComboBox, typeof(BarShape));
            BarStyleComboBox.SelectedIndex = 0;

            NExampleHelpers.FillComboWithValues(BarEdgePercentComboBox, 0, 50, 10);
            BarEdgePercentComboBox.SelectedIndex = 5;

            HasTopEdgeCheckBox.IsChecked          = bar.HasTopEdge;
            HasBottomEdgeCheckBox.IsChecked       = bar.HasBottomEdge;
            DifferentFIllStylesCheckBox.IsChecked = true;
            DifferentFillStylesCheckBox_Checked(null, null);
        }
        public override void Initialize()
        {
            base.Initialize();

            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("Series Marker Attribute");

            title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic);
            title.ContentAlignment    = ContentAlignment.BottomCenter;
            title.Location            = new NPointL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(2, NRelativeUnit.ParentPercentage));

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

            chart.BoundsMode = BoundsMode.Stretch;

            // add interlaced stripe to the Y axis
            NScaleStripStyle stripStyle = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);

            stripStyle.SetShowAtWall(ChartWallType.Back, true);
            stripStyle.SetShowAtWall(ChartWallType.Left, true);
            stripStyle.Interlaced = true;
            ((NStandardScaleConfigurator)chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator).StripStyles.Add(stripStyle);

            chart.Axis(StandardAxis.Depth).Visible = false;

            NLineSeries line = (NLineSeries)chart.Series.Add(SeriesType.Line);

            line.LineSegmentShape = LineSegmentShape.Tape;
            line.InflateMargins   = true;
            line.DepthPercent     = 50;
            line.Legend.Mode      = SeriesLegendMode.DataPoints;
            line.Name             = "Line Series";
            line.Values.FillRandom(Random, 6);
            line.DataLabelStyle.Visible = false;
            line.ShadowStyle.Type       = ShadowType.GaussianBlur;
            line.ShadowStyle.Offset     = new NPointL(2, 2);
            line.ShadowStyle.Color      = Color.FromArgb(88, 0, 0, 0);
            line.ShadowStyle.FadeLength = new NLength(5);
            line.MarkerStyle.Visible    = true;

            NMarkerStyle marker = new NMarkerStyle();

            marker.FillStyle  = new NColorFillStyle(Color.Red);
            marker.PointShape = PointShape.Custom;

            // Create a custom shape for this marker
            N2DSmartShapeFactory factory = new N2DSmartShapeFactory(new NColorFillStyle(Color.Red), new NStrokeStyle(1.0f, Color.Black), null);

            marker.CustomShape   = factory.CreateShape(SmartShape2D.Trapezoid);
            marker.Visible       = true;
            line.MarkerStyles[3] = marker;

            // apply layout
            ConfigureStandardLayout(chart, title, nChartControl1.Legends[0]);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            nChartControl1.BackgroundStyle.FrameStyle.Visible = false;
            nChartControl1.Settings.JitterMode = JitterMode.Enabled;

            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("Series Markers");

            title.TextStyle.FontStyle        = new NFontStyle("Times New Roman", 14, FontStyle.Italic);
            title.TextStyle.ShadowStyle.Type = ShadowType.LinearBlur;

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

            chart.BoundsMode = BoundsMode.Stretch;

            // add interlaced stripe to the Y axis
            NScaleStripStyle stripStyle = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);

            stripStyle.SetShowAtWall(ChartWallType.Back, true);
            stripStyle.SetShowAtWall(ChartWallType.Left, true);
            stripStyle.Interlaced = true;
            ((NStandardScaleConfigurator)chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator).StripStyles.Add(stripStyle);

            chart.Axis(StandardAxis.Depth).Visible = false;

            NLineSeries line = (NLineSeries)chart.Series.Add(SeriesType.Line);

            line.LineSegmentShape = LineSegmentShape.Tape;
            line.InflateMargins   = true;
            line.DepthPercent     = 50;
            line.Legend.Mode      = SeriesLegendMode.DataPoints;
            line.Name             = "Line Series";
            line.Values.FillRandom(Random, 6);
            line.DataLabelStyle.Visible = false;
            line.ShadowStyle.Type       = ShadowType.GaussianBlur;
            line.ShadowStyle.Offset     = new NPointL(2, 2);
            line.ShadowStyle.Color      = Color.FromArgb(88, 0, 0, 0);
            line.ShadowStyle.FadeLength = new NLength(5);
            line.MarkerStyle.Visible    = true;

            NMarkerStyle marker = new NMarkerStyle();

            marker.FillStyle  = new NColorFillStyle(Color.Red);
            marker.PointShape = PointShape.Custom;

            // Create a custom shape for this marker
            N2DSmartShapeFactory factory = new N2DSmartShapeFactory(new NColorFillStyle(Color.Red), new NStrokeStyle(1.0f, Color.Black), null);

            marker.CustomShape   = factory.CreateShape(SmartShape2D.Trapezoid);
            marker.Visible       = true;
            line.MarkerStyles[3] = marker;

            // apply layout
            ApplyLayoutTemplate(0, nChartControl1, chart, title, nChartControl1.Legends[0]);
        }
Пример #23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!NThinChartControl1.Initialized)
            {
                NThinChartControl1.BackgroundStyle.FrameStyle.Visible = false;
                NThinChartControl1.Panels.Clear();
                NStandardFrameStyle frame = NThinChartControl1.BackgroundStyle.FrameStyle as NStandardFrameStyle;
                frame.InnerBorderWidth = new NLength(0);

                // set a chart title
                // set a chart title
                NLabel title = NThinChartControl1.Labels.AddHeader("Auto Update");
                title.TextStyle.FontStyle        = new NFontStyle("Times New Roman", 14, FontStyle.Italic);
                title.TextStyle.ShadowStyle.Type = ShadowType.LinearBlur;

                // setup Line chart
                NCartesianChart chart = new NCartesianChart();
                NThinChartControl1.Panels.Add(chart);
                NRangeTimelineScaleConfigurator rangeTimeline = new NRangeTimelineScaleConfigurator();
                rangeTimeline.FirstRow.MinTickDistance = new NLength(40);
                chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = rangeTimeline;

                // setup Y axis
                NLinearScaleConfigurator scaleY = (NLinearScaleConfigurator)chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator;
                scaleY.MajorGridStyle.LineStyle.Pattern = LinePattern.Dot;

                // add interlace stripe
                NScaleStripStyle stripStyle = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);
                stripStyle.Interlaced = true;
                stripStyle.SetShowAtWall(ChartWallType.Back, true);
                stripStyle.SetShowAtWall(ChartWallType.Left, true);
                scaleY.StripStyles.Add(stripStyle);

                NLineSeries line = new NLineSeries();
                line.UseXValues             = true;
                line.DataLabelStyle.Visible = false;
                line.BorderStyle.Color      = Color.DarkOrange;
                line.BorderStyle.Width      = new NLength(2);
                chart.Series.Add(line);

                // generate some data
                GenerateNewData();

                NThinChartControl1.AutoUpdateCallback = new NAutoUpdateCallback();
                ApplyLayoutTemplate(0, NThinChartControl1, chart, title, null);

                NThinChartControl1.ServerSettings.EnableTiledZoom    = true;
                NThinChartControl1.ServerSettings.AutoUpdateInterval = 200;
                NThinChartControl1.ServerSettings.EnableAutoUpdate   = true;
            }

            if (!IsPostBack)
            {
                AutoUpdateIntervalTextBox.Text = NThinChartControl1.ServerSettings.AutoUpdateInterval.ToString();
            }
        }
        public override void Initialize()
        {
            base.Initialize();

            // set a chart title
            NLabel title = new NLabel("2D Step Line Chart");

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

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

            // configure the chart
            m_Chart = nChartControl1.Charts[0];
            m_Chart.Axis(StandardAxis.Depth).Visible = false;

            NLinearScaleConfigurator linearScale = m_Chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator as NLinearScaleConfigurator;

            // add interlace stripe
            NScaleStripStyle stripStyle = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);

            stripStyle.Interlaced = true;
            stripStyle.SetShowAtWall(ChartWallType.Back, true);
            stripStyle.SetShowAtWall(ChartWallType.Left, true);
            linearScale.StripStyles.Add(stripStyle);

            m_StepLine      = (NStepLineSeries)m_Chart.Series.Add(SeriesType.StepLine);
            m_StepLine.Name = "Series 1";
            m_StepLine.BorderStyle.Color                               = Color.SlateBlue;
            m_StepLine.BorderStyle.Width                               = new NLength(2);
            m_StepLine.DataLabelStyle.VertAlign                        = VertAlign.Center;
            m_StepLine.DataLabelStyle.Format                           = "<value>";
            m_StepLine.DataLabelStyle.TextStyle.FillStyle              = new NColorFillStyle(Color.White);
            m_StepLine.DataLabelStyle.TextStyle.FontStyle.EmSize       = new NLength(1.4f, NRelativeUnit.RootPercentage);
            m_StepLine.DataLabelStyle.TextStyle.BackplaneStyle.Visible = false;
            m_StepLine.MarkerStyle.Visible                             = true;
            m_StepLine.MarkerStyle.PointShape                          = PointShape.Cylinder;
            m_StepLine.MarkerStyle.BorderStyle.Color                   = Color.SlateBlue;
            m_StepLine.ShadowStyle.Type       = ShadowType.GaussianBlur;
            m_StepLine.ShadowStyle.Offset     = new NPointL(3, 3);
            m_StepLine.ShadowStyle.FadeLength = new NLength(5);
            m_StepLine.ShadowStyle.Color      = Color.FromArgb(55, 0, 0, 0);
            m_StepLine.Values.FillRandom(Random, 8);

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

            // apply style sheet
            NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.Fresh);

            styleSheet.Apply(nChartControl1.Document);

            RoundToTickCheck.Checked    = true;
            InflateMarginsCheck.Checked = true;
        }
Пример #25
0
        public override void Initialize()
        {
            base.Initialize();

            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("2D Sampled Area Chart");

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

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

            // setup the chart
            m_Chart = nChartControl1.Charts[0];
            m_Chart.Axis(StandardAxis.Depth).Visible = false;

            // add interlace stripe
            NLinearScaleConfigurator linearScale = m_Chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator as NLinearScaleConfigurator;
            NScaleStripStyle         stripStyle  = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);

            stripStyle.Interlaced = true;
            stripStyle.SetShowAtWall(ChartWallType.Back, true);
            stripStyle.SetShowAtWall(ChartWallType.Left, true);
            linearScale.StripStyles.Add(stripStyle);

            // apply linear scaling to the x axis
            linearScale = new NLinearScaleConfigurator();
            m_Chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = linearScale;

            linearScale.MajorGridStyle.SetShowAtWall(ChartWallType.Back, true);
            linearScale.MajorGridStyle.LineStyle.Pattern = LinePattern.Dot;

            linearScale = m_Chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator as NLinearScaleConfigurator;
            linearScale.MajorGridStyle.LineStyle.Pattern = LinePattern.Dot;

            // add the area series
            m_Area      = (NAreaSeries)m_Chart.Series.Add(SeriesType.Area);
            m_Area.Name = "Area Series";
            m_Area.DataLabelStyle.Visible = false;
            m_Area.MarkerStyle.Visible    = false;
            m_Area.SamplingMode           = SeriesSamplingMode.Enabled;
            m_Area.UseXValues             = true;

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

            // apply style sheet
            NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.Fresh);

            styleSheet.Apply(nChartControl1.Document);

            UseXValuesCheckBox.Checked = true;

            Add40KDataButton_Click(null, null);
        }
Пример #26
0
        /// <summary>
        /// Called to initialize the example
        /// </summary>
        /// <param name="chartControl"></param>
        public override void Create()
        {
            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("3D Sampled Line Chart");

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

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

            // configure the chart
            NChart chart = nChartControl1.Charts[0];

            chart.Enable3D = true;
            chart.Width    = 70;
            chart.Height   = 70;
            chart.Depth    = 70;
            chart.Projection.SetPredefinedProjection(PredefinedProjection.Perspective1);
            chart.LightModel.SetPredefinedLightModel(PredefinedLightModel.GlitterLeft);
            chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = new NLinearScaleConfigurator();
            chart.Axis(StandardAxis.Depth).ScaleConfigurator    = new NLinearScaleConfigurator();

            // add interlaced stripe to the Y axis
            NScaleStripStyle stripStyle = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);

            stripStyle.SetShowAtWall(ChartWallType.Back, true);
            stripStyle.SetShowAtWall(ChartWallType.Left, true);
            stripStyle.Interlaced = true;
            ((NStandardScaleConfigurator)chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator).StripStyles.Add(stripStyle);

            // add a line series
            m_Line                        = (NLineSeries)chart.Series.Add(SeriesType.Line);
            m_Line.Name                   = "Line Series";
            m_Line.InflateMargins         = true;
            m_Line.DataLabelStyle.Visible = false;
            m_Line.MarkerStyle.Visible    = false;
            m_Line.UseXValues             = true;
            m_Line.UseZValues             = true;
            m_Line.SamplingMode           = SeriesSamplingMode.Enabled;

            SampleDistanceScrollBar.Value = (int)m_Line.SampleDistance.Value;

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

            // apply style sheet
            NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.Fresh);

            styleSheet.Apply(nChartControl1.Document);

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

            Add40KDataButton_Click(null, null);
        }
Пример #27
0
        public override void Initialize()
        {
            base.Initialize();

            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("Series Appearance Attributes");

            title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic);
            title.ContentAlignment    = ContentAlignment.BottomCenter;
            title.Location            = new NPointL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(2, NRelativeUnit.ParentPercentage));

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

            // configure the chart
            m_Chart          = nChartControl1.Charts[0];
            m_Chart.Enable3D = true;
            m_Chart.Axis(StandardAxis.Depth).Visible = false;

            // apply lighting and projectection
            m_Chart.LightModel.SetPredefinedLightModel(PredefinedLightModel.GlitterLeft);
            m_Chart.Projection.SetPredefinedProjection(PredefinedProjection.OrthogonalHalf);

            // add interlaced stripe to the Y axis
            NScaleStripStyle stripStyle = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);

            stripStyle.SetShowAtWall(ChartWallType.Back, true);
            stripStyle.SetShowAtWall(ChartWallType.Left, true);
            stripStyle.Interlaced = true;
            ((NStandardScaleConfigurator)m_Chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator).StripStyles.Add(stripStyle);

            // setup bar series
            m_Bar = (NBarSeries)m_Chart.Series.Add(SeriesType.Bar);
            m_Bar.DataLabelStyle.Visible = false;
            m_Bar.FillStyle = new NColorFillStyle(LightGreen);
            m_Bar.Name      = "Bar";

            // fill data
            m_Bar.AddDataPoint(new NDataPoint(10));
            m_Bar.AddDataPoint(new NDataPoint(20));
            m_Bar.AddDataPoint(new NDataPoint(30));

            // set an individual Fill Style and Stroke Style for data point #3
            NDataPoint dp = new NDataPoint(25);

            dp[DataPointValue.FillStyle]   = new NGradientFillStyle(LightOrange, DarkOrange);
            dp[DataPointValue.StrokeStyle] = new NStrokeStyle(1, DarkOrange, LinePattern.Dot, 0, 1);
            m_Bar.AddDataPoint(dp);

            m_Bar.AddDataPoint(new NDataPoint(29));
            m_Bar.AddDataPoint(new NDataPoint(27));

            // apply layout
            ConfigureStandardLayout(m_Chart, title, null);
        }
        public override void Initialize()
        {
            base.Initialize();

            // create a title
            NLabel title = new NLabel("Hit Testing Scale Elements");

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

            // hide the legend
            nChartControl1.Legends[0].Visible = false;

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

            chart.Axis(StandardAxis.Depth).Visible = false;

            // add interlace stripe
            NLinearScaleConfigurator scaleY = chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator as NLinearScaleConfigurator;

            scaleY.Title.Text = "Y Axis Title";
            NScaleStripStyle stripStyle = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);

            stripStyle.Interlaced = true;
            stripStyle.SetShowAtWall(ChartWallType.Back, true);
            stripStyle.SetShowAtWall(ChartWallType.Left, true);
            scaleY.StripStyles.Add(stripStyle);

            // add the line
            NLineSeries line = (NLineSeries)chart.Series.Add(SeriesType.Line);

            line.LineSegmentShape       = LineSegmentShape.Line;
            line.DataLabelStyle.Visible = false;
            line.Legend.Mode            = SeriesLegendMode.DataPoints;
            line.InflateMargins         = true;
            line.MarkerStyle.Visible    = true;
            line.MarkerStyle.PointShape = PointShape.Cylinder;
            line.MarkerStyle.Width      = new NLength(1.5f, NRelativeUnit.ParentPercentage);
            line.MarkerStyle.Height     = new NLength(1.5f, NRelativeUnit.ParentPercentage);
            line.Name       = "Line Series";
            line.UseXValues = true;

            // add xy values
            line.AddDataPoint(new NDataPoint(15, 10));
            line.AddDataPoint(new NDataPoint(25, 23));
            line.AddDataPoint(new NDataPoint(45, 12));

            ConfigureAxis(chart.Axis(StandardAxis.PrimaryX));
            ConfigureAxis(chart.Axis(StandardAxis.PrimaryY));

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

            nChartControl1.MouseMove += new MouseEventHandler(nChartControl1_MouseMove);
        }
        private void CreateSampleChart()
        {
            // set a chart title
            NLabel title = nChartControl1.Labels.AddHeader("Tracking Mouse Events");

            title.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18, FontStyle.Italic);
            title.ContentAlignment    = ContentAlignment.BottomCenter;
            title.Location            = new NPointL(new NLength(50, NRelativeUnit.ParentPercentage), new NLength(2, NRelativeUnit.ParentPercentage));

            NChart chart = nChartControl1.Charts[0];

            // add interlace stripe
            NLinearScaleConfigurator linearScale = chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator as NLinearScaleConfigurator;
            NScaleStripStyle         stripStyle  = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);

            stripStyle.Interlaced = true;
            stripStyle.SetShowAtWall(ChartWallType.Back, true);
            stripStyle.SetShowAtWall(ChartWallType.Left, true);
            linearScale.StripStyles.Add(stripStyle);

            // apply lighting and projection
            chart.Enable3D = true;
            chart.Projection.SetPredefinedProjection(PredefinedProjection.Perspective1);
            chart.LightModel.SetPredefinedLightModel(PredefinedLightModel.MetallicLustre);

            // add line series
            NLineSeries line = (NLineSeries)chart.Series.Add(SeriesType.Line);

            line.Name                   = "Line";
            line.LineSegmentShape       = LineSegmentShape.Tape;
            line.DataLabelStyle.Visible = false;
            line.Values.FillRandomRange(Random, 10, 10, 30);

            // add bar series
            NBarSeries bar = (NBarSeries)chart.Series.Add(SeriesType.Bar);

            bar.Name = "Bar";
            bar.DataLabelStyle.Visible = false;
            bar.Values.FillRandomRange(Random, 10, 40, 60);

            // add area series
            NAreaSeries area = (NAreaSeries)chart.Series.Add(SeriesType.Area);

            area.Name = "Area";
            area.DataLabelStyle.Visible = false;
            area.Values.FillRandomRange(Random, 10, 60, 100);

            // apply style sheet
            NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.Fresh);

            styleSheet.Apply(nChartControl1.Document);

            nChartControl1.Refresh();
        }
Пример #30
0
        protected void Page_Load(object sender, EventArgs e)
        {
            nChartControl1.BackgroundStyle.FrameStyle.Visible = false;

            // set a chart title
            NLabel title = new NLabel("2D Range Series");

            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.BoundsMode = BoundsMode.Stretch;

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

            chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = linearScale;
            linearScale.MajorGridStyle.SetShowAtWall(ChartWallType.Back, true);
            linearScale.MajorGridStyle.SetShowAtWall(ChartWallType.Floor, true);
            linearScale.MajorGridStyle.LineStyle.Pattern = LinePattern.Dot;
            linearScale.InnerMajorTickStyle.Visible      = false;

            // setup Y axis
            linearScale = new NLinearScaleConfigurator();
            chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator = linearScale;
            linearScale.MajorGridStyle.SetShowAtWall(ChartWallType.Back, true);
            linearScale.MajorGridStyle.SetShowAtWall(ChartWallType.Left, true);
            linearScale.MajorGridStyle.LineStyle.Pattern = LinePattern.Dot;
            linearScale.InnerMajorTickStyle.Visible      = false;

            // add interlaced stripe
            NScaleStripStyle stripStyle = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);

            stripStyle.SetShowAtWall(ChartWallType.Back, true);
            stripStyle.SetShowAtWall(ChartWallType.Left, true);
            stripStyle.Interlaced = true;
            linearScale.StripStyles.Add(stripStyle);

            // setup shape series
            NRangeSeries rangeSeries = (NRangeSeries)chart.Series.Add(SeriesType.Range);

            rangeSeries.DataLabelStyle.Visible = false;
            rangeSeries.UseXValues             = true;
            rangeSeries.FillStyle         = new NColorFillStyle(DarkOrange);
            rangeSeries.BorderStyle.Color = Color.DarkRed;

            // fill data
            FillData(rangeSeries);

            // apply layout
            ApplyLayoutTemplate(0, nChartControl1, chart, title, null);
        }
Пример #31
0
        private void Init2dChart()
        {
            nChartControl2.Settings.ShapeRenderingMode = ShapeRenderingMode.HighSpeed;
            nChartControl2.Legends.Clear(); // no legend
            NChart chart2d = nChartControl2.Charts[0];

            NSmoothLineSeries surface = null;
            if (chart2d.Series.Count == 0)
            {
                surface = (NSmoothLineSeries)chart2d.Series.Add(SeriesType.SmoothLine);
            }
            else
            {
                surface = (NSmoothLineSeries)chart2d.Series[0];
            }

            chart2d.BoundsMode = BoundsMode.Stretch;
            NLinearScaleConfigurator linearScale = (NLinearScaleConfigurator)chart2d.Axis(StandardAxis.PrimaryY).ScaleConfigurator;
            linearScale.MajorGridStyle.LineStyle.Pattern = LinePattern.Dot;
            linearScale.MajorGridStyle.SetShowAtWall(ChartWallType.Back, true);
            NScaleStripStyle stripStyle = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);
            stripStyle.Interlaced = true;
            stripStyle.SetShowAtWall(ChartWallType.Back, true);
            stripStyle.SetShowAtWall(ChartWallType.Left, true);
            linearScale.StripStyles.Add(stripStyle);
            NSmoothLineSeries line = null;
            if (chart2d.Series.Count == 0)
            {
                line = (NSmoothLineSeries)chart2d.Series.Add(SeriesType.SmoothLine);
            }
            else
            {
                line = (NSmoothLineSeries)chart2d.Series[0];
            }
            line.Name = m_map_name;
            line.Legend.Mode = SeriesLegendMode.Series;
            line.UseXValues = true;
            line.UseZValues = false;
            line.DataLabelStyle.Visible = true;
            line.MarkerStyle.Visible = true;
            line.MarkerStyle.PointShape = PointShape.Sphere;
            line.MarkerStyle.AutoDepth = true;
            line.MarkerStyle.Width = new NLength(1.4f, NRelativeUnit.ParentPercentage);
            line.MarkerStyle.Height = new NLength(1.4f, NRelativeUnit.ParentPercentage);
            line.MarkerStyle.Depth = new NLength(1.4f, NRelativeUnit.ParentPercentage);
            //line.HorizontalAxes = y_axisvalues;

            surface.Name = "Surface";
            //surface.Legend.Mode = SeriesLegendMode.SeriesLogic;
            //surface.PositionValue = 10.0;
            for (int i = 0; i < y_axisvalues.Length; i++)
            {
                surface.XValues.Add(y_axisvalues.GetValue(i));
            }
            NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.Nevron);
            styleSheet.Apply(nChartControl2.Document);
        }
Пример #32
0
        /*Построение 2д графика*/
        public void Draw2D(bool exp)
        {
            int numFromPoint = numberOfPointY();
            mainForm.nChartControl1.Clear();
            mainForm.nChartControl1.Controller.Tools.Add(new NSelectorTool());
            mainForm.nChartControl1.Controller.Tools.Add(new NTrackballTool());
            var chart = (NCartesianChart) mainForm.nChartControl1.Charts[0];
            mainForm.nChartControl1.Legends[0].Mode = LegendMode.Disabled;
            chart.BoundsMode = BoundsMode.Stretch;
            var scaleConfiguratorY1 = (NStandardScaleConfigurator) chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator;
            var scaleConfiguratorX1 = (NStandardScaleConfigurator) chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator;
            scaleConfiguratorY1.Title.Text = mainForm.dgwExperiment.Columns[1].HeaderCell.Value.ToString();
            scaleConfiguratorY1.Title.TextStyle = new NTextStyle(new Font("Microsoft Sans Serif", 10, FontStyle.Bold));
            scaleConfiguratorY1.LabelStyle.TextStyle =
                new NTextStyle(new Font("Microsoft Sans Serif", 10, FontStyle.Bold));
            scaleConfiguratorX1.Title.Text = mainForm.dgwExperiment.Columns[0].HeaderCell.Value.ToString();
            scaleConfiguratorX1.Title.TextStyle = new NTextStyle(new Font("Microsoft Sans Serif", 10, FontStyle.Bold));
            scaleConfiguratorX1.LabelStyle.TextStyle =
                new NTextStyle(new Font("Microsoft Sans Serif", 10, FontStyle.Bold));
            chart.Location = new NPointL(
                new NLength(10, NRelativeUnit.ParentPercentage),
                new NLength(12, NRelativeUnit.ParentPercentage));
            chart.Size = new NSizeL(
                new NLength(80, NRelativeUnit.ParentPercentage),
                new NLength(78, NRelativeUnit.ParentPercentage));
            NLinearScaleConfigurator linearScale =
                (NLinearScaleConfigurator) chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator;
            linearScale.MajorGridStyle.LineStyle.Pattern = LinePattern.Dot;
            linearScale.MajorGridStyle.SetShowAtWall(ChartWallType.Back, true);
            NScaleStripStyle stripStyle = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 1, 1);
            stripStyle.Interlaced = true;
            stripStyle.SetShowAtWall(ChartWallType.Back, true);
            stripStyle.SetShowAtWall(ChartWallType.Left, true);
            linearScale.StripStyles.Add(stripStyle);
            NSmoothLineSeries line = (NSmoothLineSeries) chart.Series.Add(SeriesType.SmoothLine);
            line.Name = "Smooth Line";
            line.InflateMargins = true;
            line.Legend.Mode = SeriesLegendMode.Series;
            line.UseXValues = true;
            line.UseZValues = false;
            line.DataLabelStyle.Visible = false;
            line.MarkerStyle.Visible = false;

            double firstMin = Convert.ToDouble(mainForm.graphSettings.txtFirstParamMin.Text);
            double firstMax = Convert.ToDouble(mainForm.graphSettings.txtFirstParamMax.Text);
            double firstStep = Convert.ToDouble(mainForm.graphSettings.txtStepChart.Text);
            resultForm.dataGridView1.Columns.Clear();

            int c = 0;
            for (double i = firstMin; i < firstMax + firstStep; i += firstStep)
            {
                if (i > firstMax - firstStep)
                {
                    i = firstMax;
                }

                double[] data = { i };
                double yPoint = Ymath(data);
                line.Values.Add(yPoint);
                line.XValues.Add(i);

                resultForm.dataGridView1.Columns.Add(i.ToString(), i.ToString());
                resultForm.dataGridView1.Rows[0].Cells[c].Value = Math.Round(yPoint, numFromPoint).ToString().Replace(".", ",");
                c++;
            }

            resultForm.dataGridView1.TopLeftHeaderCell.Value = "x";
            resultForm.dataGridView1.Rows[0].HeaderCell.Value = "y";

            if (exp)
            {
                mainForm.DrawExpPoints2D();
            }
        }