public static Chart CreateChartByLegend(Table table,string CellRange,ChartTypes type,string legendPos,string Xpos,string Ypos,string XAxisname,string YAxisname)
{
Chart chart = CreateChart(table,type,CellRange);
chart.ChartLegend .LegendPosition = legendPos;
chart.ChartLegend .SvgX = Xpos;
chart.ChartLegend .SvgY = Ypos;
chart.XAxisName = XAxisname;
chart.YAxisName = YAxisname;
return chart;
}