Numeric gauge size

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
micropross
Newbie
Newbie
Posts: 13
Joined: Mon Oct 04, 2010 12:00 am

Numeric gauge size

Post by micropross » Mon Nov 15, 2010 2:23 pm

hi,
Is there a method to resize a numeric gauge ( width,length)?

thank

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Numeric gauge size

Post by Sandra » Tue Nov 16, 2010 11:35 am

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,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

micropross
Newbie
Newbie
Posts: 13
Joined: Mon Oct 04, 2010 12:00 am

Re: Numeric gauge size

Post by micropross » Wed Nov 17, 2010 2:00 pm

hi,

i can't reduce characters height. it look limited

thanks

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Numeric gauge size

Post by Sandra » Thu Nov 18, 2010 10:29 am

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,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply