示例#1
0
        private void DecorateGaugeAxis(NRadialGaugePanel panel, NRange1DD range, Color colorLight, Color colorDark)
        {
            NGaugeAxis axis = (NGaugeAxis)panel.Axes[0];
            NStandardScaleConfigurator scale = (NStandardScaleConfigurator)axis.ScaleConfigurator;

            // create a range indicator
            NRangeIndicator rangeIndicator = new NRangeIndicator();

            rangeIndicator.OriginMode = OriginMode.Custom;
            rangeIndicator.Value      = range.Begin;
            rangeIndicator.Origin     = range.End;
            rangeIndicator.BeginWidth = new NLength(10);
            rangeIndicator.EndWidth   = new NLength(10);

            rangeIndicator.FillStyle         = new NColorFillStyle(Color.FromArgb(100, colorLight));
            rangeIndicator.StrokeStyle.Color = colorLight;
            panel.Indicators.Add(rangeIndicator);

            // create a scale section
            NScaleSectionStyle scaleSection = new NScaleSectionStyle();

            scaleSection.Range = range;
            scaleSection.MajorTickStrokeStyle = new NStrokeStyle(colorLight);
            scaleSection.MinorTickStrokeStyle = new NStrokeStyle(1, colorLight, LinePattern.Dot, 0, 2);

            NTextStyle labelStyle = new NTextStyle();

            labelStyle.FillStyle        = new NGradientFillStyle(colorLight, colorDark);
            labelStyle.FontStyle        = new NFontStyle("Arial", 10, FontStyle.Bold);
            scaleSection.LabelTextStyle = labelStyle;

            scale.Sections.Add(scaleSection);
        }
        private void UpdateInterlaceStirpes()
        {
            NStandardScaleConfigurator standardScale = (NStandardScaleConfigurator)m_Chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator;

            standardScale.StripStyles.Clear();
            if (YAxisInterlacedStripesCheckBox.Checked)
            {
                standardScale.StripStyles.Add(m_YAxisInterlaceStyle);
            }

            m_YAxisInterlaceStyle.Begin    = 0;
            m_YAxisInterlaceStyle.End      = 10;
            m_YAxisInterlaceStyle.Infinite = true;
            m_YAxisInterlaceStyle.Length   = 1;
            m_YAxisInterlaceStyle.Interval = 1;

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

            standardScale.StripStyles.Clear();
            if (XAxisInterlacedStripesCheckBox.Checked)
            {
                standardScale.StripStyles.Add(m_XAxisInterlaceStyle);
            }

            m_XAxisInterlaceStyle.Begin    = 0;
            m_XAxisInterlaceStyle.End      = 10;
            m_XAxisInterlaceStyle.Infinite = true;
            m_XAxisInterlaceStyle.Length   = 1;
            m_XAxisInterlaceStyle.Interval = 1;
        }
        protected NRadialGaugePanel CreateGaugePanel()
        {
            // create the radial gauge
            NRadialGaugePanel radialGauge = new NRadialGaugePanel();

            radialGauge.ContentAlignment    = ContentAlignment.BottomRight;
            radialGauge.BackgroundFillStyle = new NAdvancedGradientFillStyle(AdvancedGradientScheme.WhiteOnBlack, 0);
            radialGauge.BorderStyle         = new NEdgeBorderStyle(BorderShape.Auto);
            radialGauge.PaintEffect         = new NGlassEffectStyle();

            NGaugeAxis axis = (NGaugeAxis)radialGauge.Axes[0];

            axis.Anchor = new NDockGaugeAxisAnchor(GaugeAxisDockZone.Top, true, RulerOrientation.Right, 0, 100);
            axis.Range  = new NRange1DD(0, 400);

            NStandardScaleConfigurator scale = (NStandardScaleConfigurator)axis.ScaleConfigurator;

            scale.SetPredefinedScaleStyle(PredefinedScaleStyle.PresentationNoStroke);
            scale.LabelFitModes        = new LabelFitMode[0];
            scale.MinorTickCount       = 4;
            scale.RulerStyle.FillStyle = new NColorFillStyle(Color.FromArgb(40, Color.WhiteSmoke));
            scale.LabelStyle.TextStyle.FontStyle.EmSize = new NLength(6);
            scale.MinTickDistance = new NLength(15);

            radialGauge.BeginAngle = -240;
            radialGauge.SweepAngle = 300;

            return(radialGauge);
        }
