Index: /trunk/Forms/UFormCharts.lfm
===================================================================
--- /trunk/Forms/UFormCharts.lfm	(revision 128)
+++ /trunk/Forms/UFormCharts.lfm	(revision 128)
@@ -0,0 +1,53 @@
+object FormCharts: TFormCharts
+  Left = 562
+  Height = 709
+  Top = 333
+  Width = 944
+  Caption = 'Charts'
+  ClientHeight = 709
+  ClientWidth = 944
+  OnClose = FormClose
+  OnShow = FormShow
+  LCLVersion = '1.6.4.0'
+  object Chart1: TChart
+    Left = 8
+    Height = 648
+    Top = 56
+    Width = 932
+    AxisList = <    
+      item
+        Minors = <>
+        Title.LabelFont.Orientation = 900
+      end    
+      item
+        Alignment = calBottom
+        Minors = <>
+      end>
+    Foot.Brush.Color = clBtnFace
+    Foot.Font.Color = clBlue
+    Title.Brush.Color = clBtnFace
+    Title.Font.Color = clBlue
+    Title.Text.Strings = (
+      'TAChart'
+    )
+    Anchors = [akTop, akLeft, akRight, akBottom]
+  end
+  object ComboBox1: TComboBox
+    Left = 24
+    Height = 34
+    Top = 8
+    Width = 392
+    ItemHeight = 0
+    ItemIndex = 0
+    Items.Strings = (
+      'Occupied cells'
+      'Military power'
+      'Discovered cells'
+      'Cities count'
+    )
+    OnChange = ComboBox1Change
+    Style = csDropDownList
+    TabOrder = 1
+    Text = 'Occupied cells'
+  end
+end
Index: /trunk/Forms/UFormCharts.lrt
===================================================================
--- /trunk/Forms/UFormCharts.lrt	(revision 128)
+++ /trunk/Forms/UFormCharts.lrt	(revision 128)
@@ -0,0 +1,2 @@
+TFORMCHARTS.CAPTION=Charts
+TFORMCHARTS.COMBOBOX1.TEXT=Occupied cells
Index: /trunk/Forms/UFormCharts.pas
===================================================================
--- /trunk/Forms/UFormCharts.pas	(revision 128)
+++ /trunk/Forms/UFormCharts.pas	(revision 128)
@@ -0,0 +1,77 @@
+unit UFormCharts;
+
+{$mode delphi}
+
+interface
+
+uses
+  Classes, SysUtils, FileUtil, TAGraph, TASeries, Forms, Controls, Graphics,
+  Dialogs, StdCtrls, LMessages;
+
+type
+
+  { TFormCharts }
+
+  TFormCharts = class(TForm)
+    Chart1: TChart;
+    ComboBox1: TComboBox;
+    procedure ComboBox1Change(Sender: TObject);
+    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
+    procedure FormShow(Sender: TObject);
+  private
+    { private declarations }
+  public
+    procedure Redraw;
+  end;
+
+var
+  FormCharts: TFormCharts;
+
+implementation
+
+{$R *.lfm}
+
+uses
+  UCore, UGame;
+
+{ TFormCharts }
+
+procedure TFormCharts.ComboBox1Change(Sender: TObject);
+begin
+  Redraw;
+end;
+
+procedure TFormCharts.FormClose(Sender: TObject; var CloseAction: TCloseAction);
+begin
+  Core.PersistentForm.Save(Self);
+end;
+
+procedure TFormCharts.FormShow(Sender: TObject);
+begin
+  Core.PersistentForm.Load(Self);
+  Redraw;
+end;
+
+procedure TFormCharts.Redraw;
+var
+  I: Integer;
+  X: Integer;
+  NewSeries: TLineSeries;
+begin
+  Chart1.Series.Clear;
+  for I := 0 to Core.Game.Players.Count - 1 do
+  with TPlayer(Core.Game.Players[I]) do begin
+    NewSeries := TLineSeries.Create(nil);
+    NewSeries.LinePen.Color := Color;
+    for X := 0 to TurnStats.Count - 1 do begin
+      if ComboBox1.ItemIndex = 0 then NewSeries.AddXY(X, TGameTurnStat(TurnStats[X]).OccupiedCells)
+      else if ComboBox1.ItemIndex = 1 then NewSeries.AddXY(X, TGameTurnStat(TurnStats[X]).Units)
+      else if ComboBox1.ItemIndex = 2 then NewSeries.AddXY(X, TGameTurnStat(TurnStats[X]).DiscoveredCells)
+      else if ComboBox1.ItemIndex = 3 then NewSeries.AddXY(X, TGameTurnStat(TurnStats[X]).Cities);
+    end;
+    Chart1.AddSeries(NewSeries);
+  end;
+end;
+
+end.
+
Index: /trunk/Forms/UFormMain.lfm
===================================================================
--- /trunk/Forms/UFormMain.lfm	(revision 127)
+++ /trunk/Forms/UFormMain.lfm	(revision 128)
@@ -194,4 +194,7 @@
         Action = Core.ASettings
       end
