public override void Initialize() { nChartControl1.Panels.Clear(); // set a chart title NLabel header = new NLabel("Car Dashboard<br/><font size = '9pt' style ='normal'>Demonstrates how to create state indicators anchored to gauges</font>"); header.ContentAlignment = ContentAlignment.MiddleCenter; header.TextStyle.TextFormat = TextFormat.XML; header.TextStyle.FontStyle = new NFontStyle("Times New Roman", 18); header.TextStyle.FillStyle = new NGradientFillStyle(Color.Black, Color.White); header.TextStyle.BorderStyle = new NStrokeStyle(Color.Gray); header.TextStyle.FontStyle.EmSize = new NLength(22); header.TextStyle.FontStyle.Style = FontStyle.Bold; header.BoundsMode = BoundsMode.None; header.UseAutomaticSize = false; header.Size = new NSizeL( new NLength(60, NRelativeUnit.ParentPercentage), new NLength(10, NRelativeUnit.ParentPercentage)); header.Location = new NPointL( new NLength(50, NRelativeUnit.ParentPercentage), new NLength(6, NRelativeUnit.ParentPercentage)); nChartControl1.Panels.Add(header); CreateSpeedGauge(); CreateRPMGauge(); nChartControl1.AutoRefresh = true; NRangeIndicatorState stateIndicator = new NRangeIndicatorState(); m_Timer.Interval = 50; m_Timer.Enabled = true; }
private void CreateRotationStateIndicator() { m_RotationStateIndicator = new NStateIndicatorPanel(); m_RotationStateIndicator.UseAutomaticSize = true; m_RotationStateIndicator.DefaultState.ShapeSize = new NSizeL(10, 10); NRangeIndicatorState orangeState = new NRangeIndicatorState(); orangeState.Shape.FillStyle = new NColorFillStyle(Color.Orange); orangeState.ShapeSize = new NSizeL(10, 10); orangeState.Range = new NRange1DD(5000, 6000); m_RotationStateIndicator.States.Add(orangeState); NRangeIndicatorState redState = new NRangeIndicatorState(); redState.Shape.FillStyle = new NColorFillStyle(Color.Red); redState.Range = new NRange1DD(6000, 8000); redState.ShapeSize = new NSizeL(10, 10); m_RotationStateIndicator.States.Add(redState); }