public static Chart CreateChartByCellRange(Table table,string cellRange,ChartTypes type,string xAxisname,string yAxisname,string title,int dimension,string legendPos,string endCellAddress)
{
Chart chart;
if (dimension!=0&&dimension<=3)
{
chart = CreateChartByAxises(table,cellRange,type,dimension);
}
else
{
chart = CreateChart(table,type,cellRange);
}
if (xAxisname!=null)
chart.XAxisName = xAxisname;
if (yAxisname!=null)
chart.YAxisName = yAxisname;
if (title!=null)
chart.ChartTitle .SetTitle (title);
if (legendPos!=null)
chart.ChartLegend .LegendPosition = legendPos;
else
chart.ChartLegend .LegendPosition = "left";
if (endCellAddress!=null)
chart.EndCellAddress = table.TableName +"."+endCellAddress;
return chart;
}