2012-11-02 11 views

risposta

8

Infine, ho trovato la mia risposta. Link rif: http://epplus.codeplex.com/wikipage?title=FAQ

Come posso aggiungere una serie con un tipo di grafico diverso al mio grafico?

Ecco come si fa ...

ExcelChart chart = worksheet.Drawings.AddChart("chtLine", eChartType.LineMarkers);   
var serie1= chart.Series.Add(Worksheet.Cells["B1:B4"],Worksheet.Cells["A1:A4"]); 
//Now for the second chart type we use the chart.PlotArea.ChartTypes collection... 
var chartType2 = chart.PlotArea.ChartTypes.Add(eChartType.ColumnClustered); 
var serie2 = chartType2.Series.Add(Worksheet.Cells["C1:C4"],Worksheet.Cells["A1:A4"]); 
+0

Avete un idea di come posso applicare datalabel.showvalue = true per la solo serie2 ?? Grazie in anticipo –

1

Si può fare in questo modo ...

var chartType2 = chart.PlotArea.ChartTypes.Add(eChartType.ColumnClustered)as ExcelBarChart; 
(ExcelBarChartSerie) serie2 = (ExcelBarChartSerie) chartType2.Series.Add(Worksheet.Cells["C1:C4"],Worksheet.Cells["A1:A4"]); 
serie2.DataLabel.ShowValue = true; 
Problemi correlati