Gauge datasource from text (txt) file

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
phil1995
Newbie
Newbie
Posts: 31
Joined: Fri Dec 16, 2005 12:00 am
Location: Hattiesburg, Ms.
Contact:

Gauge datasource from text (txt) file

Post by phil1995 » Thu Sep 15, 2011 4:52 pm

I am attempting to use the graphical interface to set a gauge to use a text file as the datasource.

I set the source to text file, selected my text file, set the corresponding column numbers to the Text,Y,Angle fields.

No matter what I do, I can not get the gauge to read the file. Is there a bit of code I need to add in conjunction with the settings in the GUI?

My text file is simply 0 25 delimited by a tab. Is this the correct format? I set the Angle value to 1, and the Y value to 2.

How can I get this gauge to register the value.

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

Re: Gauge datasource from text (txt) file

Post by Sandra » Fri Sep 16, 2011 2:03 pm

Hello phil1995,

I can achieve to load data in the Gauge Series with TextField in design time and run time and I recommend follow next steps to achieve the same results:

Design time:

1.- Add Series (Gauges) in the Chart.
2.- Go to Tab Series\DataSource and Select TextField
3.- Select text file are you want load.
4.- Add in Y value 0
5.- Click apply.

Run Time:

And also I think would be interesting for you, take a look in next code, where the data are load from TextFile:

Code: Select all

 private void InitializeChart()
        {
            
            Steema.TeeChart.Styles.CircularGauge Series1 = new  CircularGauge(tChart1.Chart);
            Steema.TeeChart.Data.TextSource ts = new Steema.TeeChart.Data.TextSource(@"C:\tmp\Gauge.txt");
            ts.HeaderLines = 0;
            ts.Separator = ',';
            ts.Fields.Add(0, "Y");
            Series1.DataSource = ts;
        }
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

Post Reply