TChart : Axis Items overlaping
Posted: Mon Apr 30, 2012 7:58 am
I have a TChart on which I build several TGanttSeries and one TLineSeries at run time.
Each TGanttSerie represent a step in a production process, each "line" represent one process. So each bars use its step number as a mark and I use LeftAxis.Items to display the correct labels.
Also, I have inverted my left axis as I need the line to be displayed in chronological creation order.
As we can have a lot of those lines I want to limit the simultaneous displayed results to 30. Also, as the data can span quite a long period, I limit the bottom axis to up to 60 days.
If there is less than 30 lines or 60 days, I don't put a limit on the axis.
I use two TChartScrollBar to manage the scrolling.
On to the problems :
1) When the marks are out of the main drawing zone but still in the component drawing space, the marks are displayed through the axis labels (this one is annoying but not a major problem)
2) When I scroll the lines vertically, the labels tends to stick on screen and overlap each other. This one is quite problematic as it's quickly impossible to read anything.
Bath are displayed in red box on the attached picture.
So
- Is there a way to mask out-of-the drawing zone labels and marks I tried to do something like
But I didn't manage to get the right coordinates.
- Should I use something else than Gantt series ?
Amazing components, apart from that.
Nicolas.
Each TGanttSerie represent a step in a production process, each "line" represent one process. So each bars use its step number as a mark and I use LeftAxis.Items to display the correct labels.
Code: Select all
For <Each Item on the lowest series> do
begin
Chart_VisuOperation.LeftAxis.Items.Add(groupIndex, groupName);
Chart_VisuOperation.LeftAxis.Items.Automatic := False;
end;
As we can have a lot of those lines I want to limit the simultaneous displayed results to 30. Also, as the data can span quite a long period, I limit the bottom axis to up to 60 days.
If there is less than 30 lines or 60 days, I don't put a limit on the axis.
I use two TChartScrollBar to manage the scrolling.
On to the problems :
1) When the marks are out of the main drawing zone but still in the component drawing space, the marks are displayed through the axis labels (this one is annoying but not a major problem)
2) When I scroll the lines vertically, the labels tends to stick on screen and overlap each other. This one is quite problematic as it's quickly impossible to read anything.
Bath are displayed in red box on the attached picture.
So
- Is there a way to mask out-of-the drawing zone labels and marks I tried to do something like
Code: Select all
procedure TForm_Planification.ChartLeftAxisDrawLabel(Sender:TChartAxis;
var aX,aY,aZ:Integer; var aText:String; var aDrawLabel:Boolean);
Var Ymin, Ymax : Integer;
begin
Ymax := Chart_VisuOperation.Series[0].CalcYPos(Ceil(Sender.Minimum));
Ymin := Chart_VisuOperation.Series[0].CalcYPos(Floor(Sender.Maximum));
if ((aY < Ymin) or (aY > Ymax)) Then
aDrawLabel := False;
end;
- Should I use something else than Gantt series ?
Amazing components, apart from that.
Nicolas.