Page 1 of 1
NumericGauge value position inside CircularGaguge
Posted: Tue Oct 29, 2013 2:49 pm
by 17265503
Hi!
How to center or move up/down value in NumericGauge inside Circular gauge?
It is always on top of numeric gauge frame. When size of gauge is small it overlaps frame.
Re: NumericGauge value position inside CircularGaguge
Posted: Wed Oct 30, 2013 1:10 pm
by 10050769
Hello Thomas,
To change the position of the LinearGauge of your circularGauge you must only set to false, the automatic position as do in next lines of code:
Code: Select all
Steema.TeeChart.TChart tChart1;
public Form1()
{
InitializeComponent();
tChart1 = new TChart();
this.Controls.Add(tChart1);
tChart1.Top = 150;
tChart1.Left = 100;
tChart1.Height = 400;
tChart1.Width = 550;
InitializeChart();
}
Rectangle tmpG;
private void InitializeChart()
{
Steema.TeeChart.Styles.CircularGauge circulargaugeL = new CircularGauge(tChart1.Chart);
circulargaugeL.NumericGauge.Visible = true;
circulargaugeL.Value = 30;
circulargaugeL.AutoValueNumericGauge = false;
circulargaugeL.NumericGauge.Value = 50;
tChart1.Draw();
//Custom postion of NumericGauge:
circulargaugeL.AutoPositionNumericGauge = false;
tmpG = circulargaugeL.NumericGauge.CustomBounds;
tmpG.X = 200;
tmpG.Y = 300;
circulargaugeL.NumericGauge.CustomBounds = tmpG;
}
void button1_Click(object sender, EventArgs e)
{
tChart1.ShowEditor();
}
Could you tell us if previous code works in your end?
I hope will helps.
Thanks,
Re: NumericGauge value position inside CircularGaguge
Posted: Fri Dec 20, 2013 1:35 pm
by 17265503
Thanks. It works. But i need something like gauge on image. Can you help?
I can't hide border of numeric gauge (circularGauge.NumericGauge.FaceBrush.Visible = false; not working),
can't change text color (circularGauge.NumericGauge.ValueMarker.Shape.Font.Color not working)
Thanks in advance.
Re: NumericGauge value position inside CircularGaguge
Posted: Fri Dec 20, 2013 6:46 pm
by Christopher
Hello,
I can't hide border of numeric gauge (circularGauge.NumericGauge.FaceBrush.Visible = false; not working)
This does work, but has to be used in conjunction with:
Code: Select all
series.NumericGauge.ValueMarker.Shape.Transparent = true;
can't change text color (circularGauge.NumericGauge.ValueMarker.Shape.Font.Color not working)
This also works, but has to be used in conjunction with:
Code: Select all
series.NumericGauge.ValueMarker.UsePalette = false;
If it is just text you want, maybe the easiest thing to do is this:
Code: Select all
Steema.TeeChart.Styles.CircularGauge series;
private void InitializeChart()
{
tChart1.AfterDraw += tChart_AfterDraw;
tChart1.Aspect.View3D = false;
series = new CircularGauge(tChart1.Chart);
series.FillSampleValues();
series.TotalAngle = 180;
}
private void tChart_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
g.Font.Color = Color.White;
g.Font.Size = 20;
g.TextOut(g.ChartXCenter - 25, g.ChartYCenter + 70, "303");
}