mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-10-25 05:31:41 +02:00
TAChart: Fix TDateTimeIntervalChartSource.SuppressPrevUnit not updating chart if changed.
git-svn-id: trunk@52776 -
This commit is contained in:
parent
a3af6a18b4
commit
04209d1c09
@ -8,24 +8,24 @@ object Form1: TForm1
|
|||||||
ClientWidth = 533
|
ClientWidth = 533
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
Position = poScreenCenter
|
Position = poScreenCenter
|
||||||
LCLVersion = '1.1'
|
LCLVersion = '1.7'
|
||||||
object PageControl1: TPageControl
|
object PageControl1: TPageControl
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 430
|
Height = 430
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 533
|
Width = 533
|
||||||
ActivePage = tsCustomMarks
|
ActivePage = tsDateTime
|
||||||
Align = alClient
|
Align = alClient
|
||||||
TabIndex = 0
|
TabIndex = 3
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
Options = [nboKeyboardTabSwitch]
|
Options = [nboKeyboardTabSwitch]
|
||||||
object tsCustomMarks: TTabSheet
|
object tsCustomMarks: TTabSheet
|
||||||
Caption = 'Customized marks'
|
Caption = 'Customized marks'
|
||||||
ClientHeight = 404
|
ClientHeight = 402
|
||||||
ClientWidth = 525
|
ClientWidth = 525
|
||||||
object ChartCustomMarks: TChart
|
object ChartCustomMarks: TChart
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 404
|
Height = 402
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 525
|
Width = 525
|
||||||
AxisList = <
|
AxisList = <
|
||||||
@ -78,7 +78,6 @@ object Form1: TForm1
|
|||||||
'TAChart'
|
'TAChart'
|
||||||
)
|
)
|
||||||
Align = alClient
|
Align = alClient
|
||||||
ParentColor = False
|
|
||||||
object ChartCustomMarksBarSeries1: TBarSeries
|
object ChartCustomMarksBarSeries1: TBarSeries
|
||||||
Marks.Frame.Visible = False
|
Marks.Frame.Visible = False
|
||||||
Marks.LabelBrush.Style = bsClear
|
Marks.LabelBrush.Style = bsClear
|
||||||
@ -118,7 +117,6 @@ object Form1: TForm1
|
|||||||
'TAChart'
|
'TAChart'
|
||||||
)
|
)
|
||||||
Align = alClient
|
Align = alClient
|
||||||
ParentColor = False
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object tsSubmarks: TTabSheet
|
object tsSubmarks: TTabSheet
|
||||||
@ -177,7 +175,6 @@ object Form1: TForm1
|
|||||||
'TAChart'
|
'TAChart'
|
||||||
)
|
)
|
||||||
Align = alClient
|
Align = alClient
|
||||||
ParentColor = False
|
|
||||||
object ChartSubmarksLineSeries1: TLineSeries
|
object ChartSubmarksLineSeries1: TLineSeries
|
||||||
Source = udcsGraph
|
Source = udcsGraph
|
||||||
end
|
end
|
||||||
@ -185,11 +182,11 @@ object Form1: TForm1
|
|||||||
end
|
end
|
||||||
object tsDateTime: TTabSheet
|
object tsDateTime: TTabSheet
|
||||||
Caption = 'Date and time'
|
Caption = 'Date and time'
|
||||||
ClientHeight = 404
|
ClientHeight = 402
|
||||||
ClientWidth = 525
|
ClientWidth = 525
|
||||||
object ChartDateTime: TChart
|
object ChartDateTime: TChart
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 404
|
Height = 368
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 525
|
Width = 525
|
||||||
AxisList = <
|
AxisList = <
|
||||||
@ -216,11 +213,32 @@ object Form1: TForm1
|
|||||||
Title.Visible = True
|
Title.Visible = True
|
||||||
Toolset = ChartToolsetDateTime
|
Toolset = ChartToolsetDateTime
|
||||||
Align = alClient
|
Align = alClient
|
||||||
ParentColor = False
|
|
||||||
object ChartDateTimeLineSeries1: TLineSeries
|
object ChartDateTimeLineSeries1: TLineSeries
|
||||||
Source = rcsDates
|
Source = rcsDates
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
object Panel1: TPanel
|
||||||
|
Left = 0
|
||||||
|
Height = 34
|
||||||
|
Top = 368
|
||||||
|
Width = 525
|
||||||
|
Align = alBottom
|
||||||
|
BevelOuter = bvNone
|
||||||
|
ClientHeight = 34
|
||||||
|
ClientWidth = 525
|
||||||
|
TabOrder = 1
|
||||||
|
object CbSuppressPrevUnit: TCheckBox
|
||||||
|
Left = 11
|
||||||
|
Height = 19
|
||||||
|
Top = 8
|
||||||
|
Width = 139
|
||||||
|
Caption = 'Suppress previous unit'
|
||||||
|
Checked = True
|
||||||
|
OnChange = CbSuppressPrevUnitChange
|
||||||
|
State = cbChecked
|
||||||
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
object tsIntervals: TTabSheet
|
object tsIntervals: TTabSheet
|
||||||
Caption = 'Intervals'
|
Caption = 'Intervals'
|
||||||
@ -318,7 +336,6 @@ object Form1: TForm1
|
|||||||
'TAChart'
|
'TAChart'
|
||||||
)
|
)
|
||||||
Align = alClient
|
Align = alClient
|
||||||
ParentColor = False
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object tsPosition: TTabSheet
|
object tsPosition: TTabSheet
|
||||||
@ -372,7 +389,6 @@ object Form1: TForm1
|
|||||||
)
|
)
|
||||||
Align = alClient
|
Align = alClient
|
||||||
Color = clWhite
|
Color = clWhite
|
||||||
ParentColor = False
|
|
||||||
object ChartPositionFuncSeries1: TFuncSeries
|
object ChartPositionFuncSeries1: TFuncSeries
|
||||||
Extent.UseXMax = True
|
Extent.UseXMax = True
|
||||||
Extent.UseXMin = True
|
Extent.UseXMin = True
|
||||||
@ -403,7 +419,7 @@ object Form1: TForm1
|
|||||||
Width = 128
|
Width = 128
|
||||||
Align = alTop
|
Align = alTop
|
||||||
Caption = ' X axis '
|
Caption = ' X axis '
|
||||||
ClientHeight = 103
|
ClientHeight = 101
|
||||||
ClientWidth = 124
|
ClientWidth = 124
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
object seXPosition: TSpinEdit
|
object seXPosition: TSpinEdit
|
||||||
@ -461,10 +477,10 @@ object Form1: TForm1
|
|||||||
end
|
end
|
||||||
object cbUnitsX: TComboBox
|
object cbUnitsX: TComboBox
|
||||||
Left = 54
|
Left = 54
|
||||||
Height = 21
|
Height = 23
|
||||||
Top = 29
|
Top = 29
|
||||||
Width = 60
|
Width = 60
|
||||||
ItemHeight = 13
|
ItemHeight = 15
|
||||||
ItemIndex = 0
|
ItemIndex = 0
|
||||||
Items.Strings = (
|
Items.Strings = (
|
||||||
'percent'
|
'percent'
|
||||||
@ -485,7 +501,7 @@ object Form1: TForm1
|
|||||||
Width = 128
|
Width = 128
|
||||||
Align = alTop
|
Align = alTop
|
||||||
Caption = ' Y axis '
|
Caption = ' Y axis '
|
||||||
ClientHeight = 106
|
ClientHeight = 104
|
||||||
ClientWidth = 124
|
ClientWidth = 124
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
object lblPositionY: TLabel
|
object lblPositionY: TLabel
|
||||||
@ -535,10 +551,10 @@ object Form1: TForm1
|
|||||||
end
|
end
|
||||||
object cbUnitsY: TComboBox
|
object cbUnitsY: TComboBox
|
||||||
Left = 54
|
Left = 54
|
||||||
Height = 21
|
Height = 23
|
||||||
Top = 29
|
Top = 29
|
||||||
Width = 60
|
Width = 60
|
||||||
ItemHeight = 13
|
ItemHeight = 15
|
||||||
ItemIndex = 0
|
ItemIndex = 0
|
||||||
Items.Strings = (
|
Items.Strings = (
|
||||||
'percent'
|
'percent'
|
||||||
|
|||||||
@ -35,6 +35,7 @@ type
|
|||||||
ChartToolsetDateTime: TChartToolset;
|
ChartToolsetDateTime: TChartToolset;
|
||||||
cbStaticX: TCheckBox;
|
cbStaticX: TCheckBox;
|
||||||
cbUnitsX: TComboBox;
|
cbUnitsX: TComboBox;
|
||||||
|
CbSuppressPrevUnit: TCheckBox;
|
||||||
csStripes: TChartStyles;
|
csStripes: TChartStyles;
|
||||||
DateTimeIntervalChartSource1: TDateTimeIntervalChartSource;
|
DateTimeIntervalChartSource1: TDateTimeIntervalChartSource;
|
||||||
gbPositionX: TGroupBox;
|
gbPositionX: TGroupBox;
|
||||||
@ -45,6 +46,7 @@ type
|
|||||||
lblUnitsY: TLabel;
|
lblUnitsY: TLabel;
|
||||||
lcsMarks: TListChartSource;
|
lcsMarks: TListChartSource;
|
||||||
PageControl1: TPageControl;
|
PageControl1: TPageControl;
|
||||||
|
Panel1: TPanel;
|
||||||
pnlPosition: TPanel;
|
pnlPosition: TPanel;
|
||||||
rbPositionBottom: TRadioButton;
|
rbPositionBottom: TRadioButton;
|
||||||
rbPositionLeft: TRadioButton;
|
rbPositionLeft: TRadioButton;
|
||||||
@ -64,6 +66,7 @@ type
|
|||||||
udcsSub: TUserDefinedChartSource;
|
udcsSub: TUserDefinedChartSource;
|
||||||
procedure cbStaticXChange(Sender: TObject);
|
procedure cbStaticXChange(Sender: TObject);
|
||||||
procedure cbStaticYChange(Sender: TObject);
|
procedure cbStaticYChange(Sender: TObject);
|
||||||
|
procedure CbSuppressPrevUnitChange(Sender: TObject);
|
||||||
procedure cbUnitsXChange(Sender: TObject);
|
procedure cbUnitsXChange(Sender: TObject);
|
||||||
procedure cbUnitsYChange(Sender: TObject);
|
procedure cbUnitsYChange(Sender: TObject);
|
||||||
procedure ChartCustomMarksAxisList1MarkToText(var AText: String; AMark: Double);
|
procedure ChartCustomMarksAxisList1MarkToText(var AText: String; AMark: Double);
|
||||||
@ -104,6 +107,11 @@ begin
|
|||||||
ChartPosition.AxisList[2].Visible := cbStaticY.Checked;
|
ChartPosition.AxisList[2].Visible := cbStaticY.Checked;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.CbSuppressPrevUnitChange(Sender: TObject);
|
||||||
|
begin
|
||||||
|
DateTimeIntervalChartSource1.SuppressPrevUnit := CbSuppressPrevUnit.Checked;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TForm1.cbUnitsXChange(Sender: TObject);
|
procedure TForm1.cbUnitsXChange(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
ChartPosition.AxisList[1].PositionUnits := TChartUnits(cbUnitsX.ItemIndex);
|
ChartPosition.AxisList[1].PositionUnits := TChartUnits(cbUnitsX.ItemIndex);
|
||||||
|
|||||||
@ -123,8 +123,8 @@ type
|
|||||||
TBasicChartSource = class(TComponent)
|
TBasicChartSource = class(TComponent)
|
||||||
strict private
|
strict private
|
||||||
FBroadcaster: TBroadcaster;
|
FBroadcaster: TBroadcaster;
|
||||||
FUpdateCount: Integer;
|
|
||||||
strict protected
|
strict protected
|
||||||
|
FUpdateCount: Integer;
|
||||||
procedure Notify;
|
procedure Notify;
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
@ -156,7 +156,6 @@ type
|
|||||||
strict protected
|
strict protected
|
||||||
FExtent: TDoubleRect;
|
FExtent: TDoubleRect;
|
||||||
FExtentIsValid: Boolean;
|
FExtentIsValid: Boolean;
|
||||||
FUpdateCount: Integer;
|
|
||||||
FValuesTotal: Double;
|
FValuesTotal: Double;
|
||||||
FValuesTotalIsValid: Boolean;
|
FValuesTotalIsValid: Boolean;
|
||||||
FXCount: Cardinal;
|
FXCount: Cardinal;
|
||||||
|
|||||||
@ -375,9 +375,9 @@ end;
|
|||||||
procedure TDateTimeIntervalChartSource.SetSuppressPrevUnit(AValue: Boolean);
|
procedure TDateTimeIntervalChartSource.SetSuppressPrevUnit(AValue: Boolean);
|
||||||
begin
|
begin
|
||||||
if FSuppressPrevUnit = AValue then exit;
|
if FSuppressPrevUnit = AValue then exit;
|
||||||
|
BeginUpdate;
|
||||||
FSuppressPrevUnit := AValue;
|
FSuppressPrevUnit := AValue;
|
||||||
InvalidateCaches;
|
EndUpdate;
|
||||||
Notify;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TDateTimeIntervalChartSource.ValuesInRange(
|
procedure TDateTimeIntervalChartSource.ValuesInRange(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user