You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: slides/english/net/charts/change-color-of-categories/example.txt
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
1
//ExStart
2
2
//ExSummary: This code demonstrates how to create a PowerPoint presentation with a chart, modify a data point's fill color, and save the presentation as a .pptx file.
3
-
//ExStepSummary:0:Initialize the data directory path and create a new presentation instance.
4
-
//ExStepSummary:1:Add a clustered column chart to the first slide.
5
-
//ExStepSummary:2:Access the first data point in the first series of the chart.
6
-
//ExStepSummary:3:Modify the data point's fill type to solid and set its color to blue.
7
-
//ExStepSummary:4:Save the presentation in .pptx format.
3
+
//ExStepSummary:0:Initialize the path to the directory where the PowerPoint document will be saved.
4
+
//ExStepSummary:1: Create a new PowerPoint presentation and add a clustered column chart to the first slide with specified position and dimensions.
5
+
//ExStepSummary:2:Access the first data point in the first series of the chart and change its fill type to solid.
6
+
//ExStepSummary:3: Set the color of the first data point's solid fill to blue.
7
+
//ExStepSummary:4:Save the presentation as a PowerPoint file (.pptx) in the specified directory.
8
8
//ExStepImage:1:images/1.png
9
9
//ExStepImage:2:images/2.png
10
10
//ExStepImage:3:images/3.png
@@ -22,10 +22,10 @@ using (Presentation pres = new Presentation())
22
22
//ExStep:2-
23
23
// Access the first data point in the first series of the chart
24
24
IChartDataPoint point = chart.ChartData.Series[0].DataPoints[0];
25
-
25
+
// Modify the data point's fill type to solid
26
+
point.Format.Fill.FillType = FillType.Solid;
26
27
//ExStep:3-
27
-
// Modify the data point's fill type to solid and set its color to blue
28
-
point.Format.Fill.FillType = FillType.Solid;
28
+
// Modify the data point's fill type to set its color to blue
0 commit comments