Einzelnen Beitrag anzeigen

gnoll

Registriert seit: 30. Dez 2005
12 Beiträge
 
#1

Im vorher funktionierenden TChart keine Diagrammlinien mehr

  Alt 9. Mär 2006, 23:54
Hallo alle zusammen,

habe mein Problem dass ich zuvor gepostet habe (und jetzt geschlossen habe) anders lösen können.
Leider stehe ich nun vor einem neuem. Des TChart treibt mich noch in den Wahnsinn ;
Der unten angegebene Quellcode funktioniert als Prog und zeigt bis vor kurzem auch noch die geladen Werte aus der Textdatei an. Nun aber zeigt das Chart keine Funktionen mehr an, was vorher einwandfrei ging. Also nicht das Tchart selbst wird nicht angezeigt, sondern nur die Punktlinien nicht (siehe Bild);
Vielleicht könnt ihr mir ja helfen before ;
Vielen Dank im voraus für eure Antwort,
beste Grüße,

gnoll

gebe mal alles an..weil ich keine Ahnung habe woran es liegen könnte (zeigt auch keine Fehlermeldung an und hat auch im laufenden Prog keinen Absturz)

Delphi-Quellcode:
unit MainFrm;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls,
  Forms, ComCtrls, Menus, Dialogs, ActnList, ExtCtrls, TeeProcs,
  TeEngine, Chart, Series, StdCtrls;

type
  TMainForm = class(TForm)
    FreqChart: TChart;
    MainMenu: TMainMenu;
    ActionList: TActionList;
    DoFileOpen: TAction;
    OpenDialog: TOpenDialog;
    FileMenu: TMenuItem;
    N1: TMenuItem;
    DoFileExit: TAction;
    Beenden1: TMenuItem;
    DoHelpInfo: TAction;
    HelpMenu: TMenuItem;
    Info1: TMenuItem;
    Series1: TLineSeries;
    Drucken1: TMenuItem;
    Series2: TLineSeries;
    CheckBox1: TCheckBox;
    Button1: TButton;
    Edit1: TEdit;
    CheckBox2: TCheckBox;
    CheckBox3: TCheckBox;
    CheckBox4: TCheckBox;
    CheckBox5: TCheckBox;
    CheckBox6: TCheckBox;
    Edit2: TEdit;
    Edit3: TEdit;
    Edit4: TEdit;
    Edit5: TEdit;
    Edit6: TEdit;
    CheckBox7: TCheckBox;
    Edit7: TEdit;
    Series3: TLineSeries;
    Series4: TLineSeries;
    Series5: TLineSeries;
    Series6: TLineSeries;
    Series7: TLineSeries;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    Button5: TButton;
    Button6: TButton;
    Button7: TButton;
    Button8: TButton;
    Action1: TAction;
    OpenDialog1: TOpenDialog;
    procedure Button8Click(Sender: TObject);
    procedure Button7Click(Sender: TObject);
    procedure Button6Click(Sender: TObject);
    procedure Button5Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Drucken1Click(Sender: TObject);
// Series1: TBarSeries;
    procedure FormCreate(Sender: TObject);
    procedure DoFileExitExecute(Sender: TObject);
    procedure DoHelpInfoExecute(Sender: TObject);
    {procedure DoFileOpenExecute(Sender: TObject);}




  private
    BarSeries: TBarSeries;
    LineSeries: TLineSeries;
    LineSeries2: TLineSeries;
    LineSeries3: TLineSeries;
    LineSeries4: TLineSeries;
    LineSeries5: TLineSeries;
    LineSeries6: TLineSeries;
    LineSeries7: TLineSeries;
    FreqLabels: TStrings;
    
  end;
    var
  MainForm : TMainForm;
   form1:tform;

implementation

{$R *.dfm}

uses
  Math;

const
  MAX_VALUES = 32;
procedure TMainForm.FormCreate(Sender: TObject);
var
  i: integer;