示例#4
0
        private void InitFormControls()
        {
            if (m_Updating)
            {
                return;
            }

            m_Updating = true;

            NStandardScaleConfigurator scale = (NStandardScaleConfigurator)m_Axis.ScaleConfigurator;

            RulerLengthComboBox.SelectedItem = (int)scale.RulerStyle.Height.Value;
            RulerOffsetComboBox.SelectedItem = (int)scale.RulerStyle.Offset.Value;

            MajorTicksOffsetComboBox.SelectedItem = (int)scale.OuterMajorTickStyle.Offset.Value;
            MajorTicksLengthComboBox.SelectedItem = (int)scale.OuterMajorTickStyle.Length.Value;
            MajorTicksWidthComboBox.SelectedItem  = (int)scale.OuterMajorTickStyle.Width.Value;
            MajorTickShapeComboBox.SelectedIndex  = (int)scale.OuterMajorTickStyle.Shape;

            MinorTicksOffsetComboBox.SelectedItem = (int)scale.OuterMinorTickStyle.Offset.Value;
            MinorTicksWidthComboBox.SelectedItem  = (int)scale.OuterMinorTickStyle.Width.Value;
            MinorTicksLengthComboBox.SelectedItem = (int)scale.OuterMinorTickStyle.Length.Value;
            MinorTickShapeComboBox.SelectedIndex  = (int)scale.OuterMinorTickStyle.Shape;

            m_Updating = false;
        }
        private void UpdateHighlightRange()
        {
            NScaleStripStyle stripStyle;
            DateTime         origin;

            // create a strip line highlighting the working days
            if (HighLightRangeDropDownList.SelectedIndex == 0)
            {
                origin     = new DateTime(2007, 2, 19);
                stripStyle = new NScaleStripStyle(new NColorFillStyle(Color.SkyBlue), null, true, 0, 0, 2, 5);
            }
            else
            {
                origin     = new DateTime(2007, 2, 17);
                stripStyle = new NScaleStripStyle(new NColorFillStyle(Color.LightSeaGreen), null, true, 0, 0, 5, 2);
            }

            stripStyle.SetShowAtWall(ChartWallType.Back, true);

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

            scaleConfigurator.StripStyles.Clear();
            scaleConfigurator.StripStyles.Add(stripStyle);

            NDateTimeRangeSamplerProvider provider = new NDateTimeRangeSamplerProvider();

            provider.SamplingMode           = SamplingMode.CustomStep;
            provider.UseOrigin              = true;
            provider.Origin                 = origin;
            provider.CustomStep             = new NDateTimeSpan(1, NDateTimeUnit.Day);
            stripStyle.RangeSamplerProvider = provider;
        }
        private void HighLightRangeComboBox_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            NScaleStripStyle stripStyle;
            DateTime         origin;

            // create a strip line highlighting the working days
            if (HighLightRangeComboBox.SelectedIndex == 0)
            {
                origin     = new DateTime(2007, 2, 19);
                stripStyle = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 2, 5);
            }
            else
            {
                origin     = new DateTime(2007, 2, 17);
                stripStyle = new NScaleStripStyle(new NColorFillStyle(Color.Beige), null, true, 0, 0, 5, 2);
            }

            stripStyle.SetShowAtWall(ChartWallType.Back, true);

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

            scaleConfigurator.StripStyles.Clear();
            scaleConfigurator.StripStyles.Add(stripStyle);

            NDateTimeRangeSamplerProvider provider = new NDateTimeRangeSamplerProvider();

            provider.SamplingMode           = SamplingMode.CustomStep;
            provider.UseOrigin              = true;
            provider.Origin                 = origin;
            provider.CustomStep             = new NDateTimeSpan(1, NDateTimeUnit.Day);
            stripStyle.RangeSamplerProvider = provider;

            nChartControl1.Refresh();
        }
