Mới trong v1. 23. tạo tệp PPTX bằng cách sử dụng cấu hình và PPTX hiện có làm mẫu. Kết quả là một PPTX mới mà người dùng có thể tải xuống
Dưới đây là một ví dụ về thay thế văn bản đơn giản
url:
pptxhandler/ppt:
pattern: /$YAMLURL/ppt
handler: PPTXHandler
kwargs:
only: 1
source: $YAMLPATH/input.pptx # Input file to load
change-text: # First rule is called change-text
Title 1: # Find all shapes named "Title 1" in all slide number 1
text: Generated by Gramex # Replace their text
headers:
Content-Disposition: attachment; filename=output.pptx
Ghi chú. tất cả các ví dụ sử dụng các trang trình bày cụ thể từ ví dụ đầu vào. pptx
Các quy tắc được dựa trên những gì được mô tả dưới đây
PPTGen cho phép bạn sửa đổi nội dung của bản trình bày PowerPoint dựa trên dữ liệu. Ví dụ, bạn có thể
- Cập nhật biểu đồ, hình ảnh và văn bản từ dữ liệu
- Tạo một loạt trang chiếu bằng mẫu từ bảng tính hoặc cơ sở dữ liệu
Nó là một tiện ích dòng lệnh và một chức năng Python được đóng gói với Gramex. Nó tạo thành cơ sở của PPTXHandler
Thư viện PPTGen
Thư viện PPTGen chấp nhận một cấu hình làm đối số của nó. Ví dụ
from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
Đây là một ví dụ khác thay đổi biểu đồ thanh dựa trên dữ liệu
import pandas as pd
from gramex.pptgen import pptgen
data = {'chart_data': pd.read_csv['data.csv']}
pptgen[
source='input.pptx',
target='output.pptx',
edit_chart={
'Bar Chart Shape Name': {
'chart': {
'data': data['chart_data'],
'x': 'Category',
'size': 'PreY',
'color': {
'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}"
}
}
}
}
]
Cấu hình chấp nhận các khóa cấp cao nhất sau đây
8 bắt buộc. Đường dẫn đến đầu vào / nguồn PPTXimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
9 tùy chọn. Đường dẫn lưu PPTX đầu ra/đích. Nếu Không,import pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
0 trả về đối tượng Bản trình bàysource: input.pptx # optional path to source. Default to blank PPT with 1 slide target: output.pptx # required path to save output as change: Title 1: # Take the shape named "Title 1" text: New Title # Replace its text with "New Title"
1 tập dữ liệu tùy chọn hoặc từ điển. Điều này được mô tả dưới đâysource: input.pptx # optional path to source. Default to blank PPT with 1 slide target: output.pptx # required path to save output as change: Title 1: # Take the shape named "Title 1" text: New Title # Replace its text with "New Title"
2 Chấp nhận số trang chiếu hoặc danh sách số trang chiếu bắt đầu từ 1. Nếu được xác định, trong bản trình bày đầu ra sẽ chỉ có sẵn các trang chiếu được chọn. Giả sử có 10 slide trong một bài thuyết trình nhưng người dùng đã xác địnhsource: input.pptx # optional path to source. Default to blank PPT with 1 slide target: output.pptx # required path to save output as change: Title 1: # Take the shape named "Title 1" text: New Title # Replace its text with "New Title"
3 trong phầnsource: input.pptx # optional path to source. Default to blank PPT with 1 slide target: output.pptx # required path to save output as change: Title 1: # Take the shape named "Title 1" text: New Title # Replace its text with "New Title"
4 thì chỉ slide số 1 sẽ có sẵn trong đầu ra, tương tự slide số 1 và 2 sẽ có sẵn trong bài thuyết trình đầu ra nếusource: input.pptx # optional path to source. Default to blank PPT with 1 slide target: output.pptx # required path to save output as change: Title 1: # Take the shape named "Title 1" text: New Title # Replace its text with "New Title"
5source: input.pptx # optional path to source. Default to blank PPT with 1 slide target: output.pptx # required path to save output as change: Title 1: # Take the shape named "Title 1" text: New Title # Replace its text with "New Title"
6 Tùy chọn đăng ký bất kỳ lệnh tùy chỉnh mới nào cho pptgen. Nó chấp nhận một hàm chấp nhận ba tham sốsource: input.pptx # optional path to source. Default to blank PPT with 1 slide target: output.pptx # required path to save output as change: Title 1: # Take the shape named "Title 1" text: New Title # Replace its text with "New Title"
7,source: input.pptx # optional path to source. Default to blank PPT with 1 slide target: output.pptx # required path to save output as change: Title 1: # Take the shape named "Title 1" text: New Title # Replace its text with "New Title"
8 vàsource: input.pptx # optional path to source. Default to blank PPT with 1 slide target: output.pptx # required path to save output as change: Title 1: # Take the shape named "Title 1" text: New Title # Replace its text with "New Title"
9. Các lệnhsource: input.pptx # optional path to source. Default to blank PPT with 1 slide target: output.pptx # required path to save output as change: Title 1: # Take the shape named "Title 1" text: New Title # Replace its text with "New Title"
0 có sẵn trong pptgen làsource: input.pptx target: output.pptx rule-1: # rule-1 applies to all slides ... rule-2: slide-number: 1 # rule-2 applies only to the first slide of the source ... rule-3: slide-title: Hello # rule-3 applies to slides with the title "Hello" [regex] ... ...
1,source: input.pptx target: output.pptx rule-1: # rule-1 applies to all slides ... rule-2: slide-number: 1 # rule-2 applies only to the first slide of the source ... rule-3: slide-title: Hello # rule-3 applies to slides with the title "Hello" [regex] ... ...
2,source: input.pptx target: output.pptx rule-1: # rule-1 applies to all slides ... rule-2: slide-number: 1 # rule-2 applies only to the first slide of the source ... rule-3: slide-title: Hello # rule-3 applies to slides with the title "Hello" [regex] ... ...
3,source: input.pptx target: output.pptx rule-1: # rule-1 applies to all slides ... rule-2: slide-number: 1 # rule-2 applies only to the first slide of the source ... rule-3: slide-title: Hello # rule-3 applies to slides with the title "Hello" [regex] ... ...
4,source: input.pptx target: output.pptx rule-1: # rule-1 applies to all slides ... rule-2: slide-number: 1 # rule-2 applies only to the first slide of the source ... rule-3: slide-title: Hello # rule-3 applies to slides with the title "Hello" [regex] ... ...
5,source: input.pptx target: output.pptx rule-1: # rule-1 applies to all slides ... rule-2: slide-number: 1 # rule-2 applies only to the first slide of the source ... rule-3: slide-title: Hello # rule-3 applies to slides with the title "Hello" [regex] ... ...
6,source: input.pptx target: output.pptx rule-1: # rule-1 applies to all slides ... rule-2: slide-number: 1 # rule-2 applies only to the first slide of the source ... rule-3: slide-title: Hello # rule-3 applies to slides with the title "Hello" [regex] ... ...
7,source: input.pptx target: output.pptx rule-1: # rule-1 applies to all slides ... rule-2: slide-number: 1 # rule-2 applies only to the first slide of the source ... rule-3: slide-title: Hello # rule-3 applies to slides with the title "Hello" [regex] ... ...
8,source: input.pptx target: output.pptx rule-1: # rule-1 applies to all slides ... rule-2: slide-number: 1 # rule-2 applies only to the first slide of the source ... rule-3: slide-title: Hello # rule-3 applies to slides with the title "Hello" [regex] ... ...
9,source: input.pptx target: output.pptx rule-1: # rule-1 applies to all slides ... rule-2: slide-number: 1 # rule-2 applies only to the first slide of the source ... rule-3: slide-title: Hello # rule-3 applies to slides with the title "Hello" [regex] ... ...
0 vàrule-1: Title 1: # Shape name "Title 1" will be updated by text "New title" text: New title style: # Text color will be `red`[accepts only hex color code in 6 digit] color: '#ff0000' Text 1: # Shape name "Text 1" will be updated by text "New text" text: New text style: # Text color will be `green`[accepts only hex color code in 6 digit] color: '#00ff00' bold: True # Text will appear in bold
1rule-1: Title 1: # Shape name "Title 1" will be updated by text "New title" text: New title style: # Text color will be `red`[accepts only hex color code in 6 digit] color: '#ff0000' Text 1: # Shape name "Text 1" will be updated by text "New text" text: New text style: # Text color will be `green`[accepts only hex color code in 6 digit] color: '#00ff00' bold: True # Text will appear in bold
- Tất cả các khóa khác được coi là quy tắc được mô tả bên dưới
Dữ liệu
PPTGen có thể thay đổi bài thuyết trình với dữ liệu từ nhiều nguồn khác nhau. Nó sử dụng
rule-1:
Title 1: # Shape name "Title 1" will be updated by text "New title"
text: New title
style: # Text color will be `red`[accepts only hex color code in 6 digit]
color: '#ff0000'
Text 1: # Shape name "Text 1" will be updated by text "New text"
text: New text
style: # Text color will be `green`[accepts only hex color code in 6 digit]
color: '#00ff00'
bold: True # Text will appear in bold
2. Nó hỗ trợ các phím này
3 Pandas DataFrame, URL sqlalchemy hoặc tên tệprule-1: Title 1: # Shape name "Title 1" will be updated by text "New title" text: New title style: # Text color will be `red`[accepts only hex color code in 6 digit] color: '#ff0000' Text 1: # Shape name "Text 1" will be updated by text "New text" text: New text style: # Text color will be `green`[accepts only hex color code in 6 digit] color: '#00ff00' bold: True # Text will appear in bold
- Phần mở rộng tệp
4 [nếu url là một tệp]. Mặc định cho tiện ích mở rộng urlrule-1: Title 1: # Shape name "Title 1" will be updated by text "New title" text: New title style: # Text color will be `red`[accepts only hex color code in 6 digit] color: '#ff0000' Text 1: # Shape name "Text 1" will be updated by text "New text" text: New text style: # Text color will be `green`[accepts only hex color code in 6 digit] color: '#00ff00' bold: True # Text will appear in bold
5 bộ lọc tùy chọn để áp dụng cho tập dữ liệu. Được thông qua như một danh sách chính tảrule-1: Title 1: # Shape name "Title 1" will be updated by text "New title" text: New title style: # Text color will be `red`[accepts only hex color code in 6 digit] color: '#ff0000' Text 1: # Shape name "Text 1" will be updated by text "New text" text: New text style: # Text color will be `green`[accepts only hex color code in 6 digit] color: '#00ff00' bold: True # Text will appear in bold
- Tên bảng
6 [nếu url là URL SQLAlchemy]rule-1: Title 1: # Shape name "Title 1" will be updated by text "New title" text: New title style: # Text color will be `red`[accepts only hex color code in 6 digit] color: '#ff0000' Text 1: # Shape name "Text 1" will be updated by text "New text" text: New text style: # Text color will be `green`[accepts only hex color code in 6 digit] color: '#00ff00' bold: True # Text will appear in bold
7 truy vấn SQL tùy chọn để thực thi [nếu url là cơ sở dữ liệu]rule-1: Title 1: # Shape name "Title 1" will be updated by text "New title" text: New title style: # Text color will be `red`[accepts only hex color code in 6 digit] color: '#ff0000' Text 1: # Shape name "Text 1" will be updated by text "New text" text: New text style: # Text color will be `green`[accepts only hex color code in 6 digit] color: '#00ff00' bold: True # Text will appear in bold
8 biến đổi trong bộ nhớ tùy chọn. Lấy một DataFrame và trả về một DataFramerule-1: Title 1: # Shape name "Title 1" will be updated by text "New title" text: New title style: # Text color will be `red`[accepts only hex color code in 6 digit] color: '#ff0000' Text 1: # Shape name "Text 1" will be updated by text "New text" text: New text style: # Text color will be `green`[accepts only hex color code in 6 digit] color: '#00ff00' bold: True # Text will appear in bold
- Bất kỳ khóa bổ sung nào được chuyển đến
9 hoặcrule-1: Title 1: # Shape name "Title 1" will be updated by text "New title" text: New title style: # Text color will be `red`[accepts only hex color code in 6 digit] color: '#ff0000' Text 1: # Shape name "Text 1" will be updated by text "New text" text: New text style: # Text color will be `green`[accepts only hex color code in 6 digit] color: '#00ff00' bold: True # Text will appear in bold
0source: input.pptx target: output.pptx change-image: Group 1: # Take the shape named "Group 1" Caption: # Find the shape named "Caption" inside it text: New caption # Change its text to "New caption" Picture: # Find the shape named "Picture" inside it image: $YAMLPATH/sample.png # Replace the image with sample.png
Thí dụ. -
Quy tắc
Cấu hình có thể xác định bất kỳ số lượng quy tắc nào. Nội quy có
- một hoặc nhiều và danh sách áp dụng cho những hình dạng đó
- một tùy chọn hạn chế chúng áp dụng cho slide nào. Theo mặc định, các quy tắc áp dụng cho tất cả các trang trình bày
Trong ví dụ bên dưới, có 1 quy tắc tên là
source: input.pptx
target: output.pptx
change-image:
Group 1: # Take the shape named "Group 1"
Caption: # Find the shape named "Caption" inside it
text: New caption # Change its text to "New caption"
Picture: # Find the shape named "Picture" inside it
image: $YAMLPATH/sample.png # Replace the image with sample.png
1. Nó không có bộ chọn trang chiếu, vì vậy nó áp dụng cho tất cả các trang chiếu. Nó có 1 hình dạng. source: input.pptx
target: output.pptx
change-image:
Group 1: # Take the shape named "Group 1"
Caption: # Find the shape named "Caption" inside it
text: New caption # Change its text to "New caption"
Picture: # Find the shape named "Picture" inside it
image: $YAMLPATH/sample.png # Replace the image with sample.png
2 với 1 lệnh. source: input.pptx
target: output.pptx
rule-1: # rule-1 applies to all slides
...
rule-2:
slide-number: 1 # rule-2 applies only to the first slide of the source
...
rule-3:
slide-title: Hello # rule-3 applies to slides with the title "Hello" [regex]
...
...
2 source: input.pptx # optional path to source. Default to blank PPT with 1 slide
target: output.pptx # required path to save output as
change:
Title 1: # Take the shape named "Title 1"
text: New Title # Replace its text with "New Title"
Chạy ví dụ
trang trình bày
Theo mặc định, các thay đổi được áp dụng cho tất cả các trang chiếu. Để hạn chế các thay đổi đối với một slide cụ thể, hãy sử dụng
4 số trang hoặc danh sách [với trang đầu tiên là trang 1]source: input.pptx target: output.pptx change-image: Group 1: # Take the shape named "Group 1" Caption: # Find the shape named "Caption" inside it text: New caption # Change its text to "New caption" Picture: # Find the shape named "Picture" inside it image: $YAMLPATH/sample.png # Replace the image with sample.png
5 là một biểu thức chính quy phù hợp với tiêu đề trang chiếusource: input.pptx target: output.pptx change-image: Group 1: # Take the shape named "Group 1" Caption: # Find the shape named "Caption" inside it text: New caption # Change its text to "New caption" Picture: # Find the shape named "Picture" inside it image: $YAMLPATH/sample.png # Replace the image with sample.png
source: input.pptx
target: output.pptx
rule-1: # rule-1 applies to all slides
...
rule-2:
slide-number: 1 # rule-2 applies only to the first slide of the source
...
rule-3:
slide-title: Hello # rule-3 applies to slides with the title "Hello" [regex]
...
...
Để tạo nhiều trang trình bày từ dữ liệu, hãy thêm
source: input.pptx # optional path to source. Default to blank PPT with 1 slide
target: output.pptx # required path to save output as
change:
Title 1: # Take the shape named "Title 1"
text: New Title # Replace its text with "New Title"
1 vào phần thay đổi. Ví dụChạy ví dụ
source: input.pptx # optional path to source. Default to blank PPT with 1 slide
target: output.pptx # required path to save output as
change:
Title 1: # Take the shape named "Title 1"
text: New Title # Replace its text with "New Title"
1 này là một biến sử dụng gốc source: input.pptx # optional path to source. Default to blank PPT with 1 slide
target: output.pptx # required path to save output as
change:
Title 1: # Take the shape named "Title 1"
text: New Title # Replace its text with "New Title"
1. Nó có thể được sử dụng với
4 để lặp lại 1 hoặc nhiều trang trình bày. Ví dụ:source: input.pptx target: output.pptx change-image: Group 1: # Take the shape named "Group 1" Caption: # Find the shape named "Caption" inside it text: New caption # Change its text to "New caption" Picture: # Find the shape named "Picture" inside it image: $YAMLPATH/sample.png # Replace the image with sample.png
0 sẽ sao chép trang trình bày 1 & 2 nhiều lần khi có hàng dữ liệuCaption: # Find the shape named "Caption" inside it text: "{{ args['text'] }}" # Change its text to ?text= Picture: # Find the shape named "Picture" inside it image: $YAMLPATH/{{ args.get['image', 'sample'] }}.png # Replace image with ?image= or sample.png
5 để lặp lại các trang chiếu riêng lẻ hoặc nhiều trang chiếu đơn lẻsource: input.pptx target: output.pptx change-image: Group 1: # Take the shape named "Group 1" Caption: # Find the shape named "Caption" inside it text: New caption # Change its text to "New caption" Picture: # Find the shape named "Picture" inside it image: $YAMLPATH/sample.png # Replace the image with sample.png
Số trang chiếu luôn đề cập đến số trang chiếu nguồn, không phải số trang chiếu đích. Ngay cả khi một trang chiếu được sao chép trong mục tiêu, số trang chiếu nguồn không thay đổi
Hình dạng
Trong PowerPoint, tất cả các hình đều có tên. Để xem tên hình dạng, hãy chọn tab Trang đầu > Nhóm vẽ > Sắp xếp trình đơn thả xuống > Ngăn lựa chọn. Hoặc nhấn ALT + F10
Để thay đổi tên hình dạng, nhấp đúp vào tên trong ngăn chọn
Bạn có thể chỉ định các thay đổi đối với một hoặc nhiều hình dạng trong một. Ví dụ
rule-1:
Title 1: # Shape name "Title 1" will be updated by text "New title"
text: New title
style: # Text color will be `red`[accepts only hex color code in 6 digit]
color: '#ff0000'
Text 1: # Shape name "Text 1" will be updated by text "New text"
text: New text
style: # Text color will be `green`[accepts only hex color code in 6 digit]
color: '#00ff00'
bold: True # Text will appear in bold
… thay đổi 2 hình tên là
source: input.pptx
target: output.pptx
change-image:
Group 1: # Take the shape named "Group 1"
Caption: # Find the shape named "Caption" inside it
text: New caption # Change its text to "New caption"
Picture: # Find the shape named "Picture" inside it
image: $YAMLPATH/sample.png # Replace the image with sample.png
2 và Caption: # Find the shape named "Caption" inside it
text: "{{ args['text'] }}" # Change its text to ?text=
Picture: # Find the shape named "Picture" inside it
image: $YAMLPATH/{{ args.get['image', 'sample'] }}.png # Replace image with ?image= or sample.png
3Chạy ví dụ
Tên hình dạng có thể đề cập đến các yếu tố bản địa hoặc
Các nhóm
Tên hình dạng có thể đề cập đến các nhóm. Để thay đổi nội dung của nhóm, hãy sử dụng cấu hình lồng nhau. Ví dụ: nếu “Nhóm 1” có “Chú thích” và “Hình ảnh” bên trong, thì
Caption: # Find the shape named "Caption" inside it
text: "{{ args['text'] }}" # Change its text to ?text=
Picture: # Find the shape named "Picture" inside it
image: $YAMLPATH/{{ args.get['image', 'sample'] }}.png # Replace image with ?image= or sample.png
4 này sẽ thay thế những source: input.pptx
target: output.pptx
change-image:
Group 1: # Take the shape named "Group 1"
Caption: # Find the shape named "Caption" inside it
text: New caption # Change its text to "New caption"
Picture: # Find the shape named "Picture" inside it
image: $YAMLPATH/sample.png # Replace the image with sample.png
Chạy ví dụ
Đối số URL PPTX
Đối số URL có thể được sử dụng làm biến trong mẫu
Trong ví dụ dưới đây, group-args-example?text=My-Text, sẽ thay thế văn bản bằng
Caption: # Find the shape named "Caption" inside it
text: "{{ args['text'] }}" # Change its text to ?text=
Picture: # Find the shape named "Picture" inside it
image: $YAMLPATH/{{ args.get['image', 'sample'] }}.png # Replace image with ?image= or sample.png
5 Caption: # Find the shape named "Caption" inside it
text: "{{ args['text'] }}" # Change its text to ?text=
Picture: # Find the shape named "Picture" inside it
image: $YAMLPATH/{{ args.get['image', 'sample'] }}.png # Replace image with ?image= or sample.png
Chạy ví dụ
lệnh
Có thể thay đổi hình dạng bằng 1 hoặc nhiều lệnh. Các lệnh này có thể thay đổi kiểu và nội dung của hình dạng hoặc thêm nội dung mới [như biểu đồ]
Đăng ký. Đăng ký lệnh mới cho PPTGen
Đăng ký cho phép bạn tạo một lệnh tùy chỉnh. Nó chấp nhận một chức năng sẽ chấp nhận ba tham số,
source: input.pptx # optional path to source. Default to blank PPT with 1 slide
target: output.pptx # required path to save output as
change:
Title 1: # Take the shape named "Title 1"
text: New Title # Replace its text with "New Title"
7, source: input.pptx # optional path to source. Default to blank PPT with 1 slide
target: output.pptx # required path to save output as
change:
Title 1: # Take the shape named "Title 1"
text: New Title # Replace its text with "New Title"
8[cấu hình cho một hình dạng, cấu hình dưới tên hình dạng], source: input.pptx # optional path to source. Default to blank PPT with 1 slide
target: output.pptx # required path to save output as
change:
Title 1: # Take the shape named "Title 1"
text: New Title # Replace its text with "New Title"
9 theo cùng một thứ tự. Nó sẽ không chấp nhận bất kỳ tham số nào khác ngoại trừ 3 tham số này. Bất kỳ lệnh hiện có không thể được ghi đè. Trả về một danh sách lệnh bất biếnCSS
Các lệnh giống như CSS sau đây thay đổi thuộc tính hiển thị của hình dạng
9. Tải dữ liệusource: input.pptx # optional path to source. Default to blank PPT with 1 slide target: output.pptx # required path to save output as change: Title 1: # Take the shape named "Title 1" text: New Title # Replace its text with "New Title"
0. Chấp nhận css như thuộc tínhRectangle 1: # Take the shape named "Rectangle 1" css: data: data['sales'] style: opacity: 0.5 color: '#ff0000' fill: '#ffff00' stroke: '#ffff00' width: 200 height: 200 left: 50 top: 100
1. đặt mức độ mờ của hình dưới dạng số thập phân từ 0 - 1Rectangle 1: # Take the shape named "Rectangle 1" css: data: data['sales'] style: opacity: 0.5 color: '#ff0000' fill: '#ffff00' stroke: '#ffff00' width: 200 height: 200 left: 50 top: 100
2. đặt màu văn bản/màu nền trước làm màu CSSRectangle 1: # Take the shape named "Rectangle 1" css: data: data['sales'] style: opacity: 0.5 color: '#ff0000' fill: '#ffff00' stroke: '#ffff00' width: 200 height: 200 left: 50 top: 100
3. đặt màu nền của hình dạng thành màu CSSRectangle 1: # Take the shape named "Rectangle 1" css: data: data['sales'] style: opacity: 0.5 color: '#ff0000' fill: '#ffff00' stroke: '#ffff00' width: 200 height: 200 left: 50 top: 100
4. đặt màu đường viền hình dạng làm màu CSSRectangle 1: # Take the shape named "Rectangle 1" css: data: data['sales'] style: opacity: 0.5 color: '#ff0000' fill: '#ffff00' stroke: '#ffff00' width: 200 height: 200 left: 50 top: 100
5. đặt chiều rộng hình dạng theo điểmRectangle 1: # Take the shape named "Rectangle 1" css: data: data['sales'] style: opacity: 0.5 color: '#ff0000' fill: '#ffff00' stroke: '#ffff00' width: 200 height: 200 left: 50 top: 100
6. đặt chiều cao hình dạng theo điểmRectangle 1: # Take the shape named "Rectangle 1" css: data: data['sales'] style: opacity: 0.5 color: '#ff0000' fill: '#ffff00' stroke: '#ffff00' width: 200 height: 200 left: 50 top: 100
7. đặt vị trí hình dạng X theo điểmRectangle 1: # Take the shape named "Rectangle 1" css: data: data['sales'] style: opacity: 0.5 color: '#ff0000' fill: '#ffff00' stroke: '#ffff00' width: 200 height: 200 left: 50 top: 100
8. đặt vị trí hình dạng Y theo điểmRectangle 1: # Take the shape named "Rectangle 1" css: data: data['sales'] style: opacity: 0.5 color: '#ff0000' fill: '#ffff00' stroke: '#ffff00' width: 200 height: 200 left: 50 top: 100
9. đặt kích thước phông chữ theo điểmRectangle 1: # Take the shape named "Rectangle 1" css: data: data['sales'] style: opacity: 0.5 color: '#ff0000' fill: '#ffff00' stroke: '#ffff00' width: 200 height: 200 left: 50 top: 100
0. đặt họ phông chữ làm tên phông chữTitle 1: # Take the shape named "Title 1" style: # CSS like properties only for text color: '#ff00000' # Text color will be red font-size: 12 # Setting font-size ....... text: New Title # Replace its text with "New Title"
Thí dụ
Rectangle 1: # Take the shape named "Rectangle 1"
css:
data: data['sales']
style:
opacity: 0.5
color: '#ff0000'
fill: '#ffff00'
stroke: '#ffff00'
width: 200
height: 200
left: 50
top: 100
Chạy ví dụ
Màu CSS có thể được chỉ định giống như cách chúng có thể làm trong CSS. 1 điểm là 1/72 inch. Tất cả các phần tử
Rectangle 1: # Take the shape named "Rectangle 1"
css:
data: data['sales']
style:
opacity: 0.5
color: '#ff0000'
fill: '#ffff00'
stroke: '#ffff00'
width: 200
height: 200
left: 50
top: 100
0 và source: input.pptx # optional path to source. Default to blank PPT with 1 slide
target: output.pptx # required path to save output as
change:
Title 1: # Take the shape named "Title 1"
text: New Title # Replace its text with "New Title"
9 sẽ chấp nhận biểu thức python hoặc hàm pythonhỗ trợ giá trị
Chữ
Để thay đổi tiêu đề trên trang chiếu đầu vào thành “Tiêu đề mới”, hãy sử dụng cấu hình này
Title 1: # Take the shape named "Title 1"
style: # CSS like properties only for text
color: '#ff00000' # Text color will be red
font-size: 12 # Setting font-size
.......
text: New Title # Replace its text with "New Title"
Chạy ví dụ
Hỗ trợ giá trị
Title 1: # Take the shape named "Title 1"
style: # CSS like properties only for text
color: '#ff00000' # Text color will be red
font-size: 12 # Setting font-size
.......
text: New Title # Replace its text with "New Title"
3. Cũng hỗ trợ các thuộc tính giống như css của Rectangle 1: # Take the shape named "Rectangle 1"
css:
data: data['sales']
style:
opacity: 0.5
color: '#ff0000'
fill: '#ffff00'
stroke: '#ffff00'
width: 200
height: 200
left: 50
top: 100
0 cho văn bản trong phần Title 1: # Take the shape named "Title 1"
style: # CSS like properties only for text
color: '#ff00000' # Text color will be red
font-size: 12 # Setting font-size
.......
text: New Title # Replace its text with "New Title"
5. Tất cả các phong cách Title 1: # Take the shape named "Title 1"
style: # CSS like properties only for text
color: '#ff00000' # Text color will be red
font-size: 12 # Setting font-size
.......
text: New Title # Replace its text with "New Title"
6 cũng chấp nhận Title 1: # Take the shape named "Title 1"
style: # CSS like properties only for text
color: '#ff00000' # Text color will be red
font-size: 12 # Setting font-size
.......
text: New Title # Replace its text with "New Title"
7. Title 1: # Take the shape named "Title 1"
style: # CSS like properties only for text
color: '#ff00000' # Text color will be red
font-size: 12 # Setting font-size
.......
text: New Title # Replace its text with "New Title"
3 hỗ trợ Title 1: # Take the shape named "Title 1"
style: # CSS like properties only for text
color: '#ff00000' # Text color will be red
font-size: 12 # Setting font-size
.......
text: New Title # Replace its text with "New Title"
9 đối tượng trong văn bản đầu vào [mà giả sử được thay thế bằng] để có thuộc tính source: input.pptx
target: output.pptx
rule-1: # rule-1 applies to all slides
...
rule-2:
slide-number: 1 # rule-2 applies only to the first slide of the source
...
rule-3:
slide-title: Hello # rule-3 applies to slides with the title "Hello" [regex]
...
...
1 cho một từ trong câu hoặc cụm từ. from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
01from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
0Chạy ví dụ
Trong hình dạng ví dụ trên có tên
source: input.pptx
target: output.pptx
change-image:
Group 1: # Take the shape named "Group 1"
Caption: # Find the shape named "Caption" inside it
text: New caption # Change its text to "New caption"
Picture: # Find the shape named "Picture" inside it
image: $YAMLPATH/sample.png # Replace the image with sample.png
2 sẽ được thay thế bằng from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
03 với màu from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
04 và from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
05 sẽ là from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
06 với màu from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
07. Nó chỉ chấp nhận thẻ source: input.pptx
target: output.pptx
rule-1: # rule-1 applies to all slides
...
rule-2:
slide-number: 1 # rule-2 applies only to the first slide of the source
...
rule-3:
slide-title: Hello # rule-3 applies to slides with the title "Hello" [regex]
...
...
2 trong đầu vào xml. Mẫu xml đầu vào có thể có nhiều thẻ source: input.pptx
target: output.pptx
rule-1: # rule-1 applies to all slides
...
rule-2:
slide-number: 1 # rule-2 applies only to the first slide of the source
...
rule-3:
slide-title: Hello # rule-3 applies to slides with the title "Hello" [regex]
...
...
2Thay thế
Để thay thế văn bản thay vì , hãy sử dụng
Chạy ví dụ
Thay thế chỉ hoạt động đối với các từ có cùng định dạng. Ví dụ, ở đâu đó, “where” được gạch dưới. Bạn không thể thay thế “ở đâu đó”. Nhưng bạn có thể thay thế “some” và “where” một cách độc lập. Nó cũng hỗ trợ các thuộc tính giống như
source: input.pptx
target: output.pptx
rule-1: # rule-1 applies to all slides
...
rule-2:
slide-number: 1 # rule-2 applies only to the first slide of the source
...
rule-3:
slide-title: Hello # rule-3 applies to slides with the title "Hello" [regex]
...
...
1 trong Title 1: # Take the shape named "Title 1"
style: # CSS like properties only for text
color: '#ff00000' # Text color will be red
font-size: 12 # Setting font-size
.......
text: New Title # Replace its text with "New Title"
5. Tất cả các yếu tố phong cách cũng chấp nhận Title 1: # Take the shape named "Title 1"
style: # CSS like properties only for text
color: '#ff00000' # Text color will be red
font-size: 12 # Setting font-size
.......
text: New Title # Replace its text with "New Title"
7Hỗ trợ giá trị
from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
13Hình ảnh
Để thay đổi hình ảnh trên một hình ảnh, hãy sử dụng
from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
1Hỗ trợ giá trị
from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
14 và có thể là URL hoặc đường dẫn tệpChạy ví dụ
Bàn
Sửa đổi các bảng hiện có. Nó chấp nhận các phím này
1 dữ liệu tùy chọn để hiển thị dưới dạng bảng. Bảng mở rộng khi thu nhỏ để chứa các hàng và cột trong dữ liệusource: input.pptx # optional path to source. Default to blank PPT with 1 slide target: output.pptx # required path to save output as change: Title 1: # Take the shape named "Title 1" text: New Title # Replace its text with "New Title"
16 css chung tùy chọn cho tất cả các cột. e. g. - màu sắc, tô màu, cỡ chữ, v.v. Các thuộc tính này có thể được ghi đè bên trong một cột. Nếu không thì thuộc tính sẽ là chung cho tất cả các cộtfrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
17 Đúng hay Sai, nếu Đúng văn bản sẽ được in đậmfrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
18 Màu của các ôfrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
19 Màu văn bảnfrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
20 Để đặt kiểu chữ nghiêng cho văn bảnfrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
21 Để đặt kiểu gạch chân cho văn bảnfrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
22 Cỡ chữ của văn bảnfrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
23 Họ phông chữ của văn bảnfrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
24 tên dải màu tùy chọn [nhị phân, Blues, BuGn, BuPu, gist_yarg, GnBu, Greens, Greys, Oranges, OrRd, PuBu, PuBuGn, PuRd, Purples, RdPu, Reds, YlGn, YlGnBu, YlOrBr, YlOrRd, BrBG, bwr, coolwarmfrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
25 tùy chọn tối thiểu. Mặc định cho giá trị tối thiểu của cộtfrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
26 tùy chọn tối đa. Mặc định là giá trị tối đa của cộtfrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
27 Cấu hình từ điển cho các cột. Bên trong các thuộc tính kiểu này có thể được xác định và có thể ghi đè lên các kiểu phổ biến từ phầnfrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
0. Chỉ các cột được xác định bên trong phầnRectangle 1: # Take the shape named "Rectangle 1" css: data: data['sales'] style: opacity: 0.5 color: '#ff0000' fill: '#ffff00' stroke: '#ffff00' width: 200 height: 200 left: 50 top: 100
29 mới được điền vào bên trong bảngfrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
Thí dụ
Thí dụ
Chạy ví dụ
Để tạo nhiều hình dạng bằng cách sử dụng dữ liệu, hãy sử dụng
from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
30 và source: input.pptx # optional path to source. Default to blank PPT with 1 slide
target: output.pptx # required path to save output as
change:
Title 1: # Take the shape named "Title 1"
text: New Title # Replace its text with "New Title"
1. Ví dụChạy ví dụ
Cây rơm
Sao chép hình dạng nhiều lần dựa trên dữ liệu theo chiều dọc hoặc chiều ngang. Ví dụ
Chạy ví dụ
source: input.pptx # optional path to source. Default to blank PPT with 1 slide
target: output.pptx # required path to save output as
change:
Title 1: # Take the shape named "Title 1"
text: New Title # Replace its text with "New Title"
1 này là một biến sử dụng gốc source: input.pptx # optional path to source. Default to blank PPT with 1 slide
target: output.pptx # required path to save output as
change:
Title 1: # Take the shape named "Title 1"
text: New Title # Replace its text with "New Title"
1. Đối với mỗi hàng trong source: input.pptx # optional path to source. Default to blank PPT with 1 slide
target: output.pptx # required path to save output as
change:
Title 1: # Take the shape named "Title 1"
text: New Title # Replace its text with "New Title"
9, hình được nhân đôi và bố trí dựa trên from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
30from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
36 hỗ trợ các bố cục này
37 sao chép phần tử bên phải với một tùy chọnfrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
38 [mặc định. 0]from gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
39 sao chép phần tử bên dưới với một tùy chọnfrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
38 [mặc định. 0]from gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
mẫu
Đối với các lệnh hỗ trợ mẫu, các giá trị bên trong
from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
41 được đánh giá là biểu thức Python trong ngữ cảnh của source: input.pptx # optional path to source. Default to blank PPT with 1 slide
target: output.pptx # required path to save output as
change:
Title 1: # Take the shape named "Title 1"
text: New Title # Replace its text with "New Title"
9Ví dụ
Chạy ví dụ
… sẽ thay thế nội dung bên trong
from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
41 bằng giá trị của from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
44 được đánh giá bằng Python. Biến from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
45 là kết quả của việc tải from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
46Biểu thức
Đối với các lệnh hỗ trợ biểu thức, các giá trị được đánh giá là biểu thức Python trong ngữ cảnh dữ liệu. Ví dụ
from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
2Lệnh không dùng nữa
47 sử dụng lệnh thay thếfrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
48 sử dụng lệnh thay thếfrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
Đồ thị
Chỉnh sửa dữ liệu bên trong biểu đồ pptx gốc.
from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
49 biểu đồ pptx không được hỗ trợ. source: input.pptx
target: output.pptx
rule-1: # rule-1 applies to all slides
...
rule-2:
slide-number: 1 # rule-2 applies only to the first slide of the source
...
rule-3:
slide-title: Hello # rule-3 applies to slides with the title "Hello" [regex]
...
...
4 chấp nhận các thuộc tính sau. -Ghi chú. - Tất cả các thuộc tính cũng chấp nhận biểu thức python hoặc chức năng tùy chỉnh. Như là. -
from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
3 source: input.pptx # optional path to source. Default to blank PPT with 1 slide
target: output.pptx # required path to save output as
change:
Title 1: # Take the shape named "Title 1"
text: New Title # Replace its text with "New Title"
1 Truyền dữ liệu vào biểu đồfrom gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
52 from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
53 loại. Nếu được xác định, chỉ các cột được đề cập trong danh sách sẽ chuyển qua dưới dạng dữ liệu cho biểu đồ. Chấp nhận from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
54 hoặc danh sách tên cộtfrom gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
55 Xác định tên cột from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
56 từ dữ liệufrom gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
57 Điều này chỉ áp dụng cho from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
58. Tên cột từ dữ liệu cho kích thước bong bóngfrom gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
19 Chấp nhận một từ điển [hoặc giá trị thô trong trường hợp này, mã màu giống nhau sẽ được áp dụng cho tất cả các chuỗi] cho chuỗi đang được thêm vào bảng xếp hạng. Đồng thời cung cấp quyền truy cập dữ liệu cấp hàng cho chuỗi bằng cách sử dụng hàm from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
60. e. g. -from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
4from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
61 Cấu hình tương tự như Rectangle 1: # Take the shape named "Rectangle 1"
css:
data: data['sales']
style:
opacity: 0.5
color: '#ff0000'
fill: '#ffff00'
stroke: '#ffff00'
width: 200
height: 200
left: 50
top: 100
2from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
63 Cấu hình tương tự như Rectangle 1: # Take the shape named "Rectangle 1"
css:
data: data['sales']
style:
opacity: 0.5
color: '#ff0000'
fill: '#ffff00'
stroke: '#ffff00'
width: 200
height: 200
left: 50
top: 100
2Biểu đồ gốc
Để sửa đổi dữ liệu và thuộc tính cho biểu đồ gốc hiện có, hãy sử dụng
from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
65. Điều này hỗ trợ các loại biểu đồ sau
66 Thanh xếp chồng, Thanh xếp chồng, Thanh xếp chồng 100%from gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
67 Cột cụm, Cột xếp chồng, Cột xếp chồng 100%from gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
68 Dòng, Dòng xếp chồng, Dòng xếp chồng 100%, Dòng có đánh dấu, Dòng xếp chồng có đánh dấu, Dòng xếp chồng 100% có đánh dấufrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
69 Khu vực, Khu vực xếp chồng, Khu vực xếp chồng 100% [Không hỗ trợ khu vực 3D]from gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
70 Phân tán, Phân tán với Đường thẳng, Phân tán với Đường trơn, Phân tán với Đường thẳng và Điểm đánh dấu, Phân tán với Đường trơn và Điểm đánh dấufrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
71 Bong bóng, Bong bóng 3-Dfrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
72 Radar, Radar có điểm đánh dấu, Radar đầyfrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
73 Bánh rán, Bánh rán nổfrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
74 Pie, Pie Exploded, Bar of Pie [không hỗ trợ bánh 3D]from gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
Dưới đây là các ví dụ giả định cấu hình sau
Dưới đây là ví dụ cho các biểu đồ khác nhau
from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
5Chạy ví dụ
from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
6Chạy ví dụ
from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
7Chạy ví dụ
from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
8Chạy ví dụ
from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
9Chạy ví dụ
import pandas as pd
from gramex.pptgen import pptgen
data = {'chart_data': pd.read_csv['data.csv']}
pptgen[
source='input.pptx',
target='output.pptx',
edit_chart={
'Bar Chart Shape Name': {
'chart': {
'data': data['chart_data'],
'x': 'Category',
'size': 'PreY',
'color': {
'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}"
}
}
}
}
]
0Chạy ví dụ
import pandas as pd
from gramex.pptgen import pptgen
data = {'chart_data': pd.read_csv['data.csv']}
pptgen[
source='input.pptx',
target='output.pptx',
edit_chart={
'Bar Chart Shape Name': {
'chart': {
'data': data['chart_data'],
'x': 'Category',
'size': 'PreY',
'color': {
'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}"
}
}
}
}
]
1Chạy ví dụ
import pandas as pd
from gramex.pptgen import pptgen
data = {'chart_data': pd.read_csv['data.csv']}
pptgen[
source='input.pptx',
target='output.pptx',
edit_chart={
'Bar Chart Shape Name': {
'chart': {
'data': data['chart_data'],
'x': 'Category',
'size': 'PreY',
'color': {
'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}"
}
}
}
}
]
2Chạy ví dụ
import pandas as pd
from gramex.pptgen import pptgen
data = {'chart_data': pd.read_csv['data.csv']}
pptgen[
source='input.pptx',
target='output.pptx',
edit_chart={
'Bar Chart Shape Name': {
'chart': {
'data': data['chart_data'],
'x': 'Category',
'size': 'PreY',
'color': {
'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}"
}
}
}
}
]
3Chạy ví dụ
import pandas as pd
from gramex.pptgen import pptgen
data = {'chart_data': pd.read_csv['data.csv']}
pptgen[
source='input.pptx',
target='output.pptx',
edit_chart={
'Bar Chart Shape Name': {
'chart': {
'data': data['chart_data'],
'x': 'Category',
'size': 'PreY',
'color': {
'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}"
}
}
}
}
]
4Chạy ví dụ
Các phím sau cũng có thể được chỉ định làm hàm an và python.
source: input.pptx # optional path to source. Default to blank PPT with 1 slide
target: output.pptx # required path to save output as
change:
Title 1: # Take the shape named "Title 1"
text: New Title # Replace its text with "New Title"
1, from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
55, from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
19, from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
63, from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
57Ví dụ: ví dụ này đặt độ mờ của các cột có tên "dummy" là 0. 2 và các cột khác là 1. 0
import pandas as pd
from gramex.pptgen import pptgen
data = {'chart_data': pd.read_csv['data.csv']}
pptgen[
source='input.pptx',
target='output.pptx',
edit_chart={
'Bar Chart Shape Name': {
'chart': {
'data': data['chart_data'],
'x': 'Category',
'size': 'PreY',
'color': {
'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}"
}
}
}
}
]
5biểu đồ tùy chỉnh
pptgen cho phép bạn tạo các biểu đồ tùy chỉnh này
- biểu đồ dấu đầu dòng
- sơ đồ lịch
- lưới tản nhiệt
- Sankey
- sơ đồ cây
Để tạo những thứ này, hãy thêm một hình chữ nhật [không cho phép hình dạng nào khác] trong trang chiếu của bạn. Khi một biểu đồ tùy chỉnh được áp dụng trên hình chữ nhật đó, nó sẽ thay thế hình chữ nhật đó bằng biểu đồ
Đạn
1 Giá trị thực tếsource: input.pptx # optional path to source. Default to blank PPT with 1 slide target: output.pptx # required path to save output as change: Title 1: # Take the shape named "Title 1" text: New Title # Replace its text with "New Title"
81 Giá trị kémfrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
82 Giá trị tốtfrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
9 Giá trị mục tiêuimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
84 Đặt chiều rộng tối đa của hình chữ nhật. Chấp nhậnfrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
85 hoặc giá trị thô [từ 0-1]from gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
24 Tùy chọn. Mặc địnhfrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
87from gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
3 Mặc địnhTitle 1: # Take the shape named "Title 1" style: # CSS like properties only for text color: '#ff00000' # Text color will be red font-size: 12 # Setting font-size ....... text: New Title # Replace its text with "New Title"
89. Tùy chọn, nếu văn bản hiện tại sẽ được hiển thị theo định dạng. Văn bản có thể được ghi đè bên trong phầnfrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
90 hoặcfrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
91 nếu được xác định ở đófrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
16 Tùy chọnfrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
93, chấp nhận thuộc tính cssfrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
94from gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
Thí dụ
Chạy ví dụ
Các phím sau cũng có thể được chỉ định làm hàm an và python.
source: input.pptx # optional path to source. Default to blank PPT with 1 slide
target: output.pptx # required path to save output as
change:
Title 1: # Take the shape named "Title 1"
text: New Title # Replace its text with "New Title"
1, import pandas as pd
from gramex.pptgen import pptgen
data = {'chart_data': pd.read_csv['data.csv']}
pptgen[
source='input.pptx',
target='output.pptx',
edit_chart={
'Bar Chart Shape Name': {
'chart': {
'data': data['chart_data'],
'x': 'Category',
'size': 'PreY',
'color': {
'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}"
}
}
}
}
]
9, from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
81, from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
82, from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
99, import pandas as pd
from gramex.pptgen import pptgen
data = {'chart_data': pd.read_csv['data.csv']}
pptgen[
source='input.pptx',
target='output.pptx',
edit_chart={
'Bar Chart Shape Name': {
'chart': {
'data': data['chart_data'],
'x': 'Category',
'size': 'PreY',
'color': {
'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}"
}
}
}
}
]
00, source: input.pptx
target: output.pptx
rule-1: # rule-1 applies to all slides
...
rule-2:
slide-number: 1 # rule-2 applies only to the first slide of the source
...
rule-3:
slide-title: Hello # rule-3 applies to slides with the title "Hello" [regex]
...
...
2 cùng với tất cả các thuộc tính phong cách, chẳng hạn như trong phần phong cách Rectangle 1: # Take the shape named "Rectangle 1"
css:
data: data['sales']
style:
opacity: 0.5
color: '#ff0000'
fill: '#ffff00'
stroke: '#ffff00'
width: 200
height: 200
left: 50
top: 100
9, Rectangle 1: # Take the shape named "Rectangle 1"
css:
data: data['sales']
style:
opacity: 0.5
color: '#ff0000'
fill: '#ffff00'
stroke: '#ffff00'
width: 200
height: 200
left: 50
top: 100
1, Rectangle 1: # Take the shape named "Rectangle 1"
css:
data: data['sales']
style:
opacity: 0.5
color: '#ff0000'
fill: '#ffff00'
stroke: '#ffff00'
width: 200
height: 200
left: 50
top: 100
3, Rectangle 1: # Take the shape named "Rectangle 1"
css:
data: data['sales']
style:
opacity: 0.5
color: '#ff0000'
fill: '#ffff00'
stroke: '#ffff00'
width: 200
height: 200
left: 50
top: 100
2, v.v.sơ đồ lịch
06 Chiều rộng và chiều cao của mỗi ô [tính bằng pixel] trong sơ đồ lịchimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
07 Giá trị đầu tuầnimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
08import pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
24 Tùy chọn, mặc địnhfrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
87from gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
11 Định dạng số sẽ được hiển thị ở thanh trên cùng/trái nếuimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
12 được xác địnhimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
13 Giá trị tối thiểu cho thang màuimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
14import pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
15 Giá trị cao cho thang màuimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
16import pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
17 Lề trên cho sơ đồ lịchimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
18import pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
19 Lề trái của sơ đồ lịchimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
18import pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
16 Afrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
93, chấp nhận tài sản củafrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
23 e. g-import pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
24import pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
Thí dụ
Các phím sau cũng có thể được chỉ định làm hàm an và python.
source: input.pptx # optional path to source. Default to blank PPT with 1 slide
target: output.pptx # required path to save output as
change:
Title 1: # Take the shape named "Title 1"
text: New Title # Replace its text with "New Title"
1, import pandas as pd
from gramex.pptgen import pptgen
data = {'chart_data': pd.read_csv['data.csv']}
pptgen[
source='input.pptx',
target='output.pptx',
edit_chart={
'Bar Chart Shape Name': {
'chart': {
'data': data['chart_data'],
'x': 'Category',
'size': 'PreY',
'color': {
'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}"
}
}
}
}
]
26, import pandas as pd
from gramex.pptgen import pptgen
data = {'chart_data': pd.read_csv['data.csv']}
pptgen[
source='input.pptx',
target='output.pptx',
edit_chart={
'Bar Chart Shape Name': {
'chart': {
'data': data['chart_data'],
'x': 'Category',
'size': 'PreY',
'color': {
'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}"
}
}
}
}
]
13, import pandas as pd
from gramex.pptgen import pptgen
data = {'chart_data': pd.read_csv['data.csv']}
pptgen[
source='input.pptx',
target='output.pptx',
edit_chart={
'Bar Chart Shape Name': {
'chart': {
'data': data['chart_data'],
'x': 'Category',
'size': 'PreY',
'color': {
'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}"
}
}
}
}
]
15, import pandas as pd
from gramex.pptgen import pptgen
data = {'chart_data': pd.read_csv['data.csv']}
pptgen[
source='input.pptx',
target='output.pptx',
edit_chart={
'Bar Chart Shape Name': {
'chart': {
'data': data['chart_data'],
'x': 'Category',
'size': 'PreY',
'color': {
'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}"
}
}
}
}
]
07 và các thành phần phụ của phần Rectangle 1: # Take the shape named "Rectangle 1"
css:
data: data['sales']
style:
opacity: 0.5
color: '#ff0000'
fill: '#ffff00'
stroke: '#ffff00'
width: 200
height: 200
left: 50
top: 100
0lưới tản nhiệt
1 Khung dữ liệusource: input.pptx # optional path to source. Default to blank PPT with 1 slide target: output.pptx # required path to save output as change: Title 1: # Take the shape named "Title 1" text: New Title # Replace its text with "New Title"
32 Tên cột từ dữ liệu sẽ được coi làimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
33 trong lưới tản nhiệtimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
34 Tên cột từ dữ liệu sẽ được coi làimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
35 trong lưới tản nhiệtimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
36 tùy chọn, danh sách các giá trị duy nhất [từ cột lưới tản nhiệt từ dữ liệu]. Theo thứ tự các cột sẽ được tạo trong bản đồ nhiệt. Chấp nhận cảimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
37import pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
38 tùy chọn, giống nhưimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
39 nhưng đối với các hàngimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
40 Tên cột từ dữ liệu để hiển thị cho từng lưới tản nhiệt ôimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
3Title 1: # Take the shape named "Title 1" style: # CSS like properties only for text color: '#ff00000' # Text color will be red font-size: 12 # Setting font-size ....... text: New Title # Replace its text with "New Title"
42 là mặc định. Nó không hiển thị bất kỳ văn bảnimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
43, hiển thị cộtimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
44import pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
45 hiển thị văn bản tùy chỉnh từ cộtimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
46import pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
47 có thể là bất kỳ hàm/biểu thức nào sử dụngimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
9 là hàng vàsource: input.pptx # optional path to source. Default to blank PPT with 1 slide target: output.pptx # required path to save output as change: Title 1: # Take the shape named "Title 1" text: New Title # Replace its text with "New Title"
49import pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
9 [là hàng] vàsource: input.pptx # optional path to source. Default to blank PPT with 1 slide target: output.pptx # required path to save output as change: Title 1: # Take the shape named "Title 1" text: New Title # Replace its text with "New Title"
49import pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
52 Theo tỷ lệ phần trăm [0-1] của tổng chiều rộng của hình dạng. Lề trái của hình mà từ đó lưới tản nhiệt sẽ bắt đầu được tạo raimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
53 Chiều rộng của mỗi ô. Mặc định dựa trên chiều rộng cột của hình dạng sẽ được xác địnhimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
54 Chiều cao của mỗi ô. Mặc định dựa trên số lượng hàng chiều cao của hình dạng sẽ được xác địnhimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
55 Xử lý đại diện văn bản giá trịimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
56import pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
57 Màu ô cho các giá trịimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
56import pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
16 tùy chọnfrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
93, để áp dụng các thuộc tính cssfrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
61 Dict like đối tượng hoặc int. Mặc định 5px [trái, phải, trên, dưới]. Nếuimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
62 sẽ đặt phần đệm [trái, phải, trên, dưới] là 10px.import pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
63 chấp nhận giá trịimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
64 thô bằng pixel hoặc mộtimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
65. Biểu thức này có thể sử dụng các tham sốimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
49,import pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
33,import pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
35 vàimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
44import pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
Thí dụ
Các phím sau cũng có thể được chỉ định làm hàm an và python.
source: input.pptx # optional path to source. Default to blank PPT with 1 slide
target: output.pptx # required path to save output as
change:
Title 1: # Take the shape named "Title 1"
text: New Title # Replace its text with "New Title"
1, import pandas as pd
from gramex.pptgen import pptgen
data = {'chart_data': pd.read_csv['data.csv']}
pptgen[
source='input.pptx',
target='output.pptx',
edit_chart={
'Bar Chart Shape Name': {
'chart': {
'data': data['chart_data'],
'x': 'Category',
'size': 'PreY',
'color': {
'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}"
}
}
}
}
]
32, import pandas as pd
from gramex.pptgen import pptgen
data = {'chart_data': pd.read_csv['data.csv']}
pptgen[
source='input.pptx',
target='output.pptx',
edit_chart={
'Bar Chart Shape Name': {
'chart': {
'data': data['chart_data'],
'x': 'Category',
'size': 'PreY',
'color': {
'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}"
}
}
}
}
]
34, import pandas as pd
from gramex.pptgen import pptgen
data = {'chart_data': pd.read_csv['data.csv']}
pptgen[
source='input.pptx',
target='output.pptx',
edit_chart={
'Bar Chart Shape Name': {
'chart': {
'data': data['chart_data'],
'x': 'Category',
'size': 'PreY',
'color': {
'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}"
}
}
}
}
]
40 và các thành phần phụ của phần Rectangle 1: # Take the shape named "Rectangle 1"
css:
data: data['sales']
style:
opacity: 0.5
color: '#ff0000'
fill: '#ffff00'
stroke: '#ffff00'
width: 200
height: 200
left: 50
top: 100
0Sankey
1 Khung dữ liệusource: input.pptx # optional path to source. Default to blank PPT with 1 slide target: output.pptx # required path to save output as change: Title 1: # Take the shape named "Title 1" text: New Title # Replace its text with "New Title"
76import pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
89 hoặcfrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
78 nếu dữ liệu đúng sẽ được sắp xếp trong khi vẽ sankeyimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
3 Chức năng hiện chữ trong sankeyTitle 1: # Take the shape named "Title 1" style: # CSS like properties only for text color: '#ff00000' # Text color will be red font-size: 12 # Setting font-size ....... text: New Title # Replace its text with "New Title"
80 Đặt hàng theo nhómimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
19 Hàm màu dựa trên đófrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
82 Tên cột nhóm từ dữ liệuimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
Thí dụ
Các phím sau cũng có thể được chỉ định làm hàm an và python.
source: input.pptx # optional path to source. Default to blank PPT with 1 slide
target: output.pptx # required path to save output as
change:
Title 1: # Take the shape named "Title 1"
text: New Title # Replace its text with "New Title"
1, from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
57, import pandas as pd
from gramex.pptgen import pptgen
data = {'chart_data': pd.read_csv['data.csv']}
pptgen[
source='input.pptx',
target='output.pptx',
edit_chart={
'Bar Chart Shape Name': {
'chart': {
'data': data['chart_data'],
'x': 'Category',
'size': 'PreY',
'color': {
'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}"
}
}
}
}
]
80, Title 1: # Take the shape named "Title 1"
style: # CSS like properties only for text
color: '#ff00000' # Text color will be red
font-size: 12 # Setting font-size
.......
text: New Title # Replace its text with "New Title"
3, Rectangle 1: # Take the shape named "Rectangle 1"
css:
data: data['sales']
style:
opacity: 0.5
color: '#ff0000'
fill: '#ffff00'
stroke: '#ffff00'
width: 200
height: 200
left: 50
top: 100
2sơ đồ cây
1 Khung dữ liệusource: input.pptx # optional path to source. Default to blank PPT with 1 slide target: output.pptx # required path to save output as change: Title 1: # Take the shape named "Title 1" text: New Title # Replace its text with "New Title"
89 Nhóm tên cột làimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
53from gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
91 Hàm tổng hợp để áp dụng cho mỗi nhómimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
57 Chức năng kích thước hộp của Treemapfrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
76 Chức năng sắp xếp các hình chữ nhật của treemap dựa trên chức năngimport pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
94import pandas as pd from gramex.pptgen import pptgen data = {'chart_data': pd.read_csv['data.csv']} pptgen[ source='input.pptx', target='output.pptx', edit_chart={ 'Bar Chart Shape Name': { 'chart': { 'data': data['chart_data'], 'x': 'Category', 'size': 'PreY', 'color': { 'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}" } } } } ]
19 Khung dữ liệufrom gramex.pptgen import pptgen pptgen[ source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[] change={ # Configurations are same as when loading from the YAML file 'Title 1': { # Take the shape named "Title 1" 'text' 'New Title' # Replace its text with "New Title" } } ]
3 Chức năng hiển thị văn bản trong treemapTitle 1: # Take the shape named "Title 1" style: # CSS like properties only for text color: '#ff00000' # Text color will be red font-size: 12 # Setting font-size ....... text: New Title # Replace its text with "New Title"
Thí dụ
Chạy ví dụ
Các phím sau cũng có thể được chỉ định làm hàm an và python.
source: input.pptx # optional path to source. Default to blank PPT with 1 slide
target: output.pptx # required path to save output as
change:
Title 1: # Take the shape named "Title 1"
text: New Title # Replace its text with "New Title"
1, from gramex.pptgen import pptgen
pptgen[
source='input.pptx', # optional path to source. Defaults to blank PPT with 1 slide
target='output.pptx', # optional target. Otherwise, returns the pptx.Presentation[]
change={ # Configurations are same as when loading from the YAML file
'Title 1': { # Take the shape named "Title 1"
'text' 'New Title' # Replace its text with "New Title"
}
}
]
57, import pandas as pd
from gramex.pptgen import pptgen
data = {'chart_data': pd.read_csv['data.csv']}
pptgen[
source='input.pptx',
target='output.pptx',
edit_chart={
'Bar Chart Shape Name': {
'chart': {
'data': data['chart_data'],
'x': 'Category',
'size': 'PreY',
'color': {
'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}"
}
}
}
}
]
89, import pandas as pd
from gramex.pptgen import pptgen
data = {'chart_data': pd.read_csv['data.csv']}
pptgen[
source='input.pptx',
target='output.pptx',
edit_chart={
'Bar Chart Shape Name': {
'chart': {
'data': data['chart_data'],
'x': 'Category',
'size': 'PreY',
'color': {
'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}"
}
}
}
}
]
91, import pandas as pd
from gramex.pptgen import pptgen
data = {'chart_data': pd.read_csv['data.csv']}
pptgen[
source='input.pptx',
target='output.pptx',
edit_chart={
'Bar Chart Shape Name': {
'chart': {
'data': data['chart_data'],
'x': 'Category',
'size': 'PreY',
'color': {
'function': "{'CurY': '#D73027', 'PreY': '#1A9850', 'PPresY': '#FFFFBF', 'Size': '#cccccc'}"
}
}
}
}
]
94, Rectangle 1: # Take the shape named "Rectangle 1"
css:
data: data['sales']
style:
opacity: 0.5
color: '#ff0000'
fill: '#ffff00'
stroke: '#ffff00'
width: 200
height: 200
left: 50
top: 100
2, source: input.pptx
target: output.pptx
rule-1: # rule-1 applies to all slides
...
rule-2:
slide-number: 1 # rule-2 applies only to the first slide of the source
...
rule-3:
slide-title: Hello # rule-3 applies to slides with the title "Hello" [regex]
...
...
2PPTGen sử dụng cấu hình để sửa đổi tệp. Cấu hình xác định
source: input.pptx # optional path to source. Default to blank PPT with 1 slide
target: output.pptx # required path to save output as
change:
Title 1: # Take the shape named "Title 1"
text: New Title # Replace its text with "New Title"
04, source: input.pptx # optional path to source. Default to blank PPT with 1 slide
target: output.pptx # required path to save output as
change:
Title 1: # Take the shape named "Title 1"
text: New Title # Replace its text with "New Title"
05, source: input.pptx # optional path to source. Default to blank PPT with 1 slide
target: output.pptx # required path to save output as
change:
Title 1: # Take the shape named "Title 1"
text: New Title # Replace its text with "New Title"
9 và bất kỳ số quy tắc nàoTrên dòng lệnh, nó chấp nhận tệp YAML làm đầu vào. Ví dụ:
source: input.pptx # optional path to source. Default to blank PPT with 1 slide
target: output.pptx # required path to save output as
change:
Title 1: # Take the shape named "Title 1"
text: New Title # Replace its text with "New Title"
07 này sao chép đầu vào. pptx để xuất. pptx và thay đổi tiêu đề thành “Tiêu đề mới”