public void SetGaugeValuesRedGreenBlue() { List <GaugeRange> newValues = new List <GaugeRange>(); //Red GaugeRange newSensorLimit = new GaugeRange(); newSensorLimit.StartValue = 10; newSensorLimit.EndValue = 20; newSensorLimit.Colour = Color.red; newValues.Add(newSensorLimit); //Green newSensorLimit = new GaugeRange(); newSensorLimit.StartValue = 20; newSensorLimit.EndValue = 30; newSensorLimit.Colour = Color.green; newValues.Add(newSensorLimit); //Blue newSensorLimit = new GaugeRange(); newSensorLimit.StartValue = 30; newSensorLimit.EndValue = 40; newSensorLimit.Colour = Color.blue; newValues.Add(newSensorLimit); _myGauge.GaugeRanges = newValues; _myGauge.ReSetGauge(); }
private void CargarTensionDiastolica() { try { decimal Diastolica = Convert.ToDecimal(Request.QueryString["Diastolica"]); decimal limiteSuperiorDiastolica = Convert.ToInt16(Request.QueryString["limiteSuperiorDiastolica"]); decimal limiteInferiorDiastolica = Convert.ToInt16(Request.QueryString["limiteInferiorDiastolica"]); RadRadialGaugeTensionDiastolica.Pointer.Value = Diastolica; RadRadialGaugeTensionDiastolica.Pointer.Color = System.Drawing.Color.Blue; RadRadialGaugeTensionDiastolica.Pointer.Cap.Size = (float)0.1; RadRadialGaugeTensionDiastolica.Scale.Min = 0; RadRadialGaugeTensionDiastolica.Scale.Max = limiteSuperiorDiastolica + 20; RadRadialGaugeTensionDiastolica.Scale.MinorUnit = (decimal)1; RadRadialGaugeTensionDiastolica.Scale.MajorUnit = 10; RadRadialGaugeTensionDiastolica.Scale.MinorTicks.Visible = false; RadRadialGaugeTensionDiastolica.Scale.MajorTicks.Size = 1; RadRadialGaugeTensionDiastolica.Scale.Labels.Visible = true; RadRadialGaugeTensionDiastolica.Scale.Labels.Font = "8px Arial,Helvetica,sans-serif"; RadRadialGaugeTensionDiastolica.Scale.Labels.Color = System.Drawing.Color.Black; RadRadialGaugeTensionDiastolica.Scale.Labels.Format = "{0}"; RadRadialGaugeTensionDiastolica.Scale.Labels.Position = Telerik.Web.UI.Gauge.ScaleLabelsPosition.Outside; GaugeRange Diastolicagr1 = new GaugeRange(); Diastolicagr1.From = 0; Diastolicagr1.To = limiteInferiorDiastolica; if (limiteInferiorDiastolica == 0) { Diastolicagr1.Color = System.Drawing.Color.Gray; } else { Diastolicagr1.Color = System.Drawing.Color.Red; } GaugeRange Diastolicagr2 = new GaugeRange(); Diastolicagr2.From = (decimal)limiteInferiorDiastolica + Convert.ToDecimal(0.1); Diastolicagr2.To = (decimal)limiteSuperiorDiastolica - Convert.ToDecimal(0.1); Diastolicagr2.Color = System.Drawing.Color.Green; GaugeRange Diastolicagr3 = new GaugeRange(); Diastolicagr3.From = (decimal)limiteSuperiorDiastolica; Diastolicagr3.To = (decimal)limiteSuperiorDiastolica + Convert.ToDecimal(50); if (limiteSuperiorDiastolica == 0) { Diastolicagr3.Color = System.Drawing.Color.Gray; } else { Diastolicagr3.Color = System.Drawing.Color.Red; } RadRadialGaugeTensionDiastolica.Scale.Ranges.Add(Diastolicagr1); RadRadialGaugeTensionDiastolica.Scale.Ranges.Add(Diastolicagr2); RadRadialGaugeTensionDiastolica.Scale.Ranges.Add(Diastolicagr3); } catch (Exception ex) { RadNotificationMensajes.Show(ex.Message); } }
// a method to create a new range and adding it to the list private void setRange(double min, double max, int color) { GaugeRange range = new GaugeRange(); range.Min = min; range.Max = max; range.Color = new Color(color); mLinearGauge.Ranges.Add(range); mRadialGauge.Ranges.Add(range); }
private void CargarGaugeRiesgo() { try { int riesgo = Convert.ToInt16(Request.QueryString["riesgo"]); if (riesgo == 1) { RadRadialGaugeRiesgo.Pointer.Value = Convert.ToDecimal(2.5); } else if (riesgo == 2) { RadRadialGaugeRiesgo.Pointer.Value = Convert.ToDecimal(1.5); } else if (riesgo == 3) { RadRadialGaugeRiesgo.Pointer.Value = Convert.ToDecimal(0.5); } RadRadialGaugeRiesgo.Pointer.Color = System.Drawing.Color.Blue; RadRadialGaugeRiesgo.Scale.Min = 0; RadRadialGaugeRiesgo.Scale.Max = (decimal)3; RadRadialGaugeRiesgo.Scale.MinorUnit = (decimal)0; RadRadialGaugeRiesgo.Scale.MajorUnit = (decimal)1; RadRadialGaugeRiesgo.Scale.MinorTicks.Visible = false; RadRadialGaugeRiesgo.Scale.MajorTicks.Size = 10; RadRadialGaugeRiesgo.Scale.Labels.Visible = false; RadRadialGaugeRiesgo.Scale.Labels.Font = "10px Arial,Helvetica,sans-serif"; RadRadialGaugeRiesgo.Scale.Labels.Color = System.Drawing.Color.Black; RadRadialGaugeRiesgo.Scale.Labels.Format = "{0}"; RadRadialGaugeRiesgo.Scale.Labels.Position = Telerik.Web.UI.Gauge.ScaleLabelsPosition.Outside; GaugeRange gr1 = new GaugeRange(); gr1.From = 0; gr1.To = (decimal)1; gr1.Color = System.Drawing.Color.Green; GaugeRange gr2 = new GaugeRange(); gr2.From = (decimal)1.1; gr2.To = (decimal)2; gr2.Color = System.Drawing.Color.Yellow; GaugeRange gr3 = new GaugeRange(); gr3.From = (decimal)2.1; gr3.To = (decimal)3; gr3.Color = System.Drawing.Color.FromArgb(225, 0, 0); RadRadialGaugeRiesgo.Scale.Ranges.Add(gr1); RadRadialGaugeRiesgo.Scale.Ranges.Add(gr2); RadRadialGaugeRiesgo.Scale.Ranges.Add(gr3); } catch (Exception ex) { RadNotificationMensajes.Show(ex.Message); } }
public void SetGaugeValuesRed() { List <GaugeRange> newValues = new List <GaugeRange>(); GaugeRange newSensorLimit = new GaugeRange(); newSensorLimit.StartValue = 10; newSensorLimit.EndValue = 20; newSensorLimit.Colour = Color.red; newValues.Add(newSensorLimit); _myGauge.GaugeRanges = newValues; _myGauge.ReSetGauge(); }
public void SetGaugeValuesPhSensor() { List <GaugeRange> newValues = new List <GaugeRange>(); GaugeRange newSensorLimit; //Range 1 newSensorLimit = new GaugeRange(); newSensorLimit.StartValue = 4; newSensorLimit.EndValue = 6; newSensorLimit.Colour = Color.red; newValues.Add(newSensorLimit); //Range 2 newSensorLimit = new GaugeRange(); newSensorLimit.StartValue = 6; newSensorLimit.EndValue = 6.25f; newSensorLimit.Colour = Color.yellow; newValues.Add(newSensorLimit); //Range 3 newSensorLimit = new GaugeRange(); newSensorLimit.StartValue = 6.25f; newSensorLimit.EndValue = 7.75f; newSensorLimit.Colour = Color.green; newValues.Add(newSensorLimit); //Range 4 newSensorLimit = new GaugeRange(); newSensorLimit.StartValue = 7.25f; newSensorLimit.EndValue = 8; newSensorLimit.Colour = Color.yellow; newValues.Add(newSensorLimit); //Range 5 newSensorLimit = new GaugeRange(); newSensorLimit.StartValue = 8; newSensorLimit.EndValue = 10; newSensorLimit.Colour = Color.red; newValues.Add(newSensorLimit); _myGauge.GaugeRanges = newValues; _myGauge.ReSetGauge(); }
public void SetGaugeValuesTempSensor() { List <GaugeRange> newValues = new List <GaugeRange>(); GaugeRange newSensorLimit; //Range 1 newSensorLimit = new GaugeRange(); newSensorLimit.StartValue = 5; newSensorLimit.EndValue = 22; newSensorLimit.Colour = Color.red; newValues.Add(newSensorLimit); //Range 2 newSensorLimit = new GaugeRange(); newSensorLimit.StartValue = 22; newSensorLimit.EndValue = 23; newSensorLimit.Colour = Color.yellow; newValues.Add(newSensorLimit); //Range 3 newSensorLimit = new GaugeRange(); newSensorLimit.StartValue = 23; newSensorLimit.EndValue = 27; newSensorLimit.Colour = Color.green; newValues.Add(newSensorLimit); //Range 4 newSensorLimit = new GaugeRange(); newSensorLimit.StartValue = 27; newSensorLimit.EndValue = 28; newSensorLimit.Colour = Color.yellow; newValues.Add(newSensorLimit); //Range 5 newSensorLimit = new GaugeRange(); newSensorLimit.StartValue = 28; newSensorLimit.EndValue = 35; newSensorLimit.Colour = Color.red; newValues.Add(newSensorLimit); _myGauge.GaugeRanges = newValues; _myGauge.ReSetGauge(); }
/// <summary> /// Positions our gauge needle at the right location and colour the text based on the ranges we have /// </summary> /// <param name="flGaugeValue">The value to be displayed on the gauge</param> private void MoveNeedle(float flGaugeValue) { GaugeText.text = flGaugeValue.ToString(CultureInfo.CurrentCulture); //Get the range we are in out of our list of ranges var ourRange = GaugeRanges.FirstOrDefault(x => x.StartValue <= flGaugeValue && x.EndValue >= flGaugeValue); GaugeRange gaugeRange = ourRange; if (gaugeRange != null) { //If we are in a range, show that range's colour GaugeText.color = gaugeRange.Colour; } else { //If we are not in a range, default to white GaugeText.color = Color.white; } //calculate the gauge position based on our ranges configured for that gauge float gaugePosition = CalculateGaugeposition(GaugeValue, _scaleRange, GaugeMinRotation, GaugeMaxRotation); if (GaugeNeedle.transform.rotation != Quaternion.Euler(0f, 0f, gaugePosition)) { _needleInterpolation += Time.deltaTime * GaugeSpeed; Vector3 newRotation = new Vector3(); newRotation.x = 0f; newRotation.y = 0f; //newRotation.z = GaugeValue; newRotation.z = -Mathf.Lerp(GaugeNeedle.transform.rotation.z, gaugePosition, _needleInterpolation); GaugeNeedle.transform.rotation = Quaternion.Euler(newRotation); } else { _needleInterpolation = 0f; } }
private async void SetProgressBar(int totalTime) { try { Device.BeginInvokeOnMainThread(() => { progressBar.IsVisible = true; }); double countOfSteps = 20.0; int stepTime = (int)Math.Round(totalTime / countOfSteps, MidpointRounding.AwayFromZero); GaugeLinearAxis gaugeLinearAxis = new GaugeLinearAxis(); gaugeLinearAxis.Minimum = 0; gaugeLinearAxis.Maximum = totalTime; gaugeLinearAxis.Step = stepTime; this.progressBar.Axis = gaugeLinearAxis; GaugeRange progressBarRange = (GaugeRange)this.progressBar.Ranges.Ranges[0]; while (progressBarRange.To < totalTime) { progressBarRange.To += stepTime; await Task.Delay(stepTime * 1000); } await UserDialogs.Instance.AlertAsync("Synthesis completed"); //MessagingCenter.Send<SystemMonitorPage>(this, "TrayOut"); Device.BeginInvokeOnMainThread(() => { progressBarRange.To = 0; progressBar.IsVisible = false; }); } catch (Exception ex) { } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); LicenseManager.Key = License.Key; // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); // Get our linear gauge from the layout resource, XuniLinearGauge linearGauge = FindViewById<XuniLinearGauge>(Resource.Id.lineargauge); linearGauge.Direction = Com.GrapeCity.Xuni.Gauge.LinearGaugeDirection.Right; linearGauge.Min = 0; linearGauge.Max = 100; linearGauge.Value = 50; //linearGauge.Format = "C0"; linearGauge.ShowTextType = GaugeShowText.All; // add ranges to the linear gauge GaugeRange range1 = new GaugeRange(); range1.Min = 0; range1.Max = 30; range1.Color = Color.Maroon.ToArgb(); linearGauge.Ranges.Add(range1); GaugeRange range2 = new GaugeRange(); range2.Min = 30; range2.Max = 70; range2.Color = Color.OrangeRed.ToArgb(); linearGauge.Ranges.Add(range2); GaugeRange range3 = new GaugeRange(); range3.Min = 70; range3.Max = 100; range3.Color = Color.ForestGreen.ToArgb(); linearGauge.Ranges.Add(range3); linearGauge.ShowRanges = false; // bullet graph XuniBulletGraph bulletGraph = FindViewById<XuniBulletGraph>(Resource.Id.bulletgraph); bulletGraph.Pointer.Width = 0.5f; bulletGraph.Min = 0; bulletGraph.Max = 100; bulletGraph.Value = 50; bulletGraph.Target = 80; bulletGraph.Good = 75; bulletGraph.Bad = 40; bulletGraph.Format = "C0"; bulletGraph.ShowTextType = Com.GrapeCity.Xuni.Gauge.GaugeShowText.Value; bulletGraph.ValueChanged += bulletGraph_ValueChanged; // radial gauge XuniRadialGauge radialGauge = FindViewById<XuniRadialGauge>(Resource.Id.radialgauge); radialGauge.Min = 0; radialGauge.Max = 1; radialGauge.Value = .75; radialGauge.Format = "P0"; radialGauge.Pointer.Width = 0.5f; radialGauge.StartAngle = -15; radialGauge.SweepAngle = 210; radialGauge.ShowTextType = Com.GrapeCity.Xuni.Gauge.GaugeShowText.All; radialGauge.Face.Width = 0.8f; GaugeRange radialRange1 = new GaugeRange(); radialRange1.Min = 0; radialRange1.Max = .35; radialRange1.Color = Color.OrangeRed.ToArgb(); radialGauge.Ranges.Add(radialRange1); }
private void CopyRange(GaugeRange range) { if (_AddButton != null) { _AddButton.PerformClick(); GaugeRangeCollection rc = range.Scale.Ranges; GaugeRange clone = rc[rc.Count - 1]; range.CopyToItem(clone); } }
internal void OnPostRenderScaleRange(PaintEventArgs e, GaugeRange range) { if (PostRenderScaleRange != null) { PostRenderScaleRangeEventArgs args = new PostRenderScaleRangeEventArgs(e.Graphics, range); PostRenderScaleRange(this, args); } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); LicenseManager.Key = License.Key; // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); // Get our linear gauge from the layout resource, XuniLinearGauge linearGauge = FindViewById <XuniLinearGauge>(Resource.Id.lineargauge); linearGauge.Direction = Com.GrapeCity.Xuni.Gauge.LinearGaugeDirection.Right; linearGauge.Min = 0; linearGauge.Max = 100; linearGauge.Value = 50; //linearGauge.Format = "C0"; linearGauge.ShowTextType = GaugeShowText.All; // add ranges to the linear gauge GaugeRange range1 = new GaugeRange(); range1.Min = 0; range1.Max = 30; range1.Color = Color.Maroon.ToArgb(); linearGauge.Ranges.Add(range1); GaugeRange range2 = new GaugeRange(); range2.Min = 30; range2.Max = 70; range2.Color = Color.OrangeRed.ToArgb(); linearGauge.Ranges.Add(range2); GaugeRange range3 = new GaugeRange(); range3.Min = 70; range3.Max = 100; range3.Color = Color.ForestGreen.ToArgb(); linearGauge.Ranges.Add(range3); linearGauge.ShowRanges = false; // bullet graph XuniBulletGraph bulletGraph = FindViewById <XuniBulletGraph>(Resource.Id.bulletgraph); bulletGraph.Pointer.Width = 0.5f; bulletGraph.Min = 0; bulletGraph.Max = 100; bulletGraph.Value = 50; bulletGraph.Target = 80; bulletGraph.Good = 75; bulletGraph.Bad = 40; bulletGraph.Format = "C0"; bulletGraph.ShowTextType = Com.GrapeCity.Xuni.Gauge.GaugeShowText.Value; bulletGraph.ValueChanged += bulletGraph_ValueChanged; // radial gauge XuniRadialGauge radialGauge = FindViewById <XuniRadialGauge>(Resource.Id.radialgauge); radialGauge.Min = 0; radialGauge.Max = 1; radialGauge.Value = .75; radialGauge.Format = "P0"; radialGauge.Pointer.Width = 0.5f; radialGauge.StartAngle = -15; radialGauge.SweepAngle = 210; radialGauge.ShowTextType = Com.GrapeCity.Xuni.Gauge.GaugeShowText.All; radialGauge.Face.Width = 0.8f; GaugeRange radialRange1 = new GaugeRange(); radialRange1.Min = 0; radialRange1.Max = .35; radialRange1.Color = Color.OrangeRed.ToArgb(); radialGauge.Ranges.Add(radialRange1); }
internal void OnRangeExit(GaugePointer pointer, GaugeRange range) { if (RangeLeave != null) RangeLeave(this, new RangeLeaveEventArgs(pointer, range)); }
internal void OnRangeEnter(GaugePointer pointer, GaugeRange range) { if (RangeEnter != null) RangeEnter(this, new RangeEnterEventArgs(pointer, range)); }
public PostRenderScaleRangeEventArgs(Graphics graphics, GaugeRange range) { _Graphics = graphics; _Range = range; _Bounds = range.Bounds; _StartAngle = range.StartAngle; _SweepAngle = range.SweepAngle; }
public void Letra_Cargar() { if (Session["Usuario"] == null) { ScriptManager.RegisterStartupScript(Page, this.GetType(), "mykey", "CancelEdit();", true); } else { LetrasEmitidasWCFClient objLetrasWCF = new LetrasEmitidasWCFClient(); try { List <USP_SEL_Porcentaje_Avance_Letras_ZonasResult> listLetras = objLetrasWCF.Porcentaje_Avance_Letras_Lista_x_Zonas(((Usuario_LoginResult)Session["Usuario"]).idEmpresa, ((Usuario_LoginResult)Session["Usuario"]).codigoUsuario).ToList(); grdLetra.DataSource = listLetras; grdLetra.DataBind(); Session["LstLetras"] = JsonHelper.JsonSerializer(listLetras); List <USP_SEL_Porcentaje_Avance_LetrasResult> listLetras_total = objLetrasWCF.Porcentaje_Avance_Letras_Lista(((Usuario_LoginResult)Session["Usuario"]).idEmpresa, ((Usuario_LoginResult)Session["Usuario"]).codigoUsuario).ToList(); Label1.Text = "Total Porcentaje Letras Electronicas " + listLetras_total[0].PORCENTAJE.ToString() + "%"; Label3.Text = "Total Porcentaje Letras Manuales " + listLetras_total[0].PORCENTAJE_MANUAL.ToString() + "%"; Label1.Font.Size = 12; Label3.Font.Size = 12; //Create new RadialGauge object RadRadialGauge radialGauge = new RadRadialGauge(); radialGauge.ID = "radialGauge2"; radialGauge.Width = 350; radialGauge.Height = 350; //Set Pointer properties radialGauge.Pointer.Value = Convert.ToDecimal(listLetras_total[0].PORCENTAJE.ToString()); radialGauge.Pointer.Cap.Size = (float)0.10; //Set Min and Max values of the Scale radialGauge.Scale.Min = 0; //In order the Max value to be displayed it should be multiple of the MajorUnit radialGauge.Scale.Max = 100; radialGauge.Scale.MajorUnit = 20; //Set Scale Labels properties radialGauge.Scale.Labels.Visible = true; radialGauge.Scale.Labels.Font = "15px Arial,Helvetica,sans-serif"; radialGauge.Scale.Labels.Color = System.Drawing.Color.Black; radialGauge.Scale.Labels.Format = "{0} %"; radialGauge.Scale.Labels.Position = Telerik.Web.UI.Gauge.ScaleLabelsPosition.Outside; //Create new GaugeRange object GaugeRange gr1 = new GaugeRange(); //Set the properties of the new object gr1.From = 20; gr1.To = 40; gr1.Color = System.Drawing.Color.FromArgb(141, 203, 42); GaugeRange gr2 = new GaugeRange(); gr2.From = 40; gr2.To = 60; gr2.Color = System.Drawing.Color.FromArgb(255, 199, 0); GaugeRange gr3 = new GaugeRange(); gr3.From = 60; gr3.To = 80; gr3.Color = System.Drawing.Color.FromArgb(255, 117, 26); GaugeRange gr4 = new GaugeRange(); gr4.From = 80; gr4.To = 100; gr4.Color = System.Drawing.Color.FromArgb(230, 46, 0); radialGauge.Scale.Ranges.Add(gr1); radialGauge.Scale.Ranges.Add(gr2); radialGauge.Scale.Ranges.Add(gr3); radialGauge.Scale.Ranges.Add(gr4); //RadAug_02.Controls.Add(radialGauge); //Panel1.Controls.Add(radialGauge); //Create new RadialGauge object RadRadialGauge radialGauge2 = new RadRadialGauge(); radialGauge2.ID = "radialGauge22"; radialGauge2.Width = 350; radialGauge2.Height = 350; //Set Pointer properties radialGauge2.Pointer.Value = Convert.ToDecimal(listLetras_total[0].PORCENTAJE_MANUAL.ToString()); radialGauge2.Pointer.Cap.Size = (float)0.10; //Set Min and Max values of the Scale radialGauge2.Scale.Min = 0; //In order the Max value to be displayed it should be multiple of the MajorUnit radialGauge2.Scale.Max = 100; radialGauge2.Scale.MajorUnit = 20; //Set Scale Labels properties radialGauge2.Scale.Labels.Visible = true; radialGauge2.Scale.Labels.Font = "15px Arial,Helvetica,sans-serif"; radialGauge2.Scale.Labels.Color = System.Drawing.Color.Black; radialGauge2.Scale.Labels.Format = "{0} %"; radialGauge2.Scale.Labels.Position = Telerik.Web.UI.Gauge.ScaleLabelsPosition.Outside; radialGauge2.Scale.Ranges.Add(gr1); radialGauge2.Scale.Ranges.Add(gr2); radialGauge2.Scale.Ranges.Add(gr3); radialGauge2.Scale.Ranges.Add(gr4); RadAug_02.Controls.Add(radialGauge); Panel1.Controls.Add(radialGauge2); } catch (Exception ex) { throw ex; } } }
public RangeLeaveEventArgs(GaugePointer pointer, GaugeRange range) : base(pointer, range) { }
public RangeEnterEventArgs(GaugePointer pointer, GaugeRange range) { _Pointer = pointer; _Range = range; }
internal bool OnPreRenderScaleRange(PaintEventArgs e, GaugeRange range) { if (PreRenderScaleRange != null) { PreRenderScaleRangeEventArgs args = new PreRenderScaleRangeEventArgs(e.Graphics, range); PreRenderScaleRange(this, args); if (args.Cancel == true) return (true); } return (false); }
private void SetCBottomMeterDesignTimeDefaults() { _GaugeControl.Frame.Style = GaugeFrameStyle.Rectangular; _GaugeControl.Frame.BackColor = new GradientFillColor(Color.Gainsboro, Color.DarkGray); _GaugeControl.Frame.FrameColor = new GradientFillColor(Color.White, Color.DimGray); _GaugeControl.Frame.FrameColor.BorderColor = Color.Gainsboro; _GaugeControl.Frame.FrameColor.BorderWidth = 1; _GaugeControl.Size = new Size(_GaugeControl.Size.Width, _GaugeControl.Size.Width / 3); GaugeCircularScale scale = new GaugeCircularScale(_GaugeControl); scale.Name = "Scale1"; scale.Radius = 2.5F; scale.StartAngle = 240F; scale.SweepAngle = 60F; scale.Width = 0.011F; scale.MajorTickMarks.Interval = 50; scale.MajorTickMarks.Layout.Length = 0.063F; scale.MajorTickMarks.Layout.Width = 0.033F; scale.MaxPin.EndOffset = 0.01F; scale.MaxPin.Length = 0.026F; scale.MaxPin.ScaleOffset = -0.06F; scale.MaxPin.Width = 0.026F; GradientFillColor fillColor = new GradientFillColor(Color.LightYellow); fillColor.BorderColor = Color.DimGray; fillColor.BorderWidth = 1; scale.MinorTickMarks.Interval = 10; scale.MinorTickMarks.Layout.FillColor = fillColor; scale.MinorTickMarks.Layout.Length = 0.042F; scale.MinorTickMarks.Layout.Width = 0.013F; scale.MinPin.EndOffset = 0.01F; scale.MinPin.Length = 0.026F; scale.MinPin.ScaleOffset = -0.06F; scale.MinPin.Width = 0.026F; scale.PivotPoint = new PointF(.5f, 2.7f); scale.Labels.Layout.Font = new Font("Microsoft Sans Serif", 4F); scale.Labels.Layout.ScaleOffset = 0.075F; GaugeRange range = new GaugeRange(scale); range.Name = "Range1"; range.ScaleOffset = 0.033F; range.StartValue = 0; range.StartWidth = 0.07F; range.EndValue = 100; range.EndWidth = 0.07F; range.FillColor.BorderColor = Color.Gray; range.FillColor.BorderWidth = 1; range.FillColor.Color1 = Color.Yellow; range.FillColor.Color2 = Color.Lime; scale.Ranges.Add(range); GaugePointer pointer = new GaugePointer(scale); pointer.Name = "Pointer1"; pointer.Style = PointerStyle.Needle; pointer.ScaleOffset = -0.057F; pointer.Width = 0.032F; pointer.CapFillColor.BorderColor = Color.DimGray; pointer.CapFillColor.BorderWidth = 1; pointer.CapFillColor.Color1 = Color.Gainsboro; pointer.CapFillColor.Color2 = Color.Silver; pointer.FillColor.BorderColor = Color.DimGray; pointer.FillColor.BorderWidth = 1; pointer.FillColor.Color1 = Color.Black; scale.Pointers.Add(pointer); _GaugeControl.CircularScales.Add(scale); }
private void SetCircularDesignTimeDefaults() { _GaugeControl.Frame.Style = GaugeFrameStyle.Circular; SetBaseGuageColor(); GaugeCircularScale scale = new GaugeCircularScale(_GaugeControl); scale.Name = "Scale1"; scale.Radius = .38f; _GaugeControl.CircularScales.Add(scale); GaugeSection section = new GaugeSection(scale); section.Name = "Section1"; section.FillColor = new GradientFillColor(Color.CornflowerBlue, Color.Purple); scale.Sections.Add(section); GaugeRange range = new GaugeRange(scale); range.Name = "Range1"; range.FillColor = new GradientFillColor(Color.Lime, Color.Red); range.FillColor.BorderColor = Color.DimGray; range.FillColor.BorderWidth = 1; range.ScaleOffset = .28f; range.StartValue = 70; scale.Ranges.Add(range); GaugePointer pointer = new GaugePointer(scale); pointer.Name = "Pointer1"; pointer.Style = PointerStyle.Needle; pointer.Length = 0.358F; pointer.FillColor = new GradientFillColor(Color.WhiteSmoke, Color.Red); pointer.FillColor.BorderColor = Color.DimGray; pointer.FillColor.BorderWidth = 1; pointer.CapFillColor = new GradientFillColor(Color.WhiteSmoke, Color.DimGray, 90); pointer.CapFillColor.BorderColor = Color.DimGray; pointer.CapFillColor.BorderWidth = 1; scale.Pointers.Add(pointer); }
private void InitializeNewRange(GaugeRange range) { range.EndValue = range.Scale.MaxValue; range.StartValue = range.EndValue - range.Scale.MajorTickMarks.Interval * 3; range.Name = GetRangeName(range.Scale); range.FillColor = new GradientFillColor(Color.Lime, Color.Red); range.FillColor.BorderColor = Color.Black; range.FillColor.BorderWidth = 1; }
public PreRenderScaleRangeEventArgs(Graphics graphics, GaugeRange range) : base(graphics, range) { }
/// <summary> /// Tratamiento de fechas para visualizar la semaforización de estados de control de enfemería /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void radGridPaciente_ItemDataBound(object sender, GridItemEventArgs e) { try { if (e.Item is GridDataItem) { DateTime fechaControl; GridDataItem item = (GridDataItem)e.Item; TableCell celdaFechaControl = item["UltimoControl"]; TableCell celdaTipoControl = item["TipoControl"]; TableCell celdaRegistroControl = item["RegistroControl"]; celdaFechaControl.Font.Size = 10; celdaFechaControl.Font.Bold = true; ImageButton btnBuscar = (ImageButton)item["btnBuscar"].Controls[0]; btnBuscar.ToolTip = "Consultar paciente"; ImageButton btn360 = (ImageButton)item["btn360"].Controls[0]; btn360.ToolTip = "Vista 360"; if (!item["UltimoControl"].Text.Equals("01/01/1900")) { fechaControl = DateTime.ParseExact(item["UltimoControl"].Text, "dd/MM/yyyy", CultureInfo.InvariantCulture); string fecha1 = fechaControl.ToString("dd/MM/yyyy"); string fecha2 = DateTime.Now.ToString("dd/MM/yyyy"); string fecha3 = item["RegistroControl"].Text; DateTime fechaSinDia = fechaControl.AddDays(-1); string fecha4 = fechaSinDia.ToString("dd/MM/yyyy"); if (fechaControl > DateTime.Now && fecha3.Equals("01/01/1900") && (fechaControl - DateTime.Now).TotalDays > 1) { celdaFechaControl.ForeColor = System.Drawing.Color.Red; } else if (fechaControl < DateTime.Now && fecha3.Equals("01/01/1900")) { celdaFechaControl.ForeColor = System.Drawing.Color.Red; } else if (fecha4.Equals(fecha2) && fecha3.Equals("01/01/1900")) { celdaFechaControl.ForeColor = System.Drawing.ColorTranslator.FromHtml("#9F9110"); } else if (fechaControl < DateTime.Now && !fecha3.Equals("01/01/1900")) { celdaFechaControl.ForeColor = System.Drawing.Color.Green; } else if (!fecha3.Equals("01/01/1900")) { celdaFechaControl.ForeColor = System.Drawing.Color.Green; } } if (item["UltimoControl"].Text.Equals("01/01/1900")) { item["UltimoControl"].Text = "Sin registro"; } if (item["RegistroControl"].Text.Equals("01/01/1900")) { item["RegistroControl"].Text = "Sin registro"; } } if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem) { //Grafica riesgo GridDataItem item2 = e.Item as GridDataItem; int riesgo = Convert.ToInt16(item2.GetDataKeyValue("riesgo")); RadRadialGauge RadRadialGaugeRiesgo = (RadRadialGauge)item2.FindControl("RadRadialGaugeRiesgo"); if (riesgo == 1) { RadRadialGaugeRiesgo.Pointer.Value = Convert.ToDecimal(2.5); } else if (riesgo == 2) { RadRadialGaugeRiesgo.Pointer.Value = Convert.ToDecimal(1.5); } else if (riesgo == 3) { RadRadialGaugeRiesgo.Pointer.Value = Convert.ToDecimal(0.5); } RadRadialGaugeRiesgo.Pointer.Color = System.Drawing.Color.Blue; RadRadialGaugeRiesgo.Scale.Min = 0; RadRadialGaugeRiesgo.Scale.Max = (decimal)3; RadRadialGaugeRiesgo.Scale.MinorUnit = (decimal)0; RadRadialGaugeRiesgo.Scale.MajorUnit = (decimal)1; RadRadialGaugeRiesgo.Scale.MinorTicks.Visible = false; RadRadialGaugeRiesgo.Scale.MajorTicks.Size = 10; RadRadialGaugeRiesgo.Scale.Labels.Visible = false; RadRadialGaugeRiesgo.Scale.Labels.Font = "10px Arial,Helvetica,sans-serif"; RadRadialGaugeRiesgo.Scale.Labels.Color = System.Drawing.Color.Black; RadRadialGaugeRiesgo.Scale.Labels.Format = "{0}"; RadRadialGaugeRiesgo.Scale.Labels.Position = Telerik.Web.UI.Gauge.ScaleLabelsPosition.Outside; GaugeRange gr1 = new GaugeRange(); gr1.From = 0; gr1.To = (decimal)1; gr1.Color = System.Drawing.Color.Green; GaugeRange gr2 = new GaugeRange(); gr2.From = (decimal)1.1; gr2.To = (decimal)2; gr2.Color = System.Drawing.Color.Yellow; GaugeRange gr3 = new GaugeRange(); gr3.From = (decimal)2.1; gr3.To = (decimal)3; gr3.Color = System.Drawing.Color.FromArgb(225, 0, 0); RadRadialGaugeRiesgo.Scale.Ranges.Add(gr1); RadRadialGaugeRiesgo.Scale.Ranges.Add(gr2); RadRadialGaugeRiesgo.Scale.Ranges.Add(gr3); //Grafica glucometria RadRadialGauge RadLinealGaugeGlucometria = (RadRadialGauge)item2.FindControl("RadLinealGaugeGlucometria"); decimal Glucosa = Convert.ToDecimal(item2.GetDataKeyValue("Glucosa")); decimal limiteSuperiorGlucosa = Convert.ToInt16(item2.GetDataKeyValue("limiteSuperiorGlucosa")); decimal limiteInferiorGlucosa = Convert.ToInt16(item2.GetDataKeyValue("limiteInferiorGlucosa")); RadLinealGaugeGlucometria.Pointer.Value = Glucosa; RadLinealGaugeGlucometria.Pointer.Color = System.Drawing.Color.Blue; RadLinealGaugeGlucometria.Pointer.Cap.Size = (float)0.1; RadLinealGaugeGlucometria.Scale.Min = 0; RadLinealGaugeGlucometria.Scale.Max = limiteSuperiorGlucosa + 20; RadLinealGaugeGlucometria.Scale.MinorUnit = (decimal)1; RadLinealGaugeGlucometria.Scale.MajorUnit = 30; RadLinealGaugeGlucometria.Scale.MinorTicks.Visible = true; RadLinealGaugeGlucometria.Scale.MajorTicks.Size = 1; RadLinealGaugeGlucometria.Scale.Labels.Visible = false; RadLinealGaugeGlucometria.Scale.Labels.Font = "8px Arial,Helvetica,sans-serif"; RadLinealGaugeGlucometria.Scale.Labels.Color = System.Drawing.Color.Black; RadLinealGaugeGlucometria.Scale.Labels.Format = "{0}"; RadLinealGaugeGlucometria.Scale.Labels.Position = Telerik.Web.UI.Gauge.ScaleLabelsPosition.Outside; GaugeRange Glucosagr1 = new GaugeRange(); Glucosagr1.From = 0; Glucosagr1.To = limiteInferiorGlucosa; Glucosagr1.Color = System.Drawing.Color.Red; GaugeRange Glucosagr2 = new GaugeRange(); Glucosagr2.From = (decimal)limiteInferiorGlucosa + Convert.ToDecimal(0.1); Glucosagr2.To = (decimal)limiteSuperiorGlucosa - Convert.ToDecimal(0.1); Glucosagr2.Color = System.Drawing.Color.Green; GaugeRange Glucosagr3 = new GaugeRange(); Glucosagr3.From = (decimal)limiteSuperiorGlucosa; Glucosagr3.To = (decimal)limiteSuperiorGlucosa + Convert.ToDecimal(50); Glucosagr3.Color = System.Drawing.Color.Red; RadLinealGaugeGlucometria.Scale.Ranges.Add(Glucosagr1); RadLinealGaugeGlucometria.Scale.Ranges.Add(Glucosagr2); RadLinealGaugeGlucometria.Scale.Ranges.Add(Glucosagr3); //Grafica tension RadRadialGauge radialGauge = (RadRadialGauge)item2.FindControl("RadRadialGaugeTension"); decimal Sistolica = Convert.ToDecimal(item2.GetDataKeyValue("Sistolica")); //decimal Diastolica = Convert.ToDecimal(item2.GetDataKeyValue("Diastolica")); decimal limiteSuperiorSistolica = Convert.ToInt16(item2.GetDataKeyValue("limiteSuperiorSistolica")); decimal limiteInferiorSistolica = Convert.ToInt16(item2.GetDataKeyValue("limiteInferiorSistolica")); radialGauge.Pointer.Value = Sistolica; radialGauge.Pointer.Color = System.Drawing.Color.Blue; radialGauge.Pointer.Cap.Size = (float)0.1; radialGauge.Scale.Min = 0; radialGauge.Scale.Max = limiteSuperiorSistolica + 20; radialGauge.Scale.MinorUnit = (decimal)1; radialGauge.Scale.MajorUnit = 30; radialGauge.Scale.MinorTicks.Visible = false; radialGauge.Scale.MajorTicks.Size = 1; radialGauge.Scale.Labels.Visible = false; radialGauge.Scale.Labels.Font = "8px Arial,Helvetica,sans-serif"; radialGauge.Scale.Labels.Color = System.Drawing.Color.Black; radialGauge.Scale.Labels.Format = "{0}"; radialGauge.Scale.Labels.Position = Telerik.Web.UI.Gauge.ScaleLabelsPosition.Outside; GaugeRange Sistolicagr1 = new GaugeRange(); Sistolicagr1.From = 0; Sistolicagr1.To = limiteInferiorSistolica; Sistolicagr1.Color = System.Drawing.Color.Red; GaugeRange Sistolicagr2 = new GaugeRange(); Sistolicagr2.From = (decimal)limiteInferiorSistolica + Convert.ToDecimal(0.1); Sistolicagr2.To = (decimal)limiteSuperiorSistolica - Convert.ToDecimal(0.1); Sistolicagr2.Color = System.Drawing.Color.Green; GaugeRange Sistolicagr3 = new GaugeRange(); Sistolicagr3.From = (decimal)limiteSuperiorSistolica; Sistolicagr3.To = (decimal)limiteSuperiorSistolica + Convert.ToDecimal(50); Sistolicagr3.Color = System.Drawing.Color.Red; radialGauge.Scale.Ranges.Add(Sistolicagr1); radialGauge.Scale.Ranges.Add(Sistolicagr2); radialGauge.Scale.Ranges.Add(Sistolicagr3); //Tension diastólica RadRadialGauge RadRadialGaugeTensionDiastolica = (RadRadialGauge)item2.FindControl("RadRadialGaugeTensionDiastolica"); decimal Diastolica = Convert.ToDecimal(item2.GetDataKeyValue("Diastolica")); decimal limiteSuperiorDiastolica = Convert.ToInt16(item2.GetDataKeyValue("limiteSuperiorDiastolica")); decimal limiteInferiorDiastolica = Convert.ToInt16(item2.GetDataKeyValue("limiteInferiorDiastolica")); RadRadialGaugeTensionDiastolica.Pointer.Value = Diastolica; RadRadialGaugeTensionDiastolica.Pointer.Color = System.Drawing.Color.Blue; RadRadialGaugeTensionDiastolica.Pointer.Cap.Size = (float)0.1; RadRadialGaugeTensionDiastolica.Scale.Min = 0; RadRadialGaugeTensionDiastolica.Scale.Max = limiteSuperiorDiastolica + 20; RadRadialGaugeTensionDiastolica.Scale.MinorUnit = (decimal)1; RadRadialGaugeTensionDiastolica.Scale.MajorUnit = 30; RadRadialGaugeTensionDiastolica.Scale.MinorTicks.Visible = false; RadRadialGaugeTensionDiastolica.Scale.MajorTicks.Size = 1; RadRadialGaugeTensionDiastolica.Scale.Labels.Visible = false; RadRadialGaugeTensionDiastolica.Scale.Labels.Font = "8px Arial,Helvetica,sans-serif"; RadRadialGaugeTensionDiastolica.Scale.Labels.Color = System.Drawing.Color.Black; RadRadialGaugeTensionDiastolica.Scale.Labels.Format = "{0}"; RadRadialGaugeTensionDiastolica.Scale.Labels.Position = Telerik.Web.UI.Gauge.ScaleLabelsPosition.Outside; GaugeRange Diastolicagr1 = new GaugeRange(); Diastolicagr1.From = 0; Diastolicagr1.To = limiteInferiorDiastolica; Diastolicagr1.Color = System.Drawing.Color.Red; GaugeRange Diastolicagr2 = new GaugeRange(); Diastolicagr2.From = (decimal)limiteInferiorDiastolica + Convert.ToDecimal(0.1); Diastolicagr2.To = (decimal)limiteSuperiorDiastolica - Convert.ToDecimal(0.1); Diastolicagr2.Color = System.Drawing.Color.Green; GaugeRange Diastolicagr3 = new GaugeRange(); Diastolicagr3.From = (decimal)limiteSuperiorDiastolica; Diastolicagr3.To = (decimal)limiteSuperiorDiastolica + Convert.ToDecimal(50); Diastolicagr3.Color = System.Drawing.Color.Red; RadRadialGaugeTensionDiastolica.Scale.Ranges.Add(Diastolicagr1); RadRadialGaugeTensionDiastolica.Scale.Ranges.Add(Diastolicagr2); RadRadialGaugeTensionDiastolica.Scale.Ranges.Add(Diastolicagr3); } } catch (Exception ex) { RadNotificationMensajes.Show(ex.Message); } }
public ValueInRangeChangedEventArgs(GaugeRange range, Single value, bool inRange) { Range = range; Value = value; InRange = inRange; }