Utilice C# para generar gráficos automáticamente a partir de datos en Excel
private void CreateChart(Excel._Workbook m_Book,Excel._Worksheet m_Sheet,int num)
{
Excel. Rango .ResizeRange;
Excel.Series oSeries;
m_Book.Charts.Add(Missing.Value.oResizeRange = (Excel.Range)m_Sheet.Rows.get_Item(10, Missing. Value );
m_Sheet.Shapes.Item("Chart 1").Top = (float)(double) oResizeRange.Top // Ajusta el margen superior del gráfico
oResizeRange = (Excel.Range)m_Sheet.Columns.get_Item(6, Missing.Value); //Ajusta la posición y el margen superior del gráfico m_Book.ActiveChart.PlotArea.Border.LineStyle = Excel.XlLineStyle.xlLineStyleNone; el área de dibujo Líneas de borde
m_Book.ActiveChart.PlotArea.Width = 400 //Establece el ancho del área de dibujo
//m_Book.ActiveChart.ChartArea.Interior.ColorIndex = 10; //Establecer el color de fondo de todo el gráfico
//m_Book.ActiveChart.ChartArea.Border.LineStyle = Excel.XlLineStyle.xlLineStyleNone //Establecer la línea del borde del área de dibujo