示例#7
0
        private NRadialGaugePanel CreateGauge()
        {
            NRadialGaugePanel radialGauge = new NRadialGaugePanel();

            // create gauge panel
            radialGauge.AutoBorder = RadialGaugeAutoBorder.Circle;
            radialGauge.BeginAngle = 130;
            radialGauge.SweepAngle = 280;
            radialGauge.DockMode   = PanelDockMode.Fill;

            // apply paint effects
            radialGauge.PaintEffect = new NGlassEffectStyle();
            radialGauge.BorderStyle = new NEdgeBorderStyle(BorderShape.Auto);

            // Configure the axis
            NGaugeAxis axis = (NGaugeAxis)radialGauge.Axes[0];
            NStandardScaleConfigurator scale = (NStandardScaleConfigurator)axis.ScaleConfigurator;

            scale.SetPredefinedScaleStyle(PredefinedScaleStyle.Presentation);
            scale.LabelFitModes                  = new LabelFitMode[0];
            scale.LabelStyle.Angle               = new NScaleLabelAngle(ScaleLabelAngleMode.Scale, 0, false);
            scale.MinorTickCount                 = 2;
            scale.RulerStyle.BorderStyle.Width   = new NLength(0);
            scale.RulerStyle.FillStyle           = new NColorFillStyle(Color.FromArgb(125, Color.LightGray));
            scale.LabelStyle.TextStyle.FontStyle = new NFontStyle("Arial", 10, FontStyle.Bold);

            // add needle value indicator
            radialGauge.Indicators.Add(new NNeedleValueIndicator());

            return(radialGauge);
        }
示例#8
0
        private NRadialGaugePanel CreateRadialGauge(NKnobIndicator knobIndicator)
        {
            // create the radial gauge
            NRadialGaugePanel radialGauge = new NRadialGaugePanel();

            radialGauge.Size             = new NSizeL(new NLength(0), new NLength(50, NRelativeUnit.ParentPercentage));
            radialGauge.ContentAlignment = ContentAlignment.MiddleCenter;
            radialGauge.DockMode         = PanelDockMode.Fill;
            radialGauge.SweepAngle       = 270;
            radialGauge.BeginAngle       = -225;
            radialGauge.CapStyle.Visible = false;

            radialGauge.Indicators.Add(knobIndicator);

            // configure scale
            NGaugeAxis axis = (NGaugeAxis)radialGauge.Axes[0];
            NStandardScaleConfigurator scale = (NStandardScaleConfigurator)axis.ScaleConfigurator;

            scale.SetPredefinedScaleStyle(PredefinedScaleStyle.PresentationNoStroke);
            scale.LabelStyle.TextStyle.FontStyle = new NFontStyle("Arial", 12, System.Drawing.FontStyle.Italic);
            scale.LabelStyle.TextStyle.FillStyle = new NColorFillStyle(Color.Black);
            scale.LabelStyle.Angle             = new NScaleLabelAngle(ScaleLabelAngleMode.Scale, 0);
            scale.MinorTickCount               = 4;
            scale.RulerStyle.BorderStyle.Width = new NLength(0);
            scale.RulerStyle.FillStyle         = new NColorFillStyle(Color.DarkGray);

            return(radialGauge);
        }
        protected void DecorateGaugeAxis(NRadialGaugePanel panel, NRange1DD range, Color colorLight, Color colorDark)
        {
            NGaugeAxis axis = (NGaugeAxis)panel.Axes[0];
            NStandardScaleConfigurator scale = (NStandardScaleConfigurator)axis.ScaleConfigurator;

            NRangeIndicator rangeIndicator = new NRangeIndicator();

            rangeIndicator.OriginMode      = OriginMode.Custom;
            rangeIndicator.OffsetFromScale = new NLength(10);
            rangeIndicator.Value           = range.Begin;
            rangeIndicator.Origin          = range.End;

            rangeIndicator.FillStyle         = new NColorFillStyle(Color.FromArgb(30, colorLight));
            rangeIndicator.StrokeStyle.Width = new NLength(0);
            panel.Indicators.Add(rangeIndicator);

            NScaleSectionStyle scaleSection = new NScaleSectionStyle();

            scaleSection.Range = range;
            scaleSection.MajorTickFillStyle = new NColorFillStyle(colorLight);
            scaleSection.MinorTickFillStyle = new NColorFillStyle(colorLight);

            NTextStyle labelStyle = new NTextStyle();

            labelStyle.FillStyle        = new NColorFillStyle(colorDark);
            labelStyle.FontStyle.Style  = FontStyle.Bold;
            labelStyle.FontStyle.EmSize = new NLength(6);
            scaleSection.LabelTextStyle = labelStyle;

            scale.Sections.Add(scaleSection);
        }
