internal void InitRanges() { NRange r = new NRange(); r.Name = "Standard"; r.ID = 0; m_Manager.Ranges.Add(r); }
private NCustomScaleBreak CreateCustomScaleBreak(NColor color, NRange range) { NCustomScaleBreak scaleBreak = new NCustomScaleBreak(); scaleBreak.Fill = new NColorFill(new NColor(color, 124)); scaleBreak.Length = 10; scaleBreak.Range = range; return(scaleBreak); }
/// <summary> /// Initializer constructor /// </summary> /// <param name="range"></param> /// <param name="reversalFactor"></param> /// <param name="valueScale"></param> internal NStockDataGenerator(NRange range, double reversalFactor, double valueScale) { m_Rand = new Random(); m_Range = range; m_Direction = 1; m_StepsInCurrentTrend = 0; m_Value = 0; m_ReversalPorbability = 0; m_ReversalFactor = reversalFactor; m_ValueScale = valueScale; }
internal void InitRanges() { NRange r = new NRange(); r.Name = "Standard"; r.ID = (int)NIDELoadUC.RangeID.Standard; m_CommandBarsManager.Ranges.Add(r); r = new NRange(); r.Name = "Menu Bar"; r.ID = (int)NIDELoadUC.RangeID.MenuBar; m_CommandBarsManager.Ranges.Add(r); }
protected override NWidget CreateExampleContent() { NChartView chartView = CreateCartesianChartView(); // configure title chartView.Surface.Titles[0].Text = "Area Palette"; // configure chart m_Chart = (NCartesianChart)chartView.Surface.Charts[0]; m_Chart.SetPredefinedCartesianAxes(ENPredefinedCartesianAxis.XOrdinalYLinear); // add interlace stripe NLinearScale linearScale = m_Chart.Axes[ENCartesianAxis.PrimaryY].Scale as NLinearScale; NScaleStrip strip = new NScaleStrip(new NColorFill(ENNamedColor.Beige), null, true, 0, 0, 1, 1); strip.Interlaced = true; linearScale.Strips.Add(strip); // setup an area series m_Area = new NAreaSeries(); m_Area.Name = "Area Series"; m_Area.InflateMargins = true; m_Area.UseXValues = false; m_Area.DataLabelStyle = new NDataLabelStyle(false); m_Area.Palette = new NColorValuePalette(new NColorValuePair[] { new NColorValuePair(0, NColor.Green), new NColorValuePair(60, NColor.Yellow), new NColorValuePair(120, NColor.Red) }); m_AxisRange = new NRange(0, 130); // limit the axis range to 0, 130 NCartesianAxis yAxis = m_Chart.Axes[ENCartesianAxis.PrimaryY]; yAxis.ViewRangeMode = ENAxisViewRangeMode.FixedRange; yAxis.MinViewRangeValue = m_AxisRange.Begin; yAxis.MaxViewRangeValue = m_AxisRange.End; m_Chart.Series.Add(m_Area); int indicatorCount = 10; m_IndicatorPhase = new double[indicatorCount]; // add some data to the area series for (int i = 0; i < indicatorCount; i++) { m_IndicatorPhase[i] = i * 30; m_Area.DataPoints.Add(new NAreaDataPoint(0)); } return(chartView); }
private NScaleSection CreateSection(NColor tickColor, NColor labelColor, NRange range) { NScaleSection scaleSection = new NScaleSection(); scaleSection.Range = range; scaleSection.MajorTickFill = new NColorFill(tickColor); NTextStyle labelStyle = new NTextStyle(); labelStyle.Fill = new NColorFill(labelColor); labelStyle.Font = new NFont("Arimo", 12, ENFontStyle.Bold); scaleSection.LabelTextStyle = labelStyle; return(scaleSection); }
internal void InitRanges() { NRange r = new NRange(); r.Name = "Standard"; r.ID = 0; m_Manager.Ranges.Add(r); r = new NRange(); r.Name = "Action"; r.ID = 1; m_Manager.Ranges.Add(r); r = new NRange(); r.Name = "Layout"; r.ID = 2; m_Manager.Ranges.Add(r); r = new NRange(); r.Name = "Tools"; r.ID = 3; m_Manager.Ranges.Add(r); r = new NRange(); r.Name = "View"; r.ID = 4; m_Manager.Ranges.Add(r); r = new NRange(); r.Name = "Test"; r.EditorBrowsable = false; r.ID = 5; m_Manager.Ranges.Add(r); r = new NRange(); r.Name = "ComboBoxes"; r.ID = 6; m_Manager.Ranges.Add(r); r = new NRange(); r.Name = "Format"; r.ID = 7; m_Manager.Ranges.Add(r); }
protected override NWidget CreateExampleContent() { NStackPanel stack = new NStackPanel(); stack.HorizontalPlacement = Layout.ENHorizontalPlacement.Left; m_AxisRange = new NRange(80, 130); int indicatorCount = 4; m_IndicatorPhase = new double[indicatorCount]; // create gauges CreateLinearGauge(); CreateRadialGauge(); // add to stack stack.Add(m_LinearGauge); stack.Add(m_RadialGauge); // add axes m_LinearGauge.Axes.Add(CreateGaugeAxis()); m_RadialGauge.Axes.Add(CreateGaugeAxis()); double offset = 10; // now add two indicators for (int i = 0; i < indicatorCount; i++) { m_IndicatorPhase[i] = i * 30; m_LinearGauge.Indicators.Add(CreateRangeIndicator(offset)); offset += 20; } m_RadialGauge.Indicators.Add(CreateRangeIndicator(0)); return(stack); }
private void ApplyScaleSectionToAxis(NLinearScale scale, string text, NRange range, NColor color) { NScaleSection scaleSection = new NScaleSection(); scaleSection.Range = range; scaleSection.LabelTextStyle = new NTextStyle(); scaleSection.LabelTextStyle.Fill = new NColorFill(color); scaleSection.LabelTextStyle.Font = new NFont("Arimo", 10, ENFontStyle.Bold | ENFontStyle.Italic); scaleSection.MajorTickStroke = new NStroke(color); scale.Sections.Add(scaleSection); NCustomRangeLabel rangeLabel = new NCustomRangeLabel(range, text); rangeLabel.LabelStyle.AlwaysInsideScale = false; rangeLabel.LabelStyle.VisibilityMode = ENScaleLabelVisibilityMode.TextInRuler; rangeLabel.LabelStyle.Stroke.Color = color; rangeLabel.LabelStyle.TextStyle.Fill = new NColorFill(NColor.White); rangeLabel.LabelStyle.Angle = new NScaleLabelAngle(ENScaleLabelAngleMode.Scale, 0); rangeLabel.LabelStyle.TickMode = ENRangeLabelTickMode.Center; scale.CustomLabels.Add(rangeLabel); }
protected void RecreateToolbar() { m_Manager.Commander = new NCustomChartCommander(); m_Manager.ToolbarsBuilder = new NCustomChartToolbarsBuilder(this); m_Manager.Recreate(); NRange range1 = new NRange(); range1.ID = NCustomChartCommander.m_CustomCommandRange1; range1.Name = "Custom Commands1"; m_Manager.Ranges.Add(range1); NRange range2 = new NRange(); range2.ID = NCustomChartCommander.m_CustomCommandRange1; range2.Name = "Custom Commands1"; m_Manager.Ranges.Add(range2); m_Manager.ChartControl = nChartControl1; // remove the palette button from he standard toolbar for (int i = m_Manager.Toolbars.Count - 1; i >= 0; i--) { NDockingToolbar toolbar = m_Manager.Toolbars[i]; if (toolbar.DefaultRangeID == (int)ChartCommandRange.Standard) { // if not removed check whether to remove command from it if (!ShowPaletteButtonCheckBox.Checked) { NCommand command = toolbar.Commands.GetCommandById((int)ChartCommand.ApplyStyleSheet); toolbar.Commands.Remove(command); } } } }
protected override NWidget CreateExampleContent() { NStackPanel stack = new NStackPanel(); stack.HorizontalPlacement = Layout.ENHorizontalPlacement.Left; // create a linear gauge m_LinearGauge = new NLinearGauge(); stack.Add(m_LinearGauge); m_LinearGauge.CapEffect = new NGelCapEffect(); m_LinearGauge.Border = base.CreateBorder(); m_LinearGauge.Padding = new NMargins(20); m_LinearGauge.BorderThickness = new NMargins(6); m_LinearGauge.BackgroundFill = new NStockGradientFill(NColor.Gray, NColor.Black); m_LinearGauge.PreferredSize = new NSize(400, 150); m_LinearGauge.Axes.Clear(); NRange celsiusRange = new NRange(-40.0, 60.0); // add celsius and farenheit axes NGaugeAxis celsiusAxis = new NGaugeAxis(); celsiusAxis.Range = celsiusRange; celsiusAxis.Anchor = new NModelGaugeAxisAnchor(-5, ENVerticalAlignment.Center, ENScaleOrientation.Left, 0.0f, 100.0f); m_LinearGauge.Axes.Add(celsiusAxis); NGaugeAxis farenheitAxis = new NGaugeAxis(); farenheitAxis.Range = new NRange(CelsiusToFarenheit(celsiusRange.Begin), CelsiusToFarenheit(celsiusRange.End)); farenheitAxis.Anchor = new NModelGaugeAxisAnchor(5, ENVerticalAlignment.Center, ENScaleOrientation.Right, 0.0f, 100.0f); m_LinearGauge.Axes.Add(farenheitAxis); // configure the scales NLinearScale celsiusScale = (NLinearScale)celsiusAxis.Scale; ConfigureScale(celsiusScale, "°C"); celsiusScale.Sections.Add(CreateSection(NColor.Red, NColor.Red, new NRange(40, 60))); celsiusScale.Sections.Add(CreateSection(NColor.Blue, NColor.SkyBlue, new NRange(-40, -20))); NLinearScale farenheitScale = (NLinearScale)farenheitAxis.Scale; ConfigureScale(farenheitScale, "°F"); farenheitScale.Sections.Add(CreateSection(NColor.Red, NColor.Red, new NRange(CelsiusToFarenheit(40), CelsiusToFarenheit(60)))); farenheitScale.Sections.Add(CreateSection(NColor.Blue, NColor.SkyBlue, new NRange(CelsiusToFarenheit(-40), CelsiusToFarenheit(-20)))); // now add two indicators m_Indicator1 = new NRangeIndicator(); m_Indicator1.Value = 10; m_Indicator1.Stroke.Color = NColor.DarkBlue; m_Indicator1.Fill = new NStockGradientFill(ENGradientStyle.Vertical, ENGradientVariant.Variant1, NColor.LightBlue, NColor.Blue); m_Indicator1.BeginWidth = 10; m_Indicator1.EndWidth = 10; m_LinearGauge.Indicators.Add(m_Indicator1); m_Indicator2 = new NMarkerValueIndicator(); m_Indicator2.Value = 33; // m_Indicator2.ShapFillStyle = new NStockGradientFill(ENGradientStyle.Horizontal, ENGradientVariant.Variant1, NColor.White, NColor.Red); // m_Indicator2.Shape.StrokeStyle.Color = Color.DarkRed; m_LinearGauge.Indicators.Add(m_Indicator2); return(stack); }