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:
parent
ed92f63a9b
commit
446831af33
2 changed files with 7 additions and 1 deletions
|
|
@ -261,7 +261,8 @@ impl Render for ChartStory {
|
||||||
LineChart::new(self.monthly_devices.clone())
|
LineChart::new(self.monthly_devices.clone())
|
||||||
.x(|d| d.month.clone())
|
.x(|d| d.month.clone())
|
||||||
.y(|d| d.desktop)
|
.y(|d| d.desktop)
|
||||||
.dot(),
|
.dot()
|
||||||
|
.stroke(cx.theme().chart_5),
|
||||||
false,
|
false,
|
||||||
cx,
|
cx,
|
||||||
)),
|
)),
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,11 @@ where
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn stroke(mut self, stroke: impl Into<Hsla>) -> Self {
|
||||||
|
self.stroke = Some(stroke.into());
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
pub fn natural(mut self) -> Self {
|
pub fn natural(mut self) -> Self {
|
||||||
self.stroke_style = StrokeStyle::Natural;
|
self.stroke_style = StrokeStyle::Natural;
|
||||||
self
|
self
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue