Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
2782c76d
Commit
2782c76d
authored
Sep 16, 2019
by
Martin Wortschack
Committed by
Kushal Pandya
Sep 16, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add yAxis formatter to column chart
- This display axis labels as 0.5 instead of 500m
parent
0b03342f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
5 deletions
+16
-5
ee/app/assets/javascripts/analytics/productivity_analytics/components/app.vue
...ripts/analytics/productivity_analytics/components/app.vue
+11
-1
ee/app/assets/javascripts/analytics/productivity_analytics/store/modules/charts/getters.js
...cs/productivity_analytics/store/modules/charts/getters.js
+2
-1
ee/spec/frontend/analytics/productivity_analytics/store/modules/charts/getters_spec.js
...oductivity_analytics/store/modules/charts/getters_spec.js
+3
-3
No files found.
ee/app/assets/javascripts/analytics/productivity_analytics/components/app.vue
View file @
2782c76d
...
...
@@ -58,7 +58,7 @@ export default {
...
mapGetters
(
'
charts
'
,
[
'
chartLoading
'
,
'
getChartData
'
,
'
getColumnChartOption
'
,
'
getColumnChart
Datazoom
Option
'
,
'
getMetricDropdownLabel
'
,
'
isSelectedMetric
'
,
]),
...
...
@@ -95,6 +95,16 @@ export default {
getMetricTypes
(
chartKey
)
{
return
metricTypes
.
filter
(
m
=>
m
.
chart
===
chartKey
);
},
getColumnChartOption
(
chartKey
)
{
return
{
yAxis
:
{
axisLabel
:
{
formatter
:
value
=>
value
,
},
},
...
this
.
getColumnChartDatazoomOption
(
chartKey
),
};
},
},
};
</
script
>
...
...
ee/app/assets/javascripts/analytics/productivity_analytics/store/modules/charts/getters.js
View file @
2782c76d
...
...
@@ -78,8 +78,9 @@ export const getFilterParams = (state, getters, rootState, rootGetters) => chart
*
* If the number of data items being displayed is below the MAX_ITEMS_PER_PAGE threshold,
* it will return an empty dataZoom property.
*
*/
export
const
getColumnChartOption
=
state
=>
chartKey
=>
{
export
const
getColumnChart
Datazoom
Option
=
state
=>
chartKey
=>
{
const
{
data
}
=
state
.
charts
[
chartKey
];
const
totalItems
=
Object
.
keys
(
data
).
length
;
const
MAX_ITEMS_PER_PAGE
=
maxColumnChartItemsPerPage
[
chartKey
]
...
...
ee/spec/frontend/analytics/productivity_analytics/store/modules/charts/getters_spec.js
View file @
2782c76d
...
...
@@ -142,7 +142,7 @@ describe('Productivity analytics chart getters', () => {
});
});
describe
(
'
getColumnChartOption
'
,
()
=>
{
describe
(
'
getColumnChart
Datazoom
Option
'
,
()
=>
{
const
chartKey
=
chartKeys
.
main
;
describe
(
`data exceeds threshold of
${
maxColumnChartItemsPerPage
[
chartKey
]}
items`
,
()
=>
{
...
...
@@ -167,7 +167,7 @@ describe('Productivity analytics chart getters', () => {
],
};
expect
(
getters
.
getColumnChartOption
(
state
)(
chartKeys
.
main
)).
toEqual
(
expected
);
expect
(
getters
.
getColumnChart
Datazoom
Option
(
state
)(
chartKeys
.
main
)).
toEqual
(
expected
);
});
});
...
...
@@ -175,7 +175,7 @@ describe('Productivity analytics chart getters', () => {
it
(
'
returns an empty dataZoom property
'
,
()
=>
{
state
.
charts
[
chartKey
].
data
=
{
'
1
'
:
1
,
'
2
'
:
2
,
'
3
'
:
3
};
expect
(
getters
.
getColumnChartOption
(
state
)(
chartKeys
.
main
)).
toEqual
({});
expect
(
getters
.
getColumnChart
Datazoom
Option
(
state
)(
chartKeys
.
main
)).
toEqual
({});
});
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment