Thanks for demo.
This issue, unfortunately, is not covered by the tutorial which has a separate chartsource for the labels. In your case, however, the axis labels are taken from the same chartsource which also provides the x/y values.
When you use the Marks.Style for the bottom axis of an unrotated chart (vertical bars) the labels are drawn at the x values of the ChartSource items.
When the bars are rotated the labels should still be drawn at the x positions, but since the vertical axis still is the y axis internally it picks the coordinates from the y value of the data point.
An axis does not "know" whether it is drawn for a normal or a rotated series, and therefore it cannot detect automatically that it should pick the other coordinate for label positioning of a rotated series. (This is different from the series which has the AxisIndexX and AxisIndexY properties).
Of course you can help the axis and exchange the x/y values in another chartsource assigned to the Marks.Source of the left axis. You can use a UserDefinedChartSource which picks the data from the main chartsource and swaps x and y.
procedure TForm1.UserDefinedChartSource1GetChartDataItem(
ASource: TUserDefinedChartSource; AIndex: Integer; var AItem: TChartDataItem);
begin
AItem.X := PublicPrioritaire.Item[AIndex]^.Y;
AItem.Y := PublicPrioritaire.Item[AIndex]^.X;
AItem.Text := PublicPrioritaire.Item[AIndex]^.Text;
end;
Don't forget to set the PointsNumber of the UserDefinedChartSource to the data point count of the ListChartSource which provides the data:
procedure TForm1.FormShow(Sender: TObject);
begin
PublicPrioritaire.Clear;
PublicPrioritaire.Add(0, 29, 'Nord');
PublicPrioritaire.Add(1, 15, 'Sud');
PublicPrioritaire.Add(2, 11, 'Est');
PublicPrioritaire.Add(3, 5, 'Ouest');
UserDefinedChartSource1.PointsNumber := PublicPrioritaire.Count;
end;
Assign this UserDefinedChartSource to the Marks.Source of the LeftAxis, and set its Marks.Style to smsLabel.