+      object MenuItem24: TMenuItem
+        Action = Core.AShowCharts
+      end
     end
     object MenuItem16: TMenuItem
Index: /trunk/Forms/UFormMain.pas
===================================================================
--- /trunk/Forms/UFormMain.pas	(revision 127)
+++ /trunk/Forms/UFormMain.pas	(revision 128)
@@ -42,4 +42,5 @@
     MenuItem22: TMenuItem;
     MenuItem23: TMenuItem;
+    MenuItem24: TMenuItem;
     MenuItemLoadRecent: TMenuItem;
     MenuItem3: TMenuItem;
Index: /trunk/Languages/xtactics.cs.po
===================================================================
--- /trunk/Languages/xtactics.cs.po	(revision 127)
+++ /trunk/Languages/xtactics.cs.po	(revision 128)
@@ -85,4 +85,8 @@
 msgstr "Nastavení aplikace"
 
+#: tcore.ashowcharts.caption
+msgid "Show charts"
+msgstr "Ukázat grafy"
+
 #: tformabout.buttonclose.caption
 msgid "Close"
@@ -111,4 +115,12 @@
 msgid "Turn-based strategy game inspired by classic Risk board game. The game is highly configurable to allow to adjust battle field and game rules."
 msgstr "Tahová strategie inspirovaná klasickou deskovou hrou Risk. Hra je vysoce nastavitelná a umožňuje přizpůsobit bitevní pole a herní pravidla."
+
+#: tformcharts.caption
+msgid "Charts"
+msgstr "Grafy"
+
+#: tformcharts.combobox1.text
+msgid "Occupied cells"
+msgstr "Obsazené buňky"
 
 #: tformhelp.caption
Index: /trunk/Languages/xtactics.po
===================================================================
--- /trunk/Languages/xtactics.po	(revision 127)
+++ /trunk/Languages/xtactics.po	(revision 128)
@@ -75,4 +75,8 @@
 msgstr ""
 
+#: tcore.ashowcharts.caption
+msgid "Show charts"
+msgstr ""
+
 #: tformabout.buttonclose.caption
 msgid "Close"
@@ -102,4 +106,12 @@
 msgstr ""
 
+#: tformcharts.caption
+msgid "Charts"
+msgstr ""
+
+#: tformcharts.combobox1.text
+msgid "Occupied cells"
+msgstr ""
+
 #: tformhelp.caption
 msgctxt "TFORMHELP.CAPTION"
Index: /trunk/UCore.lfm
===================================================================
--- /trunk/UCore.lfm	(revision 127)
+++ /trunk/UCore.lfm	(revision 128)
@@ -73,4 +73,8 @@
       Caption = 'Help'
       OnExecute = AHelpExecute
+    end
+    object AShowCharts: TAction
+      Caption = 'Show charts'
+      OnExecute = AShowChartsExecute
     end
   end
Index: /trunk/UCore.lrt
===================================================================
--- /trunk/UCore.lrt	(revision 127)
+++ /trunk/UCore.lrt	(revision 128)
@@ -15,2 +15,3 @@
 TCORE.AABOUT.CAPTION=About
 TCORE.AHELP.CAPTION=Help
