diff --git a/components/tachart/demo/axis/main.lfm b/components/tachart/demo/axis/main.lfm index 68f3a40b35..e323aa8819 100644 --- a/components/tachart/demo/axis/main.lfm +++ b/components/tachart/demo/axis/main.lfm @@ -8,24 +8,24 @@ object Form1: TForm1 ClientWidth = 533 OnCreate = FormCreate Position = poScreenCenter - LCLVersion = '1.1' + LCLVersion = '1.7' object PageControl1: TPageControl Left = 0 Height = 430 Top = 0 Width = 533 - ActivePage = tsCustomMarks + ActivePage = tsDateTime Align = alClient - TabIndex = 0 + TabIndex = 3 TabOrder = 0 Options = [nboKeyboardTabSwitch] object tsCustomMarks: TTabSheet Caption = 'Customized marks' - ClientHeight = 404 + ClientHeight = 402 ClientWidth = 525 object ChartCustomMarks: TChart Left = 0 - Height = 404 + Height = 402 Top = 0 Width = 525 AxisList = < @@ -78,7 +78,6 @@ object Form1: TForm1 'TAChart' ) Align = alClient - ParentColor = False object ChartCustomMarksBarSeries1: TBarSeries Marks.Frame.Visible = False Marks.LabelBrush.Style = bsClear @@ -118,7 +117,6 @@ object Form1: TForm1 'TAChart' ) Align = alClient - ParentColor = False end end object tsSubmarks: TTabSheet @@ -177,7 +175,6 @@ object Form1: TForm1 'TAChart' ) Align = alClient - ParentColor = False object ChartSubmarksLineSeries1: TLineSeries Source = udcsGraph end @@ -185,11 +182,11 @@ object Form1: TForm1 end object tsDateTime: TTabSheet Caption = 'Date and time' - ClientHeight = 404 + ClientHeight = 402 ClientWidth = 525 object ChartDateTime: TChart Left = 0 - Height = 404 + Height = 368 Top = 0 Width = 525 AxisList = < @@ -216,11 +213,32 @@ object Form1: TForm1 Title.Visible = True Toolset = ChartToolsetDateTime Align = alClient - ParentColor = False object ChartDateTimeLineSeries1: TLineSeries Source = rcsDates 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 object tsIntervals: TTabSheet Caption = 'Intervals' @@ -318,7 +336,6 @@ object Form1: TForm1 'TAChart' ) Align = alClient - ParentColor = False end end object tsPosition: TTabSheet @@ -372,7 +389,6 @@ object Form1: TForm1 ) Align = alClient Color = clWhite - ParentColor = False object ChartPositionFuncSeries1: TFuncSeries Extent.UseXMax = True Extent.UseXMin = True @@ -403,7 +419,7 @@ object Form1: TForm1 Width = 128 Align = alTop Caption = ' X axis ' - ClientHeight = 103 + ClientHeight = 101 ClientWidth = 124 TabOrder = 0 object seXPosition: TSpinEdit @@ -461,10 +477,10 @@ object Form1: TForm1 end object cbUnitsX: TComboBox Left = 54 - Height = 21 + Height = 23 Top = 29 Width = 60 - ItemHeight = 13 + ItemHeight = 15 ItemIndex = 0 Items.Strings = ( 'percent' @@ -485,7 +501,7 @@ object Form1: TForm1 Width = 128 Align = alTop Caption = ' Y axis ' - ClientHeight = 106 + ClientHeight = 104 ClientWidth = 124 TabOrder = 1 object lblPositionY: TLabel @@ -535,10 +551,10 @@ object Form1: TForm1 end object cbUnitsY: TComboBox Left = 54 - Height = 21 + Height = 23 Top = 29 Width = 60 - ItemHeight = 13 + ItemHeight = 15 ItemIndex = 0 Items.Strings = ( 'percent' diff --git a/components/tachart/demo/axis/main.pas b/components/tachart/demo/axis/main.pas index c6b09cc427..501402fcde 100644 --- a/components/tachart/demo/axis/main.pas +++ b/components/tachart/demo/axis/main.pas @@ -35,6 +35,7 @@ type ChartToolsetDateTime: TChartToolset; cbStaticX: TCheckBox; cbUnitsX: TComboBox; + CbSuppressPrevUnit: TCheckBox; csStripes: TChartStyles; DateTimeIntervalChartSource1: TDateTimeIntervalChartSource; gbPositionX: TGroupBox; @@ -45,6 +46,7 @@ type lblUnitsY: TLabel; lcsMarks: TListChartSource; PageControl1: TPageControl; + Panel1: TPanel; pnlPosition: TPanel; rbPositionBottom: TRadioButton; rbPositionLeft: TRadioButton; @@ -64,6 +66,7 @@ type udcsSub: TUserDefinedChartSource; procedure cbStaticXChange(Sender: TObject); procedure cbStaticYChange(Sender: TObject); + procedure CbSuppressPrevUnitChange(Sender: TObject); procedure cbUnitsXChange(Sender: TObject); procedure cbUnitsYChange(Sender: TObject); procedure ChartCustomMarksAxisList1MarkToText(var AText: String; AMark: Double); @@ -104,6 +107,11 @@ begin ChartPosition.AxisList[2].Visible := cbStaticY.Checked; end; +procedure TForm1.CbSuppressPrevUnitChange(Sender: TObject); +begin + DateTimeIntervalChartSource1.SuppressPrevUnit := CbSuppressPrevUnit.Checked; +end; + procedure TForm1.cbUnitsXChange(Sender: TObject); begin ChartPosition.AxisList[1].PositionUnits := TChartUnits(cbUnitsX.ItemIndex); diff --git a/components/tachart/tacustomsource.pas b/components/tachart/tacustomsource.pas index a0bdf2c3fa..3d2593fb07 100644 --- a/components/tachart/tacustomsource.pas +++ b/components/tachart/tacustomsource.pas @@ -123,8 +123,8 @@ type TBasicChartSource = class(TComponent) strict private FBroadcaster: TBroadcaster; - FUpdateCount: Integer; strict protected + FUpdateCount: Integer; procedure Notify; public constructor Create(AOwner: TComponent); override; @@ -156,7 +156,6 @@ type strict protected FExtent: TDoubleRect; FExtentIsValid: Boolean; - FUpdateCount: Integer; FValuesTotal: Double; FValuesTotalIsValid: Boolean; FXCount: Cardinal; diff --git a/components/tachart/taintervalsources.pas b/components/tachart/taintervalsources.pas index 3fff5836b1..77f898f1f7 100644 --- a/components/tachart/taintervalsources.pas +++ b/components/tachart/taintervalsources.pas @@ -375,9 +375,9 @@ end; procedure TDateTimeIntervalChartSource.SetSuppressPrevUnit(AValue: Boolean); begin if FSuppressPrevUnit = AValue then exit; + BeginUpdate; FSuppressPrevUnit := AValue; - InvalidateCaches; - Notify; + EndUpdate; end; procedure TDateTimeIntervalChartSource.ValuesInRange(