begin
  LineSeries := FreqChart.Series[0] as TLineSeries;
  LineSeries2 := FreqChart.Series[1] as TLineSeries;
  LineSeries3 := FreqChart.Series[2] as TLineSeries;
  LineSeries4 := FreqChart.Series[3] as TLineSeries;
  LineSeries5 := FreqChart.Series[4] as TLineSeries;
  LineSeries6 := FreqChart.Series[5] as TLineSeries;
  LineSeries7 := FreqChart.Series[6] as TLineSeries;

// BarSeries := FreqChart.Series[0] as TBarSeries;
  OpenDialog.InitialDir := ExtractFilePath(ParamStr(0));
  FreqLabels := TStringList.Create;

  with FreqLabels do
    for i := 1 to MAX_VALUES do
      if i = 1
        then Add('16')
      else if i = 2
        then Add ('20')
        else if i= 3
        then Add('25')
        else if i=4
        then Add('31,5')
        else if i=5
        then Add ('40')
        else if i=6
        then Add('50')
        else if i=7
        then Add('63')
        else if i=8
        then Add ('80')
        else if i=9
        then Add ('100')
        else if i=10
        then Add('125')
        else if i= 11
        then Add('160')
        else if i=12
        then Add('200')
        else if i=13
        then Add ('250')
        else if i=14
        then Add ('315')
        else if i=15
        then Add ('400')
        else if i=16
        then Add ('500')
        else if i=17
        then Add ('630')
        else if i=18
        then Add ('800')
        else if i=19
        then Add('1000')
        else if i=20
        then Add ('1250')
        else if i=21
        then Add ('1600')
        else if i=22
        then Add ('2000')
        else if i=23
        then Add('2500')
        else if i=24
        then Add ('3150')
        else if i=25
        then Add('4000')
        else if i=26
        then Add('5000')
        else if i=27
        then Add('6300')
        else if i=28
        then Add('8000')
        else if i=29
        then Add('10000')
        else if i=30
        then Add ('12500')
        else if i=31
        then Add('16000')
        else if i=32
        then Add ('20000')

        else Add(Format('Label%d', [i])); {im Moment inaktiv}

end;

procedure TMainForm.DoFileExitExecute(Sender: TObject);
begin
  Close;
end;

procedure TMainForm.DoHelpInfoExecute(Sender: TObject);
begin
  ShowMessage('Hilfe über Shellexecute mit txt-file');
end;


{var
  s: TStrings;
  i: integer;
  z: integer;

begin
  z := trunc (s);
  s := TStringList.Create;
  with OpenDialog do
    if Execute then
    begin
      s.LoadFromFile(FileName);

    end
    else
    for z := 1 to FreqLabels.Count do
      s.Add(IntToStr(RandomRange(0, 10000)));
  LineSeries.Clear;
//  BarSeries.Clear;
  for z := 1 to Pred(s.Count) do
    LineSeries.AddY(StrToInt(s[z]), FreqLabels[z]);
//    BarSeries.AddY(StrToInt(s[i]), FreqLabels[i]);
  s.Free;
end; }








procedure TMainForm.Drucken1Click(Sender: TObject);
begin
mainform.Print;
end;

procedure TMainForm.Button2Click(Sender: TObject);


begin
 if opendialog1.Execute then
 begin
if fileexists (opendialog1.filename)then
begin
edit1.text:= opendialog1.filename
end;
end;
end;


procedure TMainForm.Button3Click(Sender: TObject);
begin
 if opendialog1.Execute then
 begin
if fileexists (opendialog1.filename)then
begin
edit2.text:= opendialog1.filename
end;
end;
end;

procedure TMainForm.Button4Click(Sender: TObject);
begin
 if opendialog1.Execute then
 begin
if fileexists (opendialog1.filename)then
begin
edit3.text:= opendialog1.filename
end;
end;
end;


procedure TMainForm.Button5Click(Sender: TObject);
begin
 if opendialog1.Execute then
 begin
if fileexists (opendialog1.filename)then
begin
edit3.text:= opendialog1.filename
end;
end;
end;

procedure TMainForm.Button6Click(Sender: TObject);
begin
 if opendialog1.Execute then
 begin
if fileexists (opendialog1.filename)then
begin
edit3.text:= opendialog1.filename
end;
end;
end;

