Skip to content

Commit fb430a9

Browse files
Update example.txt
1 parent 52653d4 commit fb430a9

File tree

1 file changed

+8
-8
lines changed
  • slides/english/net/charts/change-color-of-categories

1 file changed

+8
-8
lines changed

slides/english/net/charts/change-color-of-categories/example.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
//ExStart
22
//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.
88
//ExStepImage:1:images/1.png
99
//ExStepImage:2:images/2.png
1010
//ExStepImage:3:images/3.png
@@ -22,10 +22,10 @@ using (Presentation pres = new Presentation())
2222
//ExStep:2-
2323
// Access the first data point in the first series of the chart
2424
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;
2627
//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
2929
point.Format.Fill.SolidFillColor.Color = Color.Blue;
3030

3131
//ExStep:4-

0 commit comments

Comments
 (0)