public static Chart CreateChartByAxises(Table table,string CellRange,ChartTypes type,int dimension)
{
Chart chart = CreateChart(table,type,CellRange);
if (dimension==1)
{
ChartAxis Yaxis = CreateAxis(chart,"y","primary-y");
chart.ChartPlotArea .AxisCollection .Add (Yaxis);
Yaxis.AxesStyle .AxesProperties .DisplayLabel = "true";
}
else if (dimension==2)
{
ChartAxis Yaxis = CreateAxis(chart,"y","primary-y");
chart.ChartPlotArea .AxisCollection .Add (Yaxis);
ChartAxis Xaxis = CreateAxis(chart,"x","primary-x");
chart.ChartPlotArea .AxisCollection .Add (Xaxis);
Yaxis.AxesStyle .AxesProperties .DisplayLabel = "true";
Xaxis.AxesStyle .AxesProperties .DisplayLabel = "true";
}
else
{
ChartAxis Yaxis = CreateAxis(chart,"y","primary-y");
chart.ChartPlotArea .AxisCollection .Add (Yaxis);
ChartAxis Xaxis = CreateAxis(chart,"x","primary-x");
chart.ChartPlotArea .AxisCollection .Add (Xaxis);
ChartAxis Zaxis = CreateAxis(chart,"z","primary-z");
chart.ChartPlotArea .AxisCollection .Add (Zaxis);
Yaxis.AxesStyle .AxesProperties .DisplayLabel = "true";
Xaxis.AxesStyle .AxesProperties .DisplayLabel = "true";
Zaxis.AxesStyle .AxesProperties .DisplayLabel = "true";
chart.ChartPlotArea .PlotAreaStyle.PlotAreaProperties.ThreeDimensional="true";
}
return chart;
}