Page 1 of 1

Gauge datasource from text (txt) file

Posted: Thu Sep 15, 2011 4:52 pm
by 9639571
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.

Re: Gauge datasource from text (txt) file

Posted: Fri Sep 16, 2011 2:03 pm
by 10050769
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,