示例#10
0
        private void UpdateScale()
        {
            if (m_Updating)
            {
                return;
            }

            m_Updating = true;

            NStandardScaleConfigurator scale = (NStandardScaleConfigurator)m_Axis.ScaleConfigurator;

            scale.RulerStyle.Height = new NLength((int)RulerLengthComboBox.SelectedItem);
            scale.RulerStyle.Offset = new NLength((int)RulerOffsetComboBox.SelectedItem);

            scale.OuterMajorTickStyle.Offset = new NLength((int)MajorTicksOffsetComboBox.SelectedItem);
            scale.OuterMajorTickStyle.Length = new NLength((int)MajorTicksLengthComboBox.SelectedItem);
            scale.OuterMajorTickStyle.Width  = new NLength((int)MajorTicksWidthComboBox.SelectedItem);
            scale.OuterMajorTickStyle.Shape  = (ScaleTickShape)MajorTickShapeComboBox.SelectedIndex;

            scale.OuterMinorTickStyle.Offset = new NLength((int)MinorTicksOffsetComboBox.SelectedItem);
            scale.OuterMinorTickStyle.Width  = new NLength((int)MinorTicksWidthComboBox.SelectedItem);
            scale.OuterMinorTickStyle.Length = new NLength((int)MinorTicksLengthComboBox.SelectedItem);
            scale.OuterMinorTickStyle.Shape  = (ScaleTickShape)MinorTickShapeComboBox.SelectedIndex;

            m_Updating = false;

            nChartControl1.Refresh();
        }
示例#11
0
        private void XTitleTextBox_TextChanged(object sender, System.EventArgs e)
        {
            NStandardScaleConfigurator scaleConfiguratorX = (NStandardScaleConfigurator)m_Chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator;

            scaleConfiguratorX.Title.Text = XTitleTextBox.Text;

            nChartControl1.Refresh();
        }
示例#12
0
        private void XOffsetScrollBar_ValueChanged(object sender, Nevron.UI.WinForm.Controls.ScrollBarEventArgs e)
        {
            NStandardScaleConfigurator scaleConfigurator = (NStandardScaleConfigurator)m_Chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator;

            scaleConfigurator.Title.Offset = new NLength(XOffsetScrollBar.Value, NGraphicsUnit.Pixel);

            nChartControl1.Refresh();
        }