procedure TMainForm.Button7Click(Sender: TObject);
begin
 if opendialog1.Execute then
 begin
if fileexists (opendialog1.filename)then
begin
edit3.text:= opendialog1.filename
end;
end;
end;

procedure TMainForm.Button8Click(Sender: TObject);

begin
 if opendialog1.Execute then
 begin
if fileexists (opendialog1.filename)then
begin
edit3.text:= opendialog1.filename
end;
end;
end;




procedure TMainForm.Button1Click(Sender: TObject);
 var
 s: TStringList;
 s1: TStringlist;
 s2: TStringlist;
 s3: TStringlist;
 s4: TStringlist;
 s5: TStringlist;
 s6: TStringlist;
 s7: TStringlist;


  i: integer;
  z: integer;

 begin

 s := TStringList.Create;
 s1:=tstringlist.create;
 s2:=tstringlist.create;
 s3:=tstringlist.create;
 s4:=tstringlist.create;
 s5:=tstringlist.create;
 s6:=tstringlist.create;
 s7:=tstringlist.create;

   {edits mit Pfaden füllen}

     if checkbox1.checked = true {And edit1.text <> '' } then

               s.LoadFromFile(edit1.text);

     if checkbox2.checked = true {And edit2.text <> '' } then
               s1.loadfromfile (edit2.text);
     if checkbox3.checked = true {And edit3.text <> '' } then
               s2.loadfromfile (edit3.text);
     if checkbox4.checked = true {And edit4.text <> ''}  then
               s3.loadfromfile (edit4.text);
     if checkbox5.checked = true {And edit5.text <> '' } then
               s4.loadfromfile (edit5.text);
     if checkbox6.checked = true {And edit6.text <> '' } then
               s5.loadfromfile (edit6.text);
     if checkbox7.checked = true {And edit7.text <> '' } then
               s6.loadfromfile (edit7.text);
     if checkbox7.checked = true {And edit7.text <> ''}  then
               s6.loadfromfile (edit7.text);

      LineSeries.Clear;

for i := 1 to Pred(s.Count) do

begin

if checkbox1.checked = true {And edit1.text <> '' } then
                 LineSeries.AddY (StrToFloat(s[i]), FreqLabels[i]);
                  // BarSeries.AddY(StrToInt(s[i]), FreqLabels[i]);
if checkbox2.checked = true {And edit2.text <> '' } then
                 LineSeries.AddY (StrToFloat(s1[i]), FreqLabels[i]);
                 // BarSeries.AddY(StrToInt(s[i]), FreqLabels[i]);
if checkbox3.checked = true {And edit3.text <> '' } then
                 LineSeries.AddY (StrToFloat(s2[i]), FreqLabels[i]);
                 // BarSeries.AddY(StrToInt(s[i]), FreqLabels[i]);
if checkbox4.checked = true {And edit4.text <> '' }then
                 LineSeries.AddY (StrToFloat(s3[i]), FreqLabels[i]);
                 // BarSeries.AddY(StrToInt(s[i]), FreqLabels[i]);
if checkbox5.checked = true {And edit5.text <> '' } then
                 LineSeries.AddY (StrToFloat(s4[i]), FreqLabels[i]);
                 // BarSeries.AddY(StrToInt(s[i]), FreqLabels[i]);
if checkbox6.checked = true {And edit6.text <> '' } then
                 LineSeries.AddY (StrToFloat(s5[i]), FreqLabels[i]);
                 // BarSeries.AddY(StrToInt(s[i]), FreqLabels[i]);
if checkbox7.checked = true {And edit7.text <> ''} then
                 LineSeries.AddY (StrToFloat(s6[i]), FreqLabels[i]);
                 // BarSeries.AddY(StrToInt(s[i]), FreqLabels[i]);


end ;

s.Free;
s1.Free;
s2.Free;
s3.Free;
s4.Free;
s5.Free;
s6.Free;
s7.Free;

end;

end.
Miniaturansicht angehängter Grafiken
chart_343.jpg  
  Mit Zitat antworten Zitat