很长一段时间,我试图生成这样的图形
我试过的代码.
Excel.Range chartRange1; Excel.ChartObjects xlCharts1 = (Excel.ChartObjects)worksheet.ChartObjects(Type.Missing); Excel.ChartObject myChart1 = (Excel.ChartObject)xlCharts1.Add(350,500,350); Excel.Chart chartPage1 = myChart1.Chart; chartRange1 = worksheet.get_Range("A33","b56"); chartPage1.SetSourceData(chartRange1,Type.Missing); chartPage1.ChartType = Excel.XlChartType.xlBarStacked; Excel.Range xValues = worksheet.Range["B33","B56"]; Excel.Range values = worksheet.Range["a33","a56"]; Excel.SeriesCollection seriesCollection = (Excel.SeriesCollection)chartPage1.SeriesCollection(); Excel.Series series1 = seriesCollection.NewSeries(); series1.XValues = xValues; series1.Values = values;
请帮助我应该使用哪种图表类型,否则我会犯任何错误.一个
更改图表类型后,它完全正常,但它不适用于最后一行文本.如下图所示.