mirror of
https://github.com/flarum/core.git
synced 2025-07-25 18:51:40 +02:00
feat: add statistics chart export button (#3662)
This commit is contained in:
@@ -318,6 +318,18 @@ export default class StatisticsWidget extends DashboardWidget {
|
|||||||
</>
|
</>
|
||||||
|
|
||||||
{this.noData && <Placeholder text={app.translator.trans(`flarum-statistics.admin.statistics.no_data`)} />}
|
{this.noData && <Placeholder text={app.translator.trans(`flarum-statistics.admin.statistics.no_data`)} />}
|
||||||
|
|
||||||
|
{!this.noData && !!this.chart && (
|
||||||
|
<Button
|
||||||
|
className="StatisticsWidget-chartExport Button"
|
||||||
|
icon="fas fa-file-export"
|
||||||
|
onclick={() => {
|
||||||
|
this.chart.export();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{app.translator.trans('flarum-statistics.admin.statistics.export_chart_button')}
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@@ -109,6 +109,13 @@
|
|||||||
.Placeholder {
|
.Placeholder {
|
||||||
padding-bottom: 32px;
|
padding-bottom: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&-chartExport {
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
margin: 16px;
|
||||||
|
margin-top: -32px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -119,9 +126,9 @@
|
|||||||
position: relative; /* for absolutely positioned tooltip */
|
position: relative; /* for absolutely positioned tooltip */
|
||||||
|
|
||||||
/* https://www.smashingmagazine.com/2015/11/using-system-ui-fonts-practical-guide/ */
|
/* https://www.smashingmagazine.com/2015/11/using-system-ui-fonts-practical-guide/ */
|
||||||
font-family: -apple-system, BlinkMacSystemFont,
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
|
||||||
'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell',
|
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
|
||||||
'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
sans-serif;
|
||||||
|
|
||||||
.axis,
|
.axis,
|
||||||
.chart-label {
|
.chart-label {
|
||||||
|
@@ -20,6 +20,7 @@ flarum-statistics:
|
|||||||
# These translations are used in the Statistics dashboard widget.
|
# These translations are used in the Statistics dashboard widget.
|
||||||
statistics:
|
statistics:
|
||||||
discussions_heading: => core.ref.discussions
|
discussions_heading: => core.ref.discussions
|
||||||
|
export_chart_button: Export chart to SVG
|
||||||
last_12_months_label: Last 12 months
|
last_12_months_label: Last 12 months
|
||||||
last_28_days_label: Last 28 days
|
last_28_days_label: Last 28 days
|
||||||
last_7_days_label: Last 7 days
|
last_7_days_label: Last 7 days
|
||||||
|
Reference in New Issue
Block a user