Page 1 of 1

Numeric gauge size

Posted: Mon Nov 15, 2010 2:23 pm
by 16057371
hi,
Is there a method to resize a numeric gauge ( width,length)?

thank

Re: Numeric gauge size

Posted: Tue Nov 16, 2010 11:35 am
by 10050769
Hello micropross,

I suggest you three ways for change size of NumericGauge:
First: Using CustomBounds for change size of NumericGauges as do in next example:

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;
        }
Second: Using MultipleCharts and changing directly size of ChartRect of Chart. You can do something as next example:

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);
        }
Third:You can use SubChartTool with NumericGauges and change size of SubChartTool. You can do something as next example:

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();
        }
Could you tell us if previous codes works as you want?

I hope will helps.

Thanks,

Re: Numeric gauge size

Posted: Wed Nov 17, 2010 2:00 pm
by 16057371
hi,

i can't reduce characters height. it look limited

thanks

Re: Numeric gauge size

Posted: Thu Nov 18, 2010 10:29 am
by 10050769
Hello micropross,

You need use Markers of your NumericGauge. NumericGauge have to default 3 Markers, so if you want change size of text you must do something as line below:

Code: Select all

series0.Markers[0].Shape.Font.Size = 50;
Thanks,