+TCORE.ASHOWCHARTS.CAPTION=Show charts
Index: /trunk/UCore.pas
===================================================================
--- /trunk/UCore.pas	(revision 127)
+++ /trunk/UCore.pas	(revision 128)
@@ -16,4 +16,5 @@
   TCore = class(TDataModule)
     AAbout: TAction;
+    AShowCharts: TAction;
     AHelp: TAction;
     AGameSave: TAction;
@@ -46,4 +47,5 @@
     procedure AHelpExecute(Sender: TObject);
     procedure ASettingsExecute(Sender: TObject);
+    procedure AShowChartsExecute(Sender: TObject);
     procedure CoolTranslator1Translate(Sender: TObject);
     procedure DataModuleCreate(Sender: TObject);
@@ -92,5 +94,5 @@
 uses
   UFormMove, UFormMain, UFormNew, UFormSettings, UFormAbout, UFormPlayer,
-  UFormHelp;
+  UFormHelp, UFormCharts;
 
 const
@@ -354,4 +356,9 @@
 end;
 
+procedure TCore.AShowChartsExecute(Sender: TObject);
+begin
+  FormCharts.Show;
+end;
+
 procedure TCore.CoolTranslator1Translate(Sender: TObject);
 begin
@@ -400,4 +407,5 @@
   FormMain.AZoomAll.Execute;
   FormMain.Redraw;
+  if FormCharts.Visible then FormCharts.Redraw;
 end;
 
@@ -408,4 +416,5 @@
   Game.Running := True;
   FormMain.Redraw;
+  if FormCharts.Visible then FormCharts.Redraw;
   UpdateActions;
 end;
@@ -415,4 +424,5 @@
   if Assigned(Game.CurrentPlayer) and Assigned(Game.CurrentPlayer.Client) then
     CurrentClient := Game.CurrentPlayer.Client;
+  if FormCharts.Visible then FormCharts.Redraw;
 end;
 
Index: /trunk/UGame.pas
===================================================================
--- /trunk/UGame.pas	(revision 127)
+++ /trunk/UGame.pas	(revision 128)
@@ -7,5 +7,5 @@
 uses
   Classes, SysUtils, ExtCtrls, Graphics, Contnrs, XMLConf, XMLRead, XMLWrite,
-  DOM, Math, FileUtil, UXMLUtils, Dialogs, Types, LCLType, LCLIntf;
+  DOM, Math, LazFileUtils, UXMLUtils, Dialogs, Types, LCLType, LCLIntf;
 
 const
@@ -243,4 +243,22 @@
   end;
 
+  { TGameTurnStat }
+
+  TGameTurnStat = class
+    OccupiedCells: Integer;
+    Units: Integer;
+    DiscoveredCells: Integer;
+    Cities: Integer;
+    procedure LoadFromNode(Node: TDOMNode);
+    procedure SaveToNode(Node: TDOMNode);
+  end;
+
+  { TGameTurnStats }
+
+  TGameTurnStats = class(TObjectList)
+    procedure LoadFromNode(Node: TDOMNode);
+    procedure SaveToNode(Node: TDOMNode);
+  end;
+
   TPlayerMode = (pmHuman, pmComputer);
   TComputerAgressivity = (caLow, caMedium, caHigh);
@@ -262,4 +280,5 @@
     TotalCells: Integer;
     TotalCities: Integer;
+    TotalDiscovered: Integer;
     StartUnits: Integer;
     StartCell: TCell;
@@ -267,4 +286,6 @@
     Defensive: Boolean;
     Agressivity: TComputerAgressivity;
+    TurnStats: TGameTurnStats;
+    procedure Clear;
     procedure LoadFromNode(Node: TDOMNode);
     procedure SaveToNode(Node: TDOMNode);
@@ -385,4 +406,5 @@
     procedure MoveAll(Player: TPlayer);
     procedure ClearMovesFromCell(Cell: TCell);
+    procedure RecordTurnStats;
     procedure SetMapType(AValue: TMapType);
     function SetMove(CellFrom, CellTo: TCell; Power: Integer; Confirmation: Boolean = True): TUnitMove;
