Stacked bar 100% chart

Questions and answers on how to use XLSReadWriteII 5.
Post Reply
Noemie23
Posts: 5
Joined: Thu Sep 12, 2013 2:31 pm

Stacked bar 100% chart

Post by Noemie23 »

Dear all,

I'm using TXLSReadWriteII to create XLSX files where I would like to create chart. I am currently running some tests and I have trouve selecting the exact type of chart I need.

Here is my small sample .

Code: Select all

   Procedure CreateChart;

   Var
      RCells    : TXLSRelCells;
      ChartSpace: TCT_ChartSpace;
   Begin
        RCells:=xlsReadWrite[1].CreateRelativeCells;
        //Data area
        RCells.SetArea(0,9,1,12);

        //Chart
        ChartSpace:=xlsReadWrite[1].Drawing.Charts.MakeBarChart(RCells,0,15,True);
   End;


I need to create a stacked bar chart for 100% and I don't know how to manage my chart properties.

Could you please help me or maybe give me a sample that could help me?

You will find here a screenshot of what I would need to create through your component.
[img]
https://drive.google.com/open?id=1r2_hG ... J1L9IxrQVA
[/img]

Thanks a lot

Noémie
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: Stacked bar 100% chart

Post by larsa »

Hello

Sorry, I have no idea how to create such a chart. Figuring out how to create it will probably take a day or so. I can't do this for free, to much work. But if you are interested in this as a payed service, please let me know and I can give you an offer.
Lars Arvidsson, Axolot Data
Noemie23
Posts: 5
Joined: Thu Sep 12, 2013 2:31 pm

Re: Stacked bar 100% chart

Post by Noemie23 »

Dear Larsa,

Thank you for your answer,

I managed to find a solution :

Code: Select all

Procedure CreateChart;

Var
	RCells    : TXLSRelCells;
	ChartSpace: TCT_ChartSpace;
Begin
	RCells:=xlsReadWrite[1].CreateRelativeCells;
	//Chart Area
	RCells.SetArea(2,7,5,8);

	//Chart creation
	ChartSpace:=xlsReadWrite[1].Drawing.Charts.MakeBarChart(RCells,0,15,True);

	//Horizontal
	ChartSpace.Chart.PlotArea.BarChart.Shared.Create_BarDir;
	ChartSpace.Chart.PlotArea.BarChart.Shared.BarDir.Val:=stbdBar;

	//Stacked
	ChartSpace.Chart.PlotArea.BarChart.Shared.Create_Grouping;
	ChartSpace.Chart.PlotArea.BarChart.Shared.Grouping.Val:=stbgPercentStacked;

	//Overlap
	ChartSpace.Chart.PlotArea.BarChart.Create_Overlap;
	ChartSpace.Chart.PlotArea.BarChart.Overlap.Val:=100;
End;
Post Reply