Numeric gauge size
Posted: Mon Nov 15, 2010 2:23 pm
hi,
Is there a method to resize a numeric gauge ( width,length)?
thank
Is there a method to resize a numeric gauge ( width,length)?
thank
Steema Software - Customer Support Forums
http://teechart.com/support/
Code: Select all
private void InitializeChart()
{
tChart1.Series.Clear();
tChart1.Tools.Clear();
Steema.TeeChart.Styles.NumericGauge series0 = new Steema.TeeChart.Styles.NumericGauge(tChart1.Chart);
series0.FillSampleValues();
}
Code: Select all
private void button1_Click(object sender, EventArgs e)
{
InitializeChart();
Rectangle tmpR;
tmpR = (tChart1[0] as Steema.TeeChart.Styles.NumericGauge).CustomBounds;
tmpR.Height = 200;
tmpR.Width = 300;
(tChart1[0] as Steema.TeeChart.Styles.NumericGauge).CustomBounds = tmpR;
}
Code: Select all
private void button2_Click(object sender, EventArgs e)
{
tChart1.Series.Clear();
tChart1.Tools.Clear();
Steema.TeeChart.Styles.NumericGauge series1 = new Steema.TeeChart.Styles.NumericGauge(tChart1.Chart);
Steema.TeeChart.Styles.NumericGauge series2 = new Steema.TeeChart.Styles.NumericGauge(tChart1.Chart);
Steema.TeeChart.Styles.NumericGauge series3 = new Steema.TeeChart.Styles.NumericGauge(tChart1.Chart);
Steema.TeeChart.Styles.NumericGauge series4 = new Steema.TeeChart.Styles.NumericGauge(tChart1.Chart);
series1.FillSampleValues();
series2.FillSampleValues();
series3.FillSampleValues();
series4.FillSampleValues();
series1.BeforeDrawValues = new Steema.TeeChart.PaintChartEventHandler(series1_BeforeDrawValues);
series2.BeforeDrawValues = new Steema.TeeChart.PaintChartEventHandler(series2_BeforeDrawValues);
series3.BeforeDrawValues = new Steema.TeeChart.PaintChartEventHandler(series3_BeforeDrawValues);
series4.BeforeDrawValues = new Steema.TeeChart.PaintChartEventHandler(series4_BeforeDrawValues);
}
void series4_BeforeDrawValues(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
//You can change the Height and width of ChartRect.
this.tChart1.Chart.ChartRect = new Rectangle(this.tChart1.Width / 2, this.tChart1.Height / 2, this.tChart1.Width / 2, this.tChart1.Height / 2);
}
void series3_BeforeDrawValues(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
//You can change the Height and Width of ChartRect.
this.tChart1.Chart.ChartRect = new Rectangle(15, this.tChart1.Height / 2, this.tChart1.Width / 2 , this.tChart1.Height / 2);
}
void series2_BeforeDrawValues(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
//You can change the Height and Width of ChartRect.
this.tChart1.Chart.ChartRect = new Rectangle(this.tChart1.Width / 2, 15, this.tChart1.Width / 2, this.tChart1.Height / 2);
}
void series1_BeforeDrawValues(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
//You can change the Height and Width of ChartRect.
this.tChart1.Chart.ChartRect = new Rectangle(15, 15, this.tChart1.Width / 2, this.tChart1.Height / 2);
}
Code: Select all
private void button3_Click(object sender, EventArgs e)
{
tChart1.Series.Clear();
//Created a SubChart
Steema.TeeChart.Tools.SubChartTool subChartTool1;
Steema.TeeChart.TChart chart;
tChart1.Tools.Add(subChartTool1 = new Steema.TeeChart.Tools.SubChartTool());
chart = subChartTool1.Charts.AddChart("Chart0");
//Add Series
Steema.TeeChart.Styles.NumericGauge series = new Steema.TeeChart.Styles.NumericGauge(chart.Chart);
//Change Size of subChart
chart.Width = 200;
chart.Height = 150;
chart.Draw();
}
Code: Select all
series0.Markers[0].Shape.Font.Size = 50;