@@ -543,4 +565,51 @@
 end;
 
+{ TGameTurnStat }
+
+procedure TGameTurnStat.LoadFromNode(Node: TDOMNode);
+begin
+  OccupiedCells := ReadInteger(Node, 'OccupiedCells', 0);
+  Units := ReadInteger(Node, 'Units', 0);
+  DiscoveredCells := ReadInteger(Node, 'DiscoveredCells', 0);
+  Cities := ReadInteger(Node, 'Cities', 0);
+end;
+
+procedure TGameTurnStat.SaveToNode(Node: TDOMNode);
+begin
+  WriteInteger(Node, 'OccupiedCells', OccupiedCells);
+  WriteInteger(Node, 'Units', Units);
+  WriteInteger(Node, 'DiscoveredCells', DiscoveredCells);
+  WriteInteger(Node, 'Cities', Cities);
+end;
+
+{ TGameTurnStats }
+
+procedure TGameTurnStats.LoadFromNode(Node: TDOMNode);
+var
+  Node2: TDOMNode;
+  NewTurnStat: TGameTurnStat;
+begin
+  Count := 0;
+  Node2 := Node.FirstChild;
+  while Assigned(Node2) and (Node2.NodeName = 'TurnStat') do begin
+    NewTurnStat := TGameTurnStat.Create;
+    NewTurnStat.LoadFromNode(Node2);
+    Add(NewTurnStat);
+    Node2 := Node2.NextSibling;
+  end;
+end;
+
+procedure TGameTurnStats.SaveToNode(Node: TDOMNode);
+var
+  I: Integer;
+  NewNode: TDOMNode;
+begin
+  for I := 0 to Count - 1 do begin;
+    NewNode := Node.OwnerDocument.CreateElement('TurnStat');
+    Node.AppendChild(NewNode);
+    TGameTurnStat(Items[I]).SaveToNode(NewNode);
+  end;
+end;
+
 { TClients }
 
@@ -1817,4 +1886,9 @@
 end;
 
+procedure TPlayer.Clear;
+begin
+  TurnStats.Clear;
+end;
+
 procedure TPlayer.SetClient(AValue: TClient);
 begin
@@ -1843,4 +1917,9 @@
       PlayerMap.LoadFromNode(NewNode);
   end;
+  with Node do begin
+    NewNode := FindNode('TurnStats');
+    if Assigned(NewNode) then
+      TurnStats.LoadFromNode(NewNode);
+  end;
 end;
 
@@ -1862,4 +1941,9 @@
     AppendChild(NewNode);
     PlayerMap.SaveToNode(NewNode);
+  end;
+  with Node do begin
+    NewNode := OwnerDocument.CreateElement('TurnStats');
+    AppendChild(NewNode);
+    TurnStats.SaveToNode(NewNode);
   end;
 end;
@@ -2247,8 +2331,10 @@
   PlayerMap := TPlayerMap.Create;
   PlayerMap.Player := Self;
+  TurnStats := TGameTurnStats.Create;
 end;
 
 destructor TPlayer.Destroy;
 begin
+  FreeAndNil(TurnStats);
   FreeAndNil(PlayerMap);
   inherited Destroy;
@@ -2884,4 +2970,5 @@
 var
   I: Integer;
+  J: Integer;
 begin
   for I := 0 to Players.Count - 1 do
@@ -2890,6 +2977,29 @@
     TotalCells := 0;
     TotalCities := 0;
-  end;
+
+    TotalDiscovered := 0;
+    for J := 0 to PlayerMap.Cells.Count - 1 do
+    with TPlayerCell(PlayerMap.Cells[J]) do begin
+      if Explored then Inc(TotalDiscovered);
+    end;
+  end;
+
   Map.ComputePlayerStats;
