Hello,
We are basically thinking of using Aspose.net word product for some of our existing SSRS reports where we can give users flexibility of updating doc templates with static text.
While exploring i got stuck with charts which is mandatory as it needs to be as it is shown in SSRS report, its a stacked col chart.
I have used some sample code and created a stacked chart but the output it creates is not proper like a sum of stack to be shown at top of the col etc.
DocumentBuilder builder = new DocumentBuilder(doc);
builder.MoveToMergeField("ColChart");
// Add chart with default data. You can specify different chart types and sizes.
Shape shape = builder.InsertChart(ChartType.ColumnStacked, 432, 252);
// Chart property of Shape contains all chart related options.
Chart chart = shape.Chart;
// Get chart series collection.
ChartSeriesCollection seriesColl = chart.Series;
// Check series count.
Console.WriteLine(seriesColl.Count);
// Delete default generated series.
seriesColl.Clear();
// Create category names array, in this example we have two categories.
string[] categories = new string[] { "AW Category 1", "AW Category 2" , "AW Category 3" };
// Adding new series. Please note, data arrays must not be empty and arrays must be the same size.
seriesColl.Add("AW Series 1", categories, new double[] { 4,0,0 });
seriesColl.Add("AW Series 2", categories, new double[] { 7,0,0 });
seriesColl.Add("AW Series 4", categories, new double[] { 0,40,0 });
seriesColl.Add("AW Series 5", categories, new double[] { 0, 0, 50 });
// chart.AxisY.Hidden = true;
foreach (var col in seriesColl)
{
col.DataLabels.ShowValue = true;
col.DataLabels.ShowSeriesName = false;
col.DataLabels.ShowCategoryName = false;
}
I have attached both code, current output and expected output.
Please let us know if its feasible in Aspose.net word.
Stackec col chart.zip (14.6 KB)