0

Specifically, I am trying to build the image on this image1

I am programming in C # .NET and design a graphic in Adobe XD and I can not pass the same to visual studio, keeping the style. Use nuget LiveCharts in WinForm (https://lvcharts.net/App/examples/v1/wf/Solid%20Gauge). Try to generate the graphic similar to the design made in Adobe but I do not get it (second image). I need someone to guide me to make the same graphic corresponding to the first image.

I have problems to assemble the graphic of image 1; change the color of the digits where the current value is displayed, tick etc.

image3

I take this opportunity to consult, once I have debugged and loaded the .dll, the "black" image is displayed as seen in the image. It's my first project with C #. This component is then charged from WinCC, which is a SCADA software and it is shown with a black background and if I change the value it shows the bar but the background remains black (image 4 and 5).

image4

image5

image6

using System;
using System.ComponentModel;
using System.Windows;
using System.Windows.Forms;
using System.Windows.Media;

namespace temperaturaRodamientos
{
public partial class UserControl1: UserControl
{
//[Description("evento")]
private double _valor = -10.0;
public double valorNormal = 55.0;
public double valorPrecaucion = 80.0;
public double valorPeligro = 90.0;
public double valorMaximoSensor = 127.0;

[Description("Valor actual temperatura"), Category("Data")]
public double valor{
get { return _valor; } 
set
{
_valor = value;
solidGauge2.Value = _valor;
solidGauge2.BackColorTransparent = true;

if (_valor<=valorNormal) //verde
{ 
solidGauge2.ToColor = Color.FromRgb(11, 211, 1);
solidGauge2.FromColor = Color.FromRgb(11, 211, 1);
} else if (_valor >= valorNormal && _valor <= valorPeligro) //amarillo
{ 
solidGauge2.ToColor = Color.FromRgb(255, 250, 101);
solidGauge2.FromColor = Color.FromRgb(255, 250, 101);
}
else //rojo
{

solidGauge2.ToColor = Color.FromRgb(252, 141, 141);
solidGauge2.FromColor = Color.FromRgb(252, 141, 141);
} //fin if-else                
} //fin set
}

public UserControl1(){
InitializeComponent();
solidGauge2.Value = valor;
solidGauge2.From = valor;            
solidGauge2.To = valorMaximoSensor;
solidGauge2.Base.LabelsVisibility = Visibility.Hidden; //no muestra los valores min/max
solidGauge2.ToColor = Color.FromRgb(11, 211, 1);
solidGauge2.FromColor = Color.FromRgb(11, 211, 1);           

} //fin contructor


} //fin clase

} //fin proyecto
Stefan
  • 17,448
  • 11
  • 60
  • 79
  • 1
    `System.Windows.Forms` is WinForms but `System.Windows` is WPF. What kind of control are you trying to develop here? Please tag the question with the correct GUI platform you are targeting. – Richard Jul 07 '19 at 06:47
  • I want to develop a usercontrol for WinCC, it is a scada software from siemens. The controller I did in visual studio 2019. – Rafael Riesgo Jul 07 '19 at 14:09
  • Did you have any success so far? We have tried to import LiveChart into our WPF WinCC but it just made the graphic designer throw errors and make it unable to save the views. – Karol Haliński Feb 20 '20 at 09:41

0 Answers0