Skip to main content

SeriesFormat

Struct SeriesFormat 

Source
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.lineNone 时(默认)不写出 <c:spPr>,PowerPoint 使用主题色自动分配。

§与 python-pptx 的对应

Fields§

§fill: Fill

填充(<a:solidFill> / <a:noFill> / <a:gradFill> 等)。 复用 crate::oxml::sppr::FillFill::Inherit(默认)时不写出填充元素。

§line: Option<Line>

边框(<a:ln>)。None 时不写出 <a:ln> 元素。

Implementations§

Source§

impl SeriesFormat

Source

pub fn solid_fill(color: Color) -> Self

新建一个实色填充的系列样式(最常用场景:指定系列颜色)。

§参数
  • color:系列颜色(如 Color::RGB(RGBColor(0x4F, 0x81, 0xBD)))。
Source

pub fn write_xml(&self, w: &mut XmlWriter) -> bool

写出 <c:spPr> 元素到 XmlWriter。

OOXML 顺序(ECMA-376 21.2.2.197 c:ser 子元素顺序): idxordertxspPrtxPrmarkerinvertIfNegativepictureOptionsdPtdLblstrendlineerrBarscat/xValval/yVal → …

仅当 fillInheritlineNone 时写出;否则跳过(不输出空 <c:spPr/>)。

§返回值
  • true:已写出 <c:spPr> 元素;
  • false:跳过(fill 为 Inherit 且 line 为 None)。

Trait Implementations§

Source§

impl Clone for SeriesFormat

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl Debug for SeriesFormat

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SeriesFormat

Source§

fn default() -> SeriesFormat

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V