pub struct ChartStyle {Show 16 fields
pub background: Color,
pub plot_background: Color,
pub grid: Color,
pub axis: Color,
pub border: Border,
pub text: TextStyle,
pub muted_text: TextStyle,
pub colors: [Color; 6],
pub width: f32,
pub height: f32,
pub padding: f32,
pub radius: f32,
pub bar_gap: f32,
pub line_thickness: f32,
pub point_size: f32,
pub gauge_thickness: f32,
}Expand description
Resolved chart colors, typography, and logical-pixel geometry.
Custom geometry is not validated. Padding larger than the canvas collapses the content area to zero; non-finite values can propagate to draw commands.
§Examples
use ailloli_ui_core::Theme;
use ailloli_ui_widgets::controls::{ChartSize, ChartStyle};
let style = ChartStyle::from_theme(Theme::dark(), ChartSize::Compact);
assert_eq!((style.width, style.height, style.padding), (180.0, 124.0, 10.0));
assert_eq!(style.colors.len(), 6);Fields§
§background: ColorRounded outer canvas fill.
plot_background: ColorPlot area and radial-gauge track fill.
grid: ColorHorizontal grid-line color.
axis: ColorLeft and bottom axis color.
border: BorderOuter canvas border.
text: TextStyleTitle and gauge percentage typography.
muted_text: TextStyleEmpty-state, x-label, and gauge-label typography.
colors: [Color; 6]Accent, success, info, warning, danger, and neutral colors in that order.
width: f32Intrinsic canvas width in logical pixels.
height: f32Intrinsic canvas height in logical pixels.
padding: f32Inner inset on every side in logical pixels.
radius: f32Outer canvas corner radius in logical pixels.
bar_gap: f32Horizontal space reserved within each bar group in logical pixels.
line_thickness: f32Line-chart stroke width in logical pixels.
point_size: f32Line-chart point diameter in logical pixels.
gauge_thickness: f32Preferred radial-gauge ring thickness in logical pixels.
Implementations§
Source§impl ChartStyle
impl ChartStyle
Sourcepub fn from_theme(theme: Theme, size: ChartSize) -> Self
pub fn from_theme(theme: Theme, size: ChartSize) -> Self
Resolves all chart styling from a theme and built-in size.
§Examples
use ailloli_ui_core::Theme;
use ailloli_ui_widgets::controls::{ChartSize, ChartStyle};
let style = ChartStyle::from_theme(Theme::default(), ChartSize::Large);
assert_eq!((style.width, style.height), (320.0, 220.0));
assert_eq!((style.line_thickness, style.point_size), (3.0, 6.0));Trait Implementations§
Source§impl Clone for ChartStyle
impl Clone for ChartStyle
Source§fn clone(&self) -> ChartStyle
fn clone(&self) -> ChartStyle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ChartStyle
impl Debug for ChartStyle
Source§impl Default for ChartStyle
impl Default for ChartStyle
Source§impl PartialEq for ChartStyle
impl PartialEq for ChartStyle
impl StructuralPartialEq for ChartStyle
Auto Trait Implementations§
impl Freeze for ChartStyle
impl RefUnwindSafe for ChartStyle
impl Send for ChartStyle
impl Sync for ChartStyle
impl Unpin for ChartStyle
impl UnwindSafe for ChartStyle
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.