示例#13
0
        private void LeftMinor2Check_CheckedChanged(object sender, System.EventArgs e)
        {
            NStandardScaleConfigurator scaleConfigurator = (NStandardScaleConfigurator)m_Chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator;

            scaleConfigurator.MinorGridStyle.SetShowAtWall(ChartWallType.Back, LeftMinor2Check.Checked);

            nChartControl1.Refresh();
        }
示例#14
0
        private void Depth2Check_CheckedChanged(object sender, System.EventArgs e)
        {
            NStandardScaleConfigurator scaleConfigurator = (NStandardScaleConfigurator)m_Chart.Axis(StandardAxis.Depth).ScaleConfigurator;

            scaleConfigurator.MajorGridStyle.SetShowAtWall(ChartWallType.Left, Depth2Check.Checked);

            nChartControl1.Refresh();
        }
示例#15
0
        private void Bottom1Check_CheckedChanged(object sender, System.EventArgs e)
        {
            NStandardScaleConfigurator scaleConfigurator = (NStandardScaleConfigurator)m_Chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator;

            scaleConfigurator.MajorGridStyle.SetShowAtWall(ChartWallType.Floor, Bottom1Check.Checked);

            nChartControl1.Refresh();
        }
        public override void Initialize()
        {
            base.Initialize();
            nChartControl1.Controller.Tools.Add(new NPanelSelectorTool());
            nChartControl1.Controller.Tools.Add(new NTrackballTool());

            nChartControl1.Legends.Clear();

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

            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(3, NRelativeUnit.ParentPercentage));

            NChart chart = nChartControl1.Charts[0];

            chart.Enable3D   = true;
            chart.Width      = 55;
            chart.Height     = 25;
            chart.Depth      = 40;
            chart.BoundsMode = BoundsMode.Fit;
            chart.Projection.SetPredefinedProjection(PredefinedProjection.PerspectiveTilted);
            chart.LightModel.GlobalAmbientLight = Color.FromArgb(20, 20, 20);

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

            stripStyle.Interlaced  = true;
            stripStyle.ShowAtWalls = new ChartWallType[] {
                ChartWallType.Back,
                ChartWallType.Left,
                ChartWallType.Right,
                ChartWallType.Front
            };

            NStandardScaleConfigurator scaleY = (NStandardScaleConfigurator)chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator;

            scaleY.StripStyles.Add(stripStyle);

            // create several series
            for (int i = 0; i < 4; i++)
            {
                NBarSeries bar = (NBarSeries)chart.Series.Add(SeriesType.Bar);
                bar.Values.FillRandom(Random, 6);
                bar.DataLabelStyle.Visible = false;
            }

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

            styleSheet.Apply(nChartControl1.Document);

            // init form controls
            AutoWallVisibilityCheck.Checked    = true;
            LightsInCameraSpaceCheck.Checked   = true;
            AxisAnchorsModeCombo.SelectedIndex = 0;
        }
        public override void Initialize()
        {
            nChartControl1.Panels.Clear();

            // set a chart title
            NLabel header = new NLabel("Gauge Axis Scale Appearance");

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

            nChartControl1.Panels.Add(header);

            // create the radial gauge
            NRadialGaugePanel radialGauge = new NRadialGaugePanel();

            radialGauge.Location            = new NPointL(new NLength(10, NRelativeUnit.ParentPercentage), new NLength(15, NRelativeUnit.ParentPercentage));
            radialGauge.Size                = new NSizeL(new NLength(80, NRelativeUnit.ParentPercentage), new NLength(80, NRelativeUnit.ParentPercentage));
            radialGauge.BackgroundFillStyle = new NGradientFillStyle(GradientStyle.Horizontal, GradientVariant.Variant1, Color.White, Color.Gray);
            radialGauge.PaintEffect         = new NGlassEffectStyle();
            radialGauge.BorderStyle         = new NEdgeBorderStyle(BorderShape.Auto);
            radialGauge.PositionChildPanelsInContentBounds = true;

            nChartControl1.Panels.Add(radialGauge);

            m_Axis = (NGaugeAxis)radialGauge.Axes[0];
            NStandardScaleConfigurator scale = (NStandardScaleConfigurator)m_Axis.ScaleConfigurator;

            scale.MinorTickCount = 3;

            NRangeIndicator indicator1 = new NRangeIndicator();

            indicator1.Value             = 80;
            indicator1.OriginMode        = OriginMode.ScaleMax;
            indicator1.FillStyle         = new NColorFillStyle(Color.Red);
            indicator1.StrokeStyle.Color = Color.DarkRed;
            radialGauge.Indicators.Add(indicator1);

            NNeedleValueIndicator indicator2 = new NNeedleValueIndicator();

            indicator2.Value                   = 79;
            indicator2.Shape.FillStyle         = new NGradientFillStyle(GradientStyle.Horizontal, GradientVariant.Variant1, Color.White, Color.Red);
            indicator2.Shape.StrokeStyle.Color = Color.Red;
            radialGauge.Indicators.Add(indicator2);
            radialGauge.SweepAngle = 270;

            m_Updating = true;

            MinorTickShapeComboBox.FillFromEnum(typeof(ScaleTickShape));
            MajorTickShapeComboBox.FillFromEnum(typeof(ScaleTickShape));
            PredefinedScaleStyleComboBox.FillFromEnum(typeof(PredefinedScaleStyle));
            PredefinedScaleStyleComboBox.SelectedIndex = (int)PredefinedScaleStyle.Standard;

            m_Updating = false;

            InitFormControls();
        }
        private void PredefinedScaleStyleComboBox_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            NStandardScaleConfigurator scale = (NStandardScaleConfigurator)m_Axis.ScaleConfigurator;

            scale.SetPredefinedScaleStyle((PredefinedScaleStyle)PredefinedScaleStyleComboBox.SelectedIndex);
            InitFormControls();

            nChartControl1.Refresh();
        }
