pub struct ChartEntry {
pub partname: PartName,
pub chart: Chart,
pub rid: String,
pub xlsx_blob: Option<Vec<u8>>,
}Expand description
图表条目:保存到 /ppt/charts/chartN.xml 的 chart part 元数据。
对应 python-pptx 中 SlideShapes.add_chart(...) 隐式管理的 chart part。
在 to_opc_package 阶段,每个 ChartEntry 会:
- 写出独立的
/ppt/charts/chartN.xmlpart(内容为Chart::to_xml()); - 在
slideN.xml.rels中添加<Relationship Type=".../chart" Target="../charts/chartN.xml"/>; - 把
rid同步回ChartShape.frame.graphic.Chart.rid,供<c:chart r:id="..."/>引用。
§与 MediaEntry 的差异
- MediaEntry 持有
blob: Vec<u8>(二进制); - ChartEntry 持有
chart: OxmlChart(强类型模型),写出时调用chart.to_xml()。
Fields§
§partname: PartNamechart part 路径,例如 /ppt/charts/chart1.xml。
chart: Chart强类型 Chart 模型(包含类型/数据/标题)。
rid: String在 slide xml 中引用的关系 id(形如 rIdChart1)。
xlsx_blob: Option<Vec<u8>>嵌入式 Excel 工作簿二进制内容(TODO-004 Excel 嵌入)。
None:图表数据仅靠 numCache/strCache,不嵌入 Excel;Some(bytes):写出时生成/ppt/embeddings/Microsoft_Excel_WorksheetN.xlsxpart +chartN.xml.rels关系(Type=Package),并在 chart XML 中写入<c:externalData r:id="rIdXlsxN"/>引用。PowerPoint 打开图表时会从 该 xlsx part 读取数据源(“编辑数据” 启动 Excel)。
内容应为有效的 .xlsx 文件字节流(OOXML SpreadsheetML 包格式)。
库不校验内容有效性,PowerPoint 会按 zip + XML 解析。
Trait Implementations§
Source§impl Clone for ChartEntry
impl Clone for ChartEntry
Source§fn clone(&self) -> ChartEntry
fn clone(&self) -> ChartEntry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ChartEntry
impl RefUnwindSafe for ChartEntry
impl Send for ChartEntry
impl Sync for ChartEntry
impl Unpin for ChartEntry
impl UnsafeUnpin for ChartEntry
impl UnwindSafe for ChartEntry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more