Page 1 of 1

Invert axis / Legend in a chart

Posted: Tue Jan 25, 2022 1:44 pm
by briaume
Hi,

I'm working on an export of a graphic on my delphi application from a datagrid.

Here an exemple of my Grid :

Opérateur CCA | CCB | DIL |
GO (Input time) | 0 | 0 | 13 |
GO (Opening time) | 0 | 0 | 139|
NTM (Input time) | 16 | 2 | 2 |
NTM (Opening time) | 16 | 7 | 8 |

Hier is the code :

Code: Select all

RCells:=XLSReadWriteII51[0].CreateRelativeCells;
     RCells.SetArea(0,3,3,7);
     ChartSpace:=XLSReadWriteII51[0].Drawing.Charts.MakeBarChart(RCells,0,LigneActuelle+1,True,False);
     ChartSpace.Chart.PlotArea.Create_BarChart;
     ChartSpace.Chart.PlotArea.BarChart..Shared.Create_BarDir;
     ChartSpace.Chart.PlotArea.BarChart.Shared.BarDir.Val:=stbdBar;
     ChartSpace.Chart.Create_Legend;
     ChartSpace.Chart.Legend.Create_LegendPos;
     ChartSpace.Chart.Legend.Create_SpPr;
     ChartSpace.Chart.Legend.LegendPos.Val:=stlpR;
     ChartSpace.Chart.PlotArea.BarChart.Create_Overlap;
     ChartSpace.Chart.PlotArea.BarChart.Overlap.Val:=3;
The problem is in default configuration my axis is "GO (Input time)" / "GO (Opening time) " / "NTM (Input time)" / "NTM (Opening time)" and my legend is : "Opérateur CCA"/ "CCB"/ "DIL".

And I want the exact reverse, so, Legend : "GO (Input time)" / "GO (Opening time) " / "NTM (Input time)" / "NTM (Opening time)" and axis "Opérateur CCA"/ "CCB"/ "DIL" :

In excel I have a function to invert the axis and the legend automatically in the chart but I don't find this function or procedure in your component.

Do you have a solution to make that with an inversion on the legend and axis or with an other solution ?

Thank you and sorry for my english.