示例#19
0
        private void LeftMinorCombo_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            NStandardScaleConfigurator scaleConfigurator = (NStandardScaleConfigurator)m_Chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator;
            LinePattern pattern = GetPatternFromIndex(LeftMinorCombo.SelectedIndex);

            scaleConfigurator.MinorGridStyle.LineStyle.Pattern = pattern;

            nChartControl1.Refresh();
        }
示例#20
0
        private void NChartControl1_Click(object sender, EventArgs e)
        {
            NPostbackEventArgs eventArgs      = e as NPostbackEventArgs;
            object             selectedObject = eventArgs.Id.FindInDocument(nChartControl1.Document);

            if (selectedObject is NDataPoint)
            {
                NDataPoint dataPoint = (NDataPoint)selectedObject;

                dataPoint[DataPointValue.FillStyle] = new NColorFillStyle(Color.Red);

                NSeries series = (NSeries)dataPoint.ParentNode;
                series.StoreDataPoint(dataPoint.IndexInSeries, dataPoint);

                return;
            }

            if (selectedObject is NLabel)
            {
                ((NLabel)selectedObject).TextStyle.FillStyle = new NColorFillStyle(Color.Red);
                return;
            }

            if (selectedObject is NLegend)
            {
                ((NLegend)selectedObject).FillStyle = new NColorFillStyle(Color.Red);
                return;
            }

            if (selectedObject is NLegendItemCellData)
            {
                NLegendItemCellData licd   = selectedObject as NLegendItemCellData;
                NLegend             legend = nChartControl1.Legends[0];
                SelectDataItem(legend.Data.Items.IndexOf(licd));
                return;
            }

            if (selectedObject is NChartWall)
            {
                ((NChartWall)selectedObject).FillStyle = new NColorFillStyle(Color.Red);
                return;
            }

            if (selectedObject is NAxisStripe)
            {
                ((NAxisStripe)selectedObject).FillStyle = new NColorFillStyle(Color.Red);
                return;
            }

            if (selectedObject is NAxis)
            {
                NAxis axis = selectedObject as NAxis;
                NStandardScaleConfigurator scaleConfigurator = (NStandardScaleConfigurator)axis.ScaleConfigurator;
                scaleConfigurator.RulerStyle.BorderStyle.Color   = Color.Red;
                scaleConfigurator.LabelStyle.TextStyle.FillStyle = new NColorFillStyle(Color.Red);
            }
        }
        private void RoundToTickCheck_CheckedChanged(object sender, System.EventArgs e)
        {
            NStandardScaleConfigurator standardScale = (NStandardScaleConfigurator)m_Chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator;

            standardScale.RoundToTickMax = RoundToTickCheck.Checked;
            standardScale.RoundToTickMin = RoundToTickCheck.Checked;

            nChartControl1.Refresh();
        }
        private void LeftAxisRoundToTickCheckBox_Checked(object sender, System.Windows.RoutedEventArgs e)
        {
            NStandardScaleConfigurator standardScale = (NStandardScaleConfigurator)m_Chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator;

            standardScale.RoundToTickMin = (bool)LeftAxisRoundToTickCheckBox.IsChecked;
            standardScale.RoundToTickMax = (bool)LeftAxisRoundToTickCheckBox.IsChecked;

            nChartControl1.Refresh();
        }
