This repository was archived by the owner on Jul 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +12
-9
lines changed
javascripts/discourse/components
stylesheets/modules/sentiment/common Expand file tree Collapse file tree 3 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -20,8 +20,8 @@ import { clipboardCopy } from "discourse/lib/utilities";
2020import Post from " discourse/models/post" ;
2121import closeOnClickOutside from " discourse/modifiers/close-on-click-outside" ;
2222import { i18n } from " discourse-i18n" ;
23- import DoughnutChart from " discourse/plugins/discourse-ai/discourse/components/doughnut-chart" ;
2423import DTooltip from " float-kit/components/d-tooltip" ;
24+ import DoughnutChart from " discourse/plugins/discourse-ai/discourse/components/doughnut-chart" ;
2525
2626export default class AdminReportSentimentAnalysis extends Component {
2727 @service router;
@@ -326,12 +326,6 @@ export default class AdminReportSentimentAnalysis extends Component {
326326 @ action ={{this .backToAllCharts }}
327327 />
328328
329- {{!-- <DButton
330- @title="discourse_ai.sentiments.sentiment_analysis.share_chart"
331- @icon={{this.shareIcon}}
332- @action={{this.shareChart}}
333- class="share btn-flat"
334- /> --}}
335329 <DTooltip
336330 class =" share btn-flat"
337331 @ icon ={{this .shareIcon }}
@@ -348,6 +342,8 @@ export default class AdminReportSentimentAnalysis extends Component {
348342 @ data ={{this .selectedChart.scores }}
349343 @ totalScore ={{this .selectedChart.total_score }}
350344 @ doughnutTitle ={{this .selectedChart.title }}
345+ @ skipCanvasResize ={{ true }}
346+ @ displayLegend ={{ true }}
351347 @ radius ={{ 100 }}
352348 />
353349
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ export default class DoughnutChart extends Component {
3333
3434 get config () {
3535 const totalScore = this .args .totalScore || " " ;
36+ const skipCanvasResize = this .args .skipCanvasResize || false ;
3637 const radius = this .getRadius ();
3738
3839 const paddingTop = 30 ;
@@ -66,7 +67,8 @@ export default class DoughnutChart extends Component {
6667 },
6768 plugins: {
6869 legend: {
69- display: false ,
70+ display: this .args .displayLegend || false ,
71+ position: " bottom" ,
7072 },
7173 },
7274 },
@@ -104,6 +106,9 @@ export default class DoughnutChart extends Component {
104106 {
105107 id: " resizeCanvas" ,
106108 afterDraw : function (chart ) {
109+ if (skipCanvasResize) {
110+ return ;
111+ }
107112 const size = ` ${ canvasSize} px` ;
108113 chart .canvas .style .width = size;
109114 chart .canvas .style .height = size;
Original file line number Diff line number Diff line change 102102 text-align : center ;
103103 margin-top : 0.3rem ;
104104 padding-top : 2rem ;
105- border-top : 1px solid var (--primary-low );
106105 }
107106 }
108107
109108 & __selected-chart-actions {
110109 display : flex ;
111110 align-items : center ;
111+ padding-bottom : 0.35rem ;
112+ border-bottom : 1px solid var (--primary-low );
113+
112114 .share {
113115 margin-left : auto ;
114116
You can’t perform that action at this time.
0 commit comments