#[non_exhaustive]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum XlLegendPosition {
Bottom,
Corner,
Left,
Right,
Top,
}
impl XlLegendPosition {
#[must_use]
pub const fn to_xml_str(self) -> &'static str {
match self {
Self::Bottom => "b",
Self::Corner => "tr",
Self::Left => "l",
Self::Right => "r",
Self::Top => "t",
}
}
#[must_use]
pub fn from_xml_str(s: &str) -> Option<Self> {
match s {
"b" => Some(Self::Bottom),
"tr" => Some(Self::Corner),
"l" => Some(Self::Left),
"r" => Some(Self::Right),
"t" => Some(Self::Top),
_ => None,
}
}
}
#[non_exhaustive]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum XlMarkerStyle {
Automatic,
Circle,
Dash,
Diamond,
Dot,
None,
Picture,
Plus,
Square,
Star,
Triangle,
X,
}
impl XlMarkerStyle {
#[must_use]
pub const fn to_xml_str(self) -> &'static str {
match self {
Self::Automatic => "auto",
Self::Circle => "circle",
Self::Dash => "dash",
Self::Diamond => "diamond",
Self::Dot => "dot",
Self::None => "none",
Self::Picture => "picture",
Self::Plus => "plus",
Self::Square => "square",
Self::Star => "star",
Self::Triangle => "triangle",
Self::X => "x",
}
}
#[must_use]
pub fn from_xml_str(s: &str) -> Option<Self> {
match s {
"auto" => Some(Self::Automatic),
"circle" => Some(Self::Circle),
"dash" => Some(Self::Dash),
"diamond" => Some(Self::Diamond),
"dot" => Some(Self::Dot),
"none" => Some(Self::None),
"picture" => Some(Self::Picture),
"plus" => Some(Self::Plus),
"square" => Some(Self::Square),
"star" => Some(Self::Star),
"triangle" => Some(Self::Triangle),
"x" => Some(Self::X),
_ => Option::None,
}
}
}
#[non_exhaustive]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum XlDataLabelPosition {
Above,
Below,
BestFit,
Center,
InsideBase,
InsideEnd,
Left,
OutsideEnd,
Right,
}
pub type XlLabelPosition = XlDataLabelPosition;
impl XlDataLabelPosition {
#[must_use]
pub const fn to_xml_str(self) -> &'static str {
match self {
Self::Above => "t",
Self::Below => "b",
Self::BestFit => "bestFit",
Self::Center => "ctr",
Self::InsideBase => "inBase",
Self::InsideEnd => "inEnd",
Self::Left => "l",
Self::OutsideEnd => "outEnd",
Self::Right => "r",
}
}
#[must_use]
pub fn from_xml_str(s: &str) -> Option<Self> {
match s {
"t" => Some(Self::Above),
"b" => Some(Self::Below),
"bestFit" => Some(Self::BestFit),
"ctr" => Some(Self::Center),
"inBase" => Some(Self::InsideBase),
"inEnd" => Some(Self::InsideEnd),
"l" => Some(Self::Left),
"outEnd" => Some(Self::OutsideEnd),
"r" => Some(Self::Right),
_ => None,
}
}
}
#[non_exhaustive]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum XlAxisCrosses {
Automatic,
Custom,
Maximum,
Minimum,
}
impl XlAxisCrosses {
#[must_use]
pub const fn to_xml_str(self) -> &'static str {
match self {
Self::Automatic => "autoZero",
Self::Custom => "",
Self::Maximum => "max",
Self::Minimum => "min",
}
}
#[must_use]
pub fn from_xml_str(s: &str) -> Option<Self> {
match s {
"autoZero" => Some(Self::Automatic),
"max" => Some(Self::Maximum),
"min" => Some(Self::Minimum),
_ => None,
}
}
}
#[non_exhaustive]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum XlCategoryType {
AutomaticScale,
CategoryScale,
TimeScale,
}
#[non_exhaustive]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum XlTickMark {
Cross,
Inside,
None,
Outside,
}
impl XlTickMark {
#[must_use]
pub const fn to_xml_str(self) -> &'static str {
match self {
Self::Cross => "cross",
Self::Inside => "in",
Self::None => "none",
Self::Outside => "out",
}
}
#[must_use]
pub fn from_xml_str(s: &str) -> Option<Self> {
match s {
"cross" => Some(Self::Cross),
"in" => Some(Self::Inside),
"none" => Some(Self::None),
"out" => Some(Self::Outside),
_ => Option::None,
}
}
}
#[non_exhaustive]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum XlTickLabelPosition {
High,
Low,
NextToAxis,
None,
}
impl XlTickLabelPosition {
#[must_use]
pub const fn to_xml_str(self) -> &'static str {
match self {
Self::High => "high",
Self::Low => "low",
Self::NextToAxis => "nextTo",
Self::None => "none",
}
}
#[must_use]
pub fn from_xml_str(s: &str) -> Option<Self> {
match s {
"high" => Some(Self::High),
"low" => Some(Self::Low),
"nextTo" => Some(Self::NextToAxis),
"none" => Some(Self::None),
_ => Option::None,
}
}
}