示例#23
0
        private void CreateSpeedGauge()
        {
            // create the radial gauge
            NRadialGaugePanel radialGauge = new NRadialGaugePanel();


            radialGauge.BackgroundFillStyle = CreateAdvancedGradient();
            radialGauge.BorderStyle         = new NEdgeBorderStyle(BorderShape.Auto);
            radialGauge.PaintEffect         = new NGlassEffectStyle();
            radialGauge.ContentAlignment    = ContentAlignment.BottomRight;
            radialGauge.Location            = new NPointL(new NLength(5, NRelativeUnit.ParentPercentage), new NLength(15, NRelativeUnit.ParentPercentage));
            radialGauge.Size = new NSizeL(new NLength(45, NRelativeUnit.ParentPercentage), new NLength(80, NRelativeUnit.ParentPercentage));

            NLabel label = new NLabel("km/h");

            label.ContentAlignment           = ContentAlignment.BottomCenter;
            label.TextStyle.FontStyle        = new NFontStyle("Times New Roman", 20, FontStyle.Italic);
            label.TextStyle.FontStyle.Style  = FontStyle.Italic;
            label.TextStyle.FillStyle        = new NColorFillStyle(Color.White);
            label.TextStyle.ShadowStyle.Type = ShadowType.LinearBlur;
            label.BoundsMode       = BoundsMode.Fit;
            label.UseAutomaticSize = false;
            label.Size             = new NSizeL(
                new NLength(60, NRelativeUnit.ParentPercentage),
                new NLength(7, NRelativeUnit.ParentPercentage));
            label.Location = new NPointL(
                new NLength(50, NRelativeUnit.ParentPercentage),
                new NLength(55, NRelativeUnit.ParentPercentage));
            label.Cache = true;

            radialGauge.ChildPanels.Add(label);
            nChartControl1.Panels.Add(radialGauge);

            NGaugeAxis axis = (NGaugeAxis)radialGauge.Axes[0];

            axis.Range = new NRange1DD(0, 250);

            NStandardScaleConfigurator scale = (NStandardScaleConfigurator)axis.ScaleConfigurator;

            ConfigureScale(scale, new NRange1DD(220, 260));
            radialGauge.Indicators.Add(CreateRangeIndicator(220));

            NMarkerValueIndicator indicator3 = new NMarkerValueIndicator();

            indicator3.Value = 90;
            radialGauge.Indicators.Add(indicator3);

            m_SpeedIndicator                         = new NNeedleValueIndicator();
            m_SpeedIndicator.Value                   = 0;
            m_SpeedIndicator.Shape.FillStyle         = new NGradientFillStyle(GradientStyle.Horizontal, GradientVariant.Variant1, Color.White, Color.Red);
            m_SpeedIndicator.Shape.StrokeStyle.Color = Color.Red;
            radialGauge.Indicators.Add(m_SpeedIndicator);

            radialGauge.BeginAngle = -240;
            radialGauge.SweepAngle = 300;
        }