+end;
+
+procedure TGame.RecordTurnStats;
+var
+  I: Integer;
+  NewStat: TGameTurnStat;
+begin
+  for I := 0 to Players.Count - 1 do
+  with TPlayer(Players[I]) do begin
+    NewStat := TGameTurnStat.Create;
+    NewStat.DiscoveredCells := TotalDiscovered;
+    NewStat.OccupiedCells := TotalCells;
+    NewStat.Units := TotalUnits;
+    NewStat.Cities := TotalCities;
+    TurnStats.Add(NewStat);
+  end;
 end;
 
@@ -2927,4 +3037,5 @@
   UpdateRepeatMoves(CurrentPlayer);
   ComputePlayerStats;
+  RecordTurnStats;
   PrevPlayer := CurrentPlayer;
   // Skip dead players
@@ -3045,4 +3156,5 @@
   for I := 0 to Players.Count - 1 do
   with TPlayer(Players[I]) do begin
+    Clear;
     PlayerMap.Update;
     if (Map.Size.X > 0) and (Map.Size.Y > 0) then begin
Index: /trunk/xtactics.lpi
===================================================================
--- /trunk/xtactics.lpi	(revision 127)
+++ /trunk/xtactics.lpi	(revision 128)
@@ -153,25 +153,28 @@
       </local>
     </RunParams>
-    <RequiredPackages Count="5">
+    <RequiredPackages Count="6">
       <Item1>
+        <PackageName Value="TAChartLazarusPkg"/>
+      </Item1>
+      <Item2>
         <PackageName Value="TemplateGenerics"/>
         <DefaultFilename Value="Packages/TemplateGenerics/TemplateGenerics.lpk" Prefer="True"/>
-      </Item1>
-      <Item2>
+      </Item2>
+      <Item3>
         <PackageName Value="Common"/>
         <DefaultFilename Value="Packages/Common/Common.lpk" Prefer="True"/>
-      </Item2>
-      <Item3>
-        <PackageName Value="FCL"/>
       </Item3>
       <Item4>
+        <PackageName Value="FCL"/>
+      </Item4>
+      <Item5>
         <PackageName Value="CoolTranslator"/>
         <DefaultFilename Value="Packages/CoolTranslator/CoolTranslator.lpk" Prefer="True"/>
-      </Item4>
-      <Item5>
+      </Item5>
+      <Item6>
         <PackageName Value="LCL"/>
-      </Item5>
+      </Item6>
     </RequiredPackages>
-    <Units Count="11">
+    <Units Count="12">
       <Unit0>
         <Filename Value="xtactics.lpr"/>
@@ -242,4 +245,10 @@
         <IsPartOfProject Value="True"/>
       </Unit10>
+      <Unit11>
+        <Filename Value="Forms/UFormCharts.pas"/>
+        <IsPartOfProject Value="True"/>
+        <ComponentName Value="FormCharts"/>
+        <ResourceBaseClass Value="Form"/>
+      </Unit11>
     </Units>
   </ProjectOptions>
@@ -284,4 +293,7 @@
     </Linking>
     <Other>
+      <CompilerMessages>
+        <IgnoredMessages idx5024="True"/>
+      </CompilerMessages>
       <CustomOptions Value="-dDEBUG"/>
     </Other>
Index: /trunk/xtactics.lpr
===================================================================
--- /trunk/xtactics.lpr	(revision 127)
+++ /trunk/xtactics.lpr	(revision 128)
@@ -8,9 +8,9 @@
   {$ENDIF}
   Interfaces, // this includes the LCL widgetset
-  Forms, UGame, UCore, Common, CoolTranslator, TemplateGenerics,
-  UFormPlayer
+  Forms, tachartlazaruspkg, UGame, UCore, Common, CoolTranslator,
+  TemplateGenerics, UFormPlayer
   { you can add units after this },
   SysUtils, UFormSettings, UFormMain, UFormMove, UFormNew, UFormAbout,
-  UFormHelp, UMap;
+  UFormHelp, UMap, UFormCharts;
 
 {$R *.res}
@@ -37,4 +37,5 @@
   Application.CreateForm(TFormPlayer, FormPlayer);
   Application.CreateForm(TFormSettings, FormSettings);
+  Application.CreateForm(TFormCharts, FormCharts);
   Application.Run;
 end.
