pub struct SeriesFormat {
pub fill: Fill,
pub line: Option<Line>,
}Expand description
系列样式(<c:spPr>,写在 <c:ser> 内 <c:tx> 之后、<c:cat>/<c:xVal> 之前)。
控制系列的颜色/填充/边框,对应 python-pptx series.format.fill / series.format.line。
None 时(默认)不写出 <c:spPr>,PowerPoint 使用主题色自动分配。
§与 python-pptx 的对应
pptx.chart.series.format.fill←→SeriesFormat::fill;pptx.chart.series.format.line←→SeriesFormat::line。
Fields§
§fill: Fill填充(<a:solidFill> / <a:noFill> / <a:gradFill> 等)。
复用 crate::oxml::sppr::Fill,Fill::Inherit(默认)时不写出填充元素。
line: Option<Line>边框(<a:ln>)。None 时不写出 <a:ln> 元素。
Implementations§
Source§impl SeriesFormat
impl SeriesFormat
Sourcepub fn solid_fill(color: Color) -> Self
pub fn solid_fill(color: Color) -> Self
Sourcepub fn write_xml(&self, w: &mut XmlWriter) -> bool
pub fn write_xml(&self, w: &mut XmlWriter) -> bool
写出 <c:spPr> 元素到 XmlWriter。
OOXML 顺序(ECMA-376 21.2.2.197 c:ser 子元素顺序):
idx → order → tx → spPr → txPr → marker → invertIfNegative →
pictureOptions → dPt → dLbls → trendline → errBars → cat/xVal → val/yVal → …
仅当 fill 非 Inherit 或 line 非 None 时写出;否则跳过(不输出空 <c:spPr/>)。
§返回值
true:已写出<c:spPr>元素;false:跳过(fill 为 Inherit 且 line 为 None)。
Trait Implementations§
Source§impl Clone for SeriesFormat
impl Clone for SeriesFormat
Source§fn clone(&self) -> SeriesFormat
fn clone(&self) -> SeriesFormat
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 moreSource§impl Debug for SeriesFormat
impl Debug for SeriesFormat
Source§impl Default for SeriesFormat
impl Default for SeriesFormat
Source§fn default() -> SeriesFormat
fn default() -> SeriesFormat
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SeriesFormat
impl RefUnwindSafe for SeriesFormat
impl Send for SeriesFormat
impl Sync for SeriesFormat
impl Unpin for SeriesFormat
impl UnsafeUnpin for SeriesFormat
impl UnwindSafe for SeriesFormat
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