Skip to content

Commit

Permalink
Merge pull request #1920 from scireum/feature/jvo/Dougnot
Browse files Browse the repository at this point in the history
Doughnut Charts Fix
  • Loading branch information
mkeckmkeck authored Jan 12, 2024
2 parents c387380 + 98c7e93 commit f7132aa
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<properties>
<sirius.kernel>dev-42.2.0</sirius.kernel>
<sirius.web>dev-75.2.0</sirius.web>
<sirius.web>dev-75.3.0</sirius.web>
<sirius.db>dev-57.0.0</sirius.db>
</properties>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
package sirius.biz.jobs.interactive;

/**
* Provides a base implementation for interactive dougnut charts.
* Provides a base implementation for interactive doughnut charts.
*/
public abstract class DougnutChartJobFactory extends SingleDatasetChartJobFactory {
public abstract class DoughnutChartJobFactory extends SingleDatasetChartJobFactory {

@Override
public String getIcon() {
return "fas fa-chart-pie";
return "fa-solid fa-chart-pie";
}

@Override
protected String getTemplate() {
return "/templates/biz/jobs/dougnutchart.html.pasta";
return "/templates/biz/jobs/doughnutchart.html.pasta";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@
context="context"
additionalMetrics="additionalMetrics">
<div style="height: 60vh;">
<canvas id="chart" class="chart" style="display: block"></canvas>
<canvas id="chart" class="d-block"></canvas>
</div>

<script type="text/javascript">
@raw {
$(document).ready(function () {
dougnutChart('#chart', [ @labels ], [ @dataset ]);
sirius.ready(function () {
doughnutChart('#chart', [ @labels ], [ @dataset ], {
maintainAspectRatio: false
});
});
}
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
polarAreaChart('#chart-@id', chartData.labels, chartData.data);
} else if (chartData.type === 'dougnut') {
$('#chart-@id').attr('height', 180);
dougnutChart('#chart-@id', chartData.labels, chartData.data);
doughnutChart('#chart-@id', chartData.labels, chartData.data, {
maintainAspectRatio: false
});
}
});
}
Expand Down

0 comments on commit f7132aa

Please sign in to comment.