FIX: better legend labels for stacked-charts (#6914)

This commit is contained in:
Joffrey JAFFEUX 2019-01-21 17:10:10 +01:00 committed by GitHub
parent a9edcb2e10
commit 3e1e9fce7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 2 deletions

View File

@ -50,7 +50,7 @@ export default Ember.Component.extend({
labels: chartData[0].data.map(cd => cd.x), labels: chartData[0].data.map(cd => cd.x),
datasets: chartData.map(cd => { datasets: chartData.map(cd => {
return { return {
label: cd.req, label: cd.label,
stack: "pageviews-stack", stack: "pageviews-stack",
data: cd.data.map(d => Math.round(parseFloat(d.y))), data: cd.data.map(d => Math.round(parseFloat(d.y))),
backgroundColor: cd.color backgroundColor: cd.color

View File

@ -396,6 +396,7 @@ export default Ember.Component.extend({
return { return {
data: collapseWeekly(chartData.data), data: collapseWeekly(chartData.data),
req: chartData.req, req: chartData.req,
label: chartData.label,
color: chartData.color color: chartData.color
}; };
} else { } else {

View File

@ -478,6 +478,7 @@ Report.reopenClass({
report[filledField] = report[dataField].map(rep => { report[filledField] = report[dataField].map(rep => {
return { return {
req: rep.req, req: rep.req,
label: rep.label,
color: rep.color, color: rep.color,
data: fillMissingDates( data: fillMissingDates(
JSON.parse(JSON.stringify(rep.data)), JSON.parse(JSON.stringify(rep.data)),

View File

@ -221,6 +221,7 @@ class Report
{ {
req: filter, req: filter,
label: I18n.t("reports.consolidated_page_views.xaxis.#{filter}"),
color: color, color: color,
data: ApplicationRequest.where(req_type: ApplicationRequest.req_types[filter]) data: ApplicationRequest.where(req_type: ApplicationRequest.req_types[filter])
} }

View File

@ -969,9 +969,17 @@ en:
description: "Number of users who made their first post during this period." description: "Number of users who made their first post during this period."
consolidated_page_views: consolidated_page_views:
title: "Consolidated Pageviews" title: "Consolidated Pageviews"
xaxis: "Pagesviews" xaxis:
page_view_crawler: "Crawlers"
page_view_anon: "Anonymous users"
page_view_logged_in: "Logged in users"
yaxis: "Day" yaxis: "Day"
description: "Pageviews for logged in users, anonymous users and crawlers." description: "Pageviews for logged in users, anonymous users and crawlers."
labels:
post: Post
editor: Editor
author: Author
edit_reason: Reason
dau_by_mau: dau_by_mau:
title: "DAU/MAU" title: "DAU/MAU"
xaxis: "Day" xaxis: "Day"