Aspose.Slides.Examples.CSharp.Charts.SetMarkerOptions.Run C# (CSharp) Method

Run() public static method

public static Run ( ) : void
return void
        public static void Run()
        {
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_Charts();

            // Create an instance of Presentation class
            Presentation presentation = new Presentation();

            ISlide slide = presentation.Slides[0];

            // Creating the default chart
            IChart chart = slide.Shapes.AddChart(ChartType.LineWithMarkers, 0, 0, 400, 400);

            // Getting the default chart data worksheet index
            int defaultWorksheetIndex = 0;

            // Getting the chart data worksheet
            IChartDataWorkbook fact = chart.ChartData.ChartDataWorkbook;

            // Delete demo series
            chart.ChartData.Series.Clear();

            // Add new series
            chart.ChartData.Series.Add(fact.GetCell(defaultWorksheetIndex, 1, 1, "Series 1"), chart.Type);
            
            // Set the picture
            System.Drawing.Image image1 = (System.Drawing.Image)new Bitmap(dataDir + "aspose-logo.jpg");
            IPPImage imgx1 = presentation.Images.AddImage(image1);

            // Set the picture
            System.Drawing.Image image2 = (System.Drawing.Image)new Bitmap(dataDir + "Tulips.jpg");
            IPPImage imgx2 = presentation.Images.AddImage(image2);

            // Take first chart series
            IChartSeries series = chart.ChartData.Series[0];

            // Add new point (1:3) there.
            IChartDataPoint point = series.DataPoints.AddDataPointForLineSeries(fact.GetCell(defaultWorksheetIndex, 1, 1, (double)4.5));
            point.Marker.Format.Fill.FillType = FillType.Picture;
            point.Marker.Format.Fill.PictureFillFormat.Picture.Image = imgx1;

            point = series.DataPoints.AddDataPointForLineSeries(fact.GetCell(defaultWorksheetIndex, 2, 1, (double)2.5));
            point.Marker.Format.Fill.FillType = FillType.Picture;
            point.Marker.Format.Fill.PictureFillFormat.Picture.Image = imgx2;

            point = series.DataPoints.AddDataPointForLineSeries(fact.GetCell(defaultWorksheetIndex, 3, 1, (double)3.5));
            point.Marker.Format.Fill.FillType = FillType.Picture;
            point.Marker.Format.Fill.PictureFillFormat.Picture.Image = imgx1;

            point = series.DataPoints.AddDataPointForLineSeries(fact.GetCell(defaultWorksheetIndex, 4, 1, (double)4.5));
            point.Marker.Format.Fill.FillType = FillType.Picture;
            point.Marker.Format.Fill.PictureFillFormat.Picture.Image = imgx2;

            // Changing the chart series marker
            series.Marker.Size = 15;

            // Write presentation to disk
            presentation.Save(dataDir + "MarkOptions_out.pptx", SaveFormat.Pptx);
        }
    }
SetMarkerOptions