public void CreateNewChart()
{
SpreadsheetDocument doc = new SpreadsheetDocument ();
doc.New ();
Table table = new Table (doc,"tab1","tab1");
for(int i=1; i<=1; i++)
{
for(int j=1; j<=6;j++)
{
Cell cell = table.CreateCell ();
cell.OfficeValueType ="float";
Paragraph paragraph = new Paragraph (doc);
string text= (j+i-1).ToString();
paragraph.TextContent .Add (new SimpleText ( doc,text));
cell.Content.Add(paragraph);
cell.OfficeValueType = "string";
cell.OfficeValue = text;
table.InsertCellAt (i, j, cell);
}
}
Chart chart=ChartBuilder.CreateChartByAxisName
(table,ChartTypes.bar ,"A1:E4","years","dollars");
Assert.AreEqual(7, table.Rows[1].Cells.Count);
Assert.AreEqual(6, table.Rows[2].Cells.Count);
Assert.AreEqual(6, table.Rows[3].Cells.Count);
Assert.AreEqual(6, table.Rows[4].Cells.Count);
/*Chart chart = new Chart (table,"ch1");
chart.ChartType=ChartTypes.bar .ToString () ;
chart.XAxisName ="yeer";
chart.YAxisName ="dollar";
chart.CreateFromCellRange ("A1:E4");
chart.EndCellAddress ="tab1.K17";*/
table.InsertChartAt ("G2",chart);
doc.Content .Add (table);
doc.SaveTo(Path.Combine(AARunMeFirstAndOnce.outPutFolder, @"NewChartOne.ods"));
}