0

私のグラフの画像

DevExpress の cxGrid で作成されたグラフがあり、X 軸に日付がありますが、グラフに多くのデータがある場合、これらの日付は 2 桁または 4 桁に切り捨てられます

X 軸が 5 または 10 の値ごとにテキストのみを表示するように変更するにはどうすればよいですか?

4

1 に答える 1

0

アプリケーションにページングを実装する必要があります。グリッドの ChartView.DataController の OnDataChanged と OnFilterRecord をオーバーライドすることで、これを行うことができます。

   aChartView.DataController.OnDataChanged  := cvChartDataControllerDataChanged;
   aChartView.DataController.OnFilterRecord := cvChartDataControllerFilterRecord;

ポイントは、OnFilterRecord を使用して、一度に限られた量のレコードだけを表示することです。そうしないと、データ ポイントが多すぎます。最も重要なものは OnFilterRecord です。次に例を示します。

procedure TSomeGrid.cvChartDataControllerFilterRecord(ADataController: TcxCustomDataController; ARecordIndex: Integer; var Accept: Boolean);
begin
// inspect the number of all records
   FNoOfRecords := ADataController.RecordCount;
//FStartRecordNo and FEndRecordNo are relative to the FCurrentPageNo
//calculated elsewhere OnDataChanged
   if FCurrentPageNo > 0 then
      Accept := (ARecordIndex >= FStartRecordNo) and (ARecordIndex <= FEndRecordNo)
   else
      Accept := ARecordIndex < FMaxChartRecords;
end;
于 2012-03-05T16:39:48.647 に答える