fix: disable plotters axis labels to avoid system font lookup
Some checks failed
CI / Check / Test (push) Failing after 43s
Some checks failed
CI / Check / Test (push) Failing after 43s
This commit is contained in:
@@ -18,8 +18,6 @@ pub fn render_genre_chart(
|
|||||||
|
|
||||||
let mut chart = ChartBuilder::on(&root)
|
let mut chart = ChartBuilder::on(&root)
|
||||||
.margin(40)
|
.margin(40)
|
||||||
.x_label_area_size(60)
|
|
||||||
.y_label_area_size(60)
|
|
||||||
.build_cartesian_2d(
|
.build_cartesian_2d(
|
||||||
0u32..max_count + 1,
|
0u32..max_count + 1,
|
||||||
(0..report.top_genres.len() as i32).into_segmented(),
|
(0..report.top_genres.len() as i32).into_segmented(),
|
||||||
@@ -29,8 +27,8 @@ pub fn render_genre_chart(
|
|||||||
chart
|
chart
|
||||||
.configure_mesh()
|
.configure_mesh()
|
||||||
.disable_mesh()
|
.disable_mesh()
|
||||||
.label_style(("sans-serif", 14, &WHITE))
|
.disable_x_axis()
|
||||||
.axis_style(RGBColor(100, 100, 100))
|
.disable_y_axis()
|
||||||
.draw()
|
.draw()
|
||||||
.map_err(|e| DomainError::InfrastructureError(e.to_string()))?;
|
.map_err(|e| DomainError::InfrastructureError(e.to_string()))?;
|
||||||
|
|
||||||
@@ -51,7 +49,6 @@ pub fn render_genre_chart(
|
|||||||
.map_err(|e| DomainError::InfrastructureError(e.to_string()))?;
|
.map_err(|e| DomainError::InfrastructureError(e.to_string()))?;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert raw RGB to PNG via image crate
|
|
||||||
let img = image::RgbImage::from_raw(width, height, buf)
|
let img = image::RgbImage::from_raw(width, height, buf)
|
||||||
.ok_or_else(|| DomainError::InfrastructureError("invalid image buffer".into()))?;
|
.ok_or_else(|| DomainError::InfrastructureError("invalid image buffer".into()))?;
|
||||||
let rgba = image::DynamicImage::ImageRgb8(img).to_rgba8();
|
let rgba = image::DynamicImage::ImageRgb8(img).to_rgba8();
|
||||||
|
|||||||
Reference in New Issue
Block a user