chart: Add support to set stroke color on line chart (#1629)

Close #1625.

<img width="335" height="422" alt="image"
src="https://github.com/user-attachments/assets/f2235b42-9a3e-4ed7-88ae-b694ee579faf"
/>
This commit is contained in:
Floyd Wang 2025-11-18 13:52:39 +08:00 committed by GitHub
parent ed92f63a9b
commit 446831af33
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View file

@ -261,7 +261,8 @@ impl Render for ChartStory {
LineChart::new(self.monthly_devices.clone())
.x(|d| d.month.clone())
.y(|d| d.desktop)
.dot(),
.dot()
.stroke(cx.theme().chart_5),
false,
cx,
)),

View file

@ -59,6 +59,11 @@ where
self
}
pub fn stroke(mut self, stroke: impl Into<Hsla>) -> Self {
self.stroke = Some(stroke.into());
self
}
pub fn natural(mut self) -> Self {
self.stroke_style = StrokeStyle::Natural;
self