PNG JPG BMP TIFF PPT
Aspose.Slides  for .NET

Grafici di formati PPT in C#

Grafici di documenti PPT nativi e ad alte prestazioni che utilizzano Aspose.Slides lato server per API .NET, senza l’uso di software come Microsoft o Adobe PDF.

Come creare grafici PPT usando C#

Per creare grafici PPT, utilizzeremo

Aspose.Slides per .NET

API che è un’API di manipolazione dei documenti ricca di funzionalità, potente e facile da usare per la piattaforma C#. Aprire

NuGet

gestore pacchetti, cerca Aspose.Slides e installa. È inoltre possibile utilizzare il seguente comando dalla Console di gestione pacchetti.

Comando


PM> Install-Package Aspose.Slides.NET

Passaggi per creare grafici di file PPT in C#

Una creazione di grafici di documenti di base con le API Aspose.Slides for .NET può essere eseguita con poche righe di codice.

  1. Crea oggetto classe Presentazione.

  2. Seleziona Diapositiva.

  3. Aggiungi il grafico alla diapositiva.

  4. Aggiungi serie di grafici pertinenti con i dati.

  5. Salva file PPT

Requisiti di sistema

Le nostre API sono supportate su tutte le principali piattaforme e sistemi operativi. Prima di eseguire il codice seguente, assicurati di avere i seguenti prerequisiti sul tuo sistema.

  • Microsoft Windows o un sistema operativo compatibile con piattaforme .NET Framework, .NET Core, Windows Azure, Mono o Xamarin
  • Ambiente di sviluppo come Microsoft Visual Studio
  • Aspose.Slides per .NET DLL a cui si fa riferimento nel progetto - Installa da NuGet utilizzando il pulsante Download sopra
 

Crea un grafico di file PPT - C#

//Creating Charts in a Presentation
    Presentation pres = new Presentation();
    
    ISlide slide = pres.Slides[0];
    
    //Creating the default chart
    IChart chart = slide.Shapes.AddChart(ChartType.ScatterWithSmoothLines, 0, 0, 400, 400);
    
    //Getting the default chart data worksheet index
    int defaultWorksheetIndex = 0;
    
    //Accessing the chart data worksheet
    IChartDataCellFactory fact = chart.ChartData.ChartDataCellFactory;
    
    //Delete demo series
    chart.ChartData.Series.Clear();
    
    //Add new series
    chart.ChartData.Series.Add(fact.GetCell(defaultWorksheetIndex, 1, 1, "Series 1"), chart.Type);
    chart.ChartData.Series.Add(fact.GetCell(defaultWorksheetIndex, 1, 3, "Series 2"), chart.Type);
    
    //Take first chart series
    IChartSeries series = chart.ChartData.Series[0];
    
    //Add new point (1:3) there.
    series.DataPoints.AddDataPointForScatterSeries(fact.GetCell(defaultWorksheetIndex, 2, 1, 1), fact.GetCell(defaultWorksheetIndex, 2, 2, 3));
    
    //Add new point (2:10)
    series.DataPoints.AddDataPointForScatterSeries(fact.GetCell(defaultWorksheetIndex, 3, 1, 2), fact.GetCell(defaultWorksheetIndex, 3, 2, 10));
    
    //Edit the type of series
    series.Type = ChartType.ScatterWithStraightLinesAndMarkers;
    
    //Changing the chart series marker
    series.Marker.Size = 10;
    series.Marker.Symbol = MarkerStyleType.Star;
    
    //Take second chart series
    series = chart.ChartData.Series[1];
    
    //Add new point (5:2) there.
    series.DataPoints.AddDataPointForScatterSeries(fact.GetCell(defaultWorksheetIndex, 2, 3, 5), fact.GetCell(defaultWorksheetIndex, 2, 4, 2));
    
    //Add new point (3:1)
    series.DataPoints.AddDataPointForScatterSeries(fact.GetCell(defaultWorksheetIndex, 3, 3, 3), fact.GetCell(defaultWorksheetIndex, 3, 4, 1));
    
    //Add new point (2:2)
    series.DataPoints.AddDataPointForScatterSeries(fact.GetCell(defaultWorksheetIndex, 4, 3, 2), fact.GetCell(defaultWorksheetIndex, 4, 4, 2));
    
    //Add new point (5:1)
    series.DataPoints.AddDataPointForScatterSeries(fact.GetCell(defaultWorksheetIndex, 5, 3, 5), fact.GetCell(defaultWorksheetIndex, 5, 4, 1));
    
    //Changing the chart series marker
    series.Marker.Size = 10;
    series.Marker.Symbol = MarkerStyleType.Circle;
    
    pres.Save("AsposeScatterChart.ppt", SaveFormat.Ppt);  

    
 
  • Informazioni su Aspose.Slides per .NET API

    L’API Aspose.Slides può essere utilizzata per leggere, scrivere, manipolare e convertire documenti Microsoft PowerPoint in PDF, XPS, HTML, TIFF, ODP e vari altri formati. Si possono creare nuovi file da zero e salvarli nei relativi formati supportati. Aspose.Slides è un’API standalone per la creazione, l’analisi o la manipolazione di presentazioni, diapositive ed elementi e non dipende da alcun software come Microsoft o OpenOffice. Genera grafico PPT(X), diagramma PPT(X) dai dati di Excel, in base al modello di grafico.

    Online PPT Chart Creation Live Demos

    Generate PPT documents charts right now by visiting our Live Demos website . The live demo has the following benefits

      No need to download Aspose API.
      No need to write any code.
      Just upload your PPT files.
      Chart will be created instantly.

    PPT Cos'è il formato file PPT

    A file with PPT extension represents PowerPoint file that consists of a collection of slides for displaying as SlideShow. It specifies the Binary File Format used by Microsoft PowerPoint 97-2003. A PPT file can contain several different types of information such as text, bulleted points, images, multimedia and other embedded OLE objects. Microsoft came up with newer file format for PowerPoint, known as PPTX, from 2007 onwards that is based on Office OpenXML and is different from this binary file format. Several other application programs such as OpenOffice Impress and Apple Keynote can also create PPT files.

    Leggi di più

    Altri formati grafici supportati

    Utilizzando C#, è possibile gestire facilmente la creazione di grafici con diversi formati, tra cui.

    PPTX (Apri il formato di presentazione XML)