pub struct Header {
pub values: Option<Vec<String>>,
pub height: Option<f64>,
pub align: Option<String>,
pub font: Option<String>,
pub fill: Option<Rgb>,
}Expand description
A structure representing header formatting for tables.
The Header struct allows customization of table headers including custom values,
height, alignment, font, and fill color.
§Example
use plotlars::{Table, Header, Plot, Text, Rgb};
use polars::prelude::*;
let dataset = df![
"name" => &["Alice", "Bob", "Charlie"],
"age" => &[25, 30, 35],
"city" => &["New York", "London", "Tokyo"]
]
.unwrap();
let header = Header::new()
.values(vec!["Full Name", "Years", "Location"])
.height(40.0)
.align("center")
.font("Arial")
.fill(Rgb(200, 200, 200));
Table::builder()
.data(&dataset)
.columns(vec!["name", "age", "city"])
.header(&header)
.plot_title(Text::from("Employee Information"))
.build()
.plot();
Fields§
§values: Option<Vec<String>>§height: Option<f64>§align: Option<String>§font: Option<String>§fill: Option<Rgb>Implementations§
Source§impl Header
impl Header
Sourcepub fn values(self, values: Vec<&str>) -> Self
pub fn values(self, values: Vec<&str>) -> Self
Sets custom header values.
§Argument
values- A vector of string slices representing custom header names.
Sourcepub fn align(self, align: impl Into<String>) -> Self
pub fn align(self, align: impl Into<String>) -> Self
Sets the alignment of the header text.
§Argument
align- A string specifying the alignment (left, center, right).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Header
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnsafeUnpin for Header
impl UnwindSafe for Header
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Key for Twhere
T: Clone,
impl<T> Key for Twhere
T: Clone,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().