Hello
I'm exporting my data withe the method of TSeriesDataText. Follow my code:
PROCEDURE TfrmVis_Grafik.btnExportClick(Sender : TObject);
VAR
i : Integer;
SDT:TSeriesDataText;
BEGIN
IF (cbGrafik.Text <> '') THEN BEGIN
SaveDialog.FileName := CM.ExtractWord(1, cbGrafik.Text, [';'])+' '+FormatDateTime('yyyymmddhhnnss', Now);
IF SaveDialog.Execute THEN BEGIN
FOR i := 0 TO Chart .SeriesCount-1 DO BEGIN
IF Chart IS TLineSeries THEN BEGIN
Chart.Title := Titel[i+1];
END;
END;
Series11.ParentChart := NIL;
TRY
SDT:=TSeriesDataText.Create(Chart, NIL);
SDT.TextDelimiter := ';';
SDT.IncludeHeader := True;
SDT.SaveToFile(SaveDialog.FileName);
FINALLY
FreeAndNIL(SDT);
END;
Series11.ParentChart := Chart;
END;
END ELSE BEGIN
MessageDlg(SNoGraphicProfile, mtError, [mbOK], 0);
END;
END;
Everything are ok, but in my datas are some Values with "NULL" not "0"!! The Line are interrupted (see Snap4.jpg) correctly, but when i export the Lineseries, the "NULL" value are exportet with "0" (see Snap5.jpg), but i need a "blank" cell!!
May somebody can give me a hint, to solve my problem
Regards
Gregor
Problem Export with TSeriesDataText and NULL Values
Problem Export with TSeriesDataText and NULL Values
- Attachments
-
- snap.zip
- (371.76 KiB) Downloaded 636 times
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Problem Export with TSeriesDataText and NULL Values
Hi Gregor,
Zero is the default null value when no other value is provided. You can change that using TChartSeries.DefaultNullValue property or just populate your series with values and set null points setting them to clNone color or using the SetNull method, for example:
or
Zero is the default null value when no other value is provided. You can change that using TChartSeries.DefaultNullValue property or just populate your series with values and set null points setting them to clNone color or using the SetNull method, for example:
Code: Select all
Series1.AddXY(5, 5, clNone);
Code: Select all
index:=Series1.AddXY(5, 5);
Series1.SetNull(index);
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: Problem Export with TSeriesDataText and NULL Values
Hello Narcis
Thanks for your fast answer, but i think tou didn't understand my question.
Because, i use the NULL Values to prevent to draw the line (see snap4.jpg). Everytime my PLC (Controller) are Offline i add a NULL Value to the cart (see snap5.jpg), to show the user that are no values saved at this time. The Line is drawed interrupted. This is working well, but when i export this values, my NULL Values are exported as a "0" value!! This is my problem! And i also think these are not correct!
Regards
Gregor
Thanks for your fast answer, but i think tou didn't understand my question.
Because, i use the NULL Values to prevent to draw the line (see snap4.jpg). Everytime my PLC (Controller) are Offline i add a NULL Value to the cart (see snap5.jpg), to show the user that are no values saved at this time. The Line is drawed interrupted. This is working well, but when i export this values, my NULL Values are exported as a "0" value!! This is my problem! And i also think these are not correct!
Regards
Gregor
- Attachments
-
- Snap5.jpg (115.49 KiB) Viewed 7616 times
-
- Snap4.jpg (111.15 KiB) Viewed 7616 times
Re: Problem Export with TSeriesDataText and NULL Values
Hello,
All the points in TeeChart have a value, even if they are null. The null property is like a flag (it's actually clNone Color), independent than the value for that point.
This way you can choose to not to draw the null values, as you do, with tnDontPaint, but you can still draw them with tnIgnore, if you want.
The value a null point has depends on ho you've entered the point. If you use the AddNull method, the point entered will have the DefaultNullValue value. If you use SetNull method, the value for that point isn't changed, only the Color.
I can think on two ways to know what points are the null points in your exported file:
- You can to export the series with IncludeColors=true so the colors can be also exported and you can know what values were null points.
- You can set a particular value when adding/setting your null values. A value that you know that can unequivocally identify your null points. A value that you are sure you won't find in the series.
All the points in TeeChart have a value, even if they are null. The null property is like a flag (it's actually clNone Color), independent than the value for that point.
This way you can choose to not to draw the null values, as you do, with tnDontPaint, but you can still draw them with tnIgnore, if you want.
The value a null point has depends on ho you've entered the point. If you use the AddNull method, the point entered will have the DefaultNullValue value. If you use SetNull method, the value for that point isn't changed, only the Color.
I can think on two ways to know what points are the null points in your exported file:
- You can to export the series with IncludeColors=true so the colors can be also exported and you can know what values were null points.
- You can set a particular value when adding/setting your null values. A value that you know that can unequivocally identify your null points. A value that you are sure you won't find in the series.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Problem Export with TSeriesDataText and NULL Values
Hello Yeray
Thanks for you hints.
Best Regards
Gregor
Thanks for you hints.
Best Regards
Gregor