I'm currently testing your DatabaseAdapterDemo at ..\TMS FNC Chart\Demos\FMX\Database Adapter.
How can I hardcoded the major and minor units for the X-axis here?
You can change the values using the ChartSeriesEditor, but there are no s.XValues.MinorUnit and s.XValues.MajorUnit for TTMSFNCChartDatabaseAdapterSeriesItem.
source code:
procedure TForm1.ConnectButtonClick(Sender: TObject);
var
s: TTMSFNCChartDatabaseAdapterSeriesItem;
begin
TMSFNCChartDatabaseAdapter1.Source.Series.Clear;
TMSFNCChartDatabaseAdapter1.AutoCreateSeries := AutoCreateCB.IsChecked;
if not TMSFNCChartDatabaseAdapter1.AutoCreateSeries and (YValCombo.ItemIndex >= 0) then begin
s := TMSFNCChartDatabaseAdapter1.Source.Series.Add;
s.YValue := YValCombo.Items[YValCombo.ItemIndex];
if XValCombo.ItemIndex >= 0 then begin
s.XValue := XValCombo.Items[XValCombo.ItemIndex] ;
// s.XValues.AutoUnits := False; --> not possible
// s.XValues.MinorUnit := 0 ; --> not possible
// s.XValues.MajorUnit := 5 ; --> not possible
end else begin
s.XValue := '';
if XLabCombo.ItemIndex >= 0 then begin
s.XLabel := XLabCombo.Items[XLabCombo.ItemIndex]
end else begin
s.XLabel := '';
end;
end;
end else begin
TMSFNCChart1.DefaultLoadOptions.XValuesFormatType := vftDateTime;
TMSFNCChart1.DefaultLoadOptions.XValuesFormatString := 'dd';
TMSFNCChart1.DefaultLoadOptions.XValuesFormatType := vftNormal;
TMSFNCChart1.DefaultLoadOptions.XValuesFormatString := '%.0f';
end;
TMSFNCChartDatabaseAdapter1.Active := not TMSFNCChartDatabaseAdapter1.Active;
if TMSFNCChartDatabaseAdapter1.Active then
ConnectButton.Text := 'Disconnect Database'
else
ConnectButton.Text := 'Connect Database';
end;