I have a graph made with cxGrid from DevExpress and on the X axis I have a date But when there is a lot of data in the graph these dates are cut to just 2 or 4 digits
How can I change it so the X axis only show text at every 5 or 10 values?
I have a graph made with cxGrid from DevExpress and on the X axis I have a date But when there is a lot of data in the graph these dates are cut to just 2 or 4 digits
How can I change it so the X axis only show text at every 5 or 10 values?
You should implement paging into your application. You can do that by overriding OnDataChanged and OnFilterRecord of your grid's ChartView.DataController:
aChartView.DataController.OnDataChanged := cvChartDataControllerDataChanged;
aChartView.DataController.OnFilterRecord := cvChartDataControllerFilterRecord;
The point is to use OnFilterRecord to display just a limited amount of records at a time. That makes your chart presentable, otherwise you get too many data points. The most important one is OnFilterRecord. Here's an example:
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;