Add an option for point circle rendering.

This commit is contained in:
Bauke 2023-06-07 20:19:45 +02:00
parent c432b410ee
commit f1a685f13b
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
2 changed files with 11 additions and 2 deletions

View File

@ -27,6 +27,7 @@ impl UserCountChart {
&self,
parent: &PathBuf,
group_name: &str,
render_point_circles: bool,
) -> Result<PathBuf> {
let parent = parent.join("charts/user-count");
create_dir_all(&parent).await?;
@ -102,7 +103,15 @@ impl UserCountChart {
&ACCENT_1,
&|(x, y), size, style| {
EmptyElement::at((x, y))
+ Circle::new((0, 0), size, style.filled())
+ Circle::new(
(0, 0),
size,
if render_point_circles {
style.filled()
} else {
TRANSPARENT.filled()
},
)
+ Text::new(
{
if (x - 1) % 2 != 0 {

View File

@ -115,7 +115,7 @@ pub async fn run() -> Result<()> {
groups: GroupDataModel::get_n_most_recent(&db, 30, &group.name)
.await?,
}
.render(&output, &group.name)
.render(&output, &group.name, true)
.await?;
}