示例#24
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;
        }
示例#25
0
        private void LeftMinorColor_Click(object sender, System.EventArgs e)
        {
            NStandardScaleConfigurator scaleConfigurator = (NStandardScaleConfigurator)m_Chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator;

            colorDialog1.Color = scaleConfigurator.MinorGridStyle.LineStyle.Color;
            colorDialog1.ShowDialog();

            scaleConfigurator.MinorGridStyle.LineStyle.Color = colorDialog1.Color;
            nChartControl1.Refresh();
        }
        private void RulerStrokeStyleButton_Click(object sender, System.EventArgs e)
        {
            NStandardScaleConfigurator scale = (NStandardScaleConfigurator)m_Axis.ScaleConfigurator;
            NStrokeStyle stokeStyleResult;

            if (NStrokeStyleTypeEditor.Edit(scale.RulerStyle.BorderStyle, out stokeStyleResult))
            {
                scale.RulerStyle.BorderStyle = stokeStyleResult;
                nChartControl1.Refresh();
            }
        }
示例#27
0
        private void UpdateRulerStyleForAxis(NAxis axis)
        {
            // Update the ruler caps for the axis from form controls
            NStandardScaleConfigurator scale = (NStandardScaleConfigurator)axis.ScaleConfigurator;

            // apply style to begin and end caps
            scale.RulerStyle.BeginCapStyle.Style      = (CapStyle)BeginCapStyleDropDownList.SelectedIndex;
            scale.RulerStyle.EndCapStyle.Style        = (CapStyle)EndCapStyleDropDownList.SelectedIndex;
            scale.RulerStyle.ScaleBreakCapStyle.Style = (CapStyle)ScaleBreakCapStyleDropDownList.SelectedIndex;
            scale.RulerStyle.PaintOnScaleBreaks       = PaintOnScaleBreaksCheckBox.Checked;
        }
示例#28
0
        private void XTitleStyleButton_Click(object sender, System.EventArgs e)
        {
            NStandardScaleConfigurator scaleConfigurator = (NStandardScaleConfigurator)m_Chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator;
            NTextStyle textStyleResult;

            if (NTextStyleTypeEditor.Edit(scaleConfigurator.Title.TextStyle, out textStyleResult))
            {
                scaleConfigurator.Title.TextStyle = textStyleResult;
                nChartControl1.Refresh();
            }
        }
示例#29
0
        private void MinorTicksStrokeStyleButton_Click(object sender, RoutedEventArgs e)
        {
            NStandardScaleConfigurator scale = (NStandardScaleConfigurator)m_Axis.ScaleConfigurator;
            NStrokeStyle stokeStyleResult;

            if (NStrokeStyleTypeEditor.Edit(scale.OuterMinorTickStyle.LineStyle, out stokeStyleResult))
            {
                scale.OuterMinorTickStyle.LineStyle = stokeStyleResult;
                nChartControl1.Refresh();
            }
        }
示例#30
0
        private void MajorTicksFillStyleButton_Click(object sender, RoutedEventArgs e)
        {
            NStandardScaleConfigurator scale = (NStandardScaleConfigurator)m_Axis.ScaleConfigurator;
            NFillStyle fillStyleResult;

            if (NFillStyleTypeEditor.Edit(scale.OuterMajorTickStyle.FillStyle, out fillStyleResult))
            {
                scale.OuterMajorTickStyle.FillStyle = fillStyleResult;
                nChartControl1.Refresh();
            }
        }