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
bf894c6f
Commit
bf894c6f
authored
Apr 18, 2019
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support pie charts in Insights
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
65e7821f
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
38 additions
and
13 deletions
+38
-13
doc/user/project/insights/img/insights_example_pie_chart.png
doc/user/project/insights/img/insights_example_pie_chart.png
+0
-0
doc/user/project/insights/index.md
doc/user/project/insights/index.md
+1
-0
ee/app/assets/javascripts/insights/components/chart_js/bar.vue
...p/assets/javascripts/insights/components/chart_js/bar.vue
+0
-3
ee/app/assets/javascripts/insights/components/chart_js/line.vue
.../assets/javascripts/insights/components/chart_js/line.vue
+0
-3
ee/app/assets/javascripts/insights/components/chart_js/pie.vue
...p/assets/javascripts/insights/components/chart_js/pie.vue
+26
-0
ee/app/assets/javascripts/insights/components/chart_js/stacked_bar.vue
.../javascripts/insights/components/chart_js/stacked_bar.vue
+0
-3
ee/app/assets/javascripts/insights/components/insights_page.vue
.../assets/javascripts/insights/components/insights_page.vue
+4
-2
ee/app/controllers/concerns/insights_actions.rb
ee/app/controllers/concerns/insights_actions.rb
+2
-2
ee/changelogs/unreleased/11218-support-pie-chart-in-insights.yml
...gelogs/unreleased/11218-support-pie-chart-in-insights.yml
+5
-0
No files found.
doc/user/project/insights/img/insights_example_pie_chart.png
0 → 100644
View file @
bf894c6f
10.6 KB
doc/user/project/insights/index.md
View file @
bf894c6f
...
...
@@ -131,6 +131,7 @@ Supported values are:
| ----- | ------- |
|
`bar`
| !
[
Insights example bar chart
](
img/insights_example_bar_chart.png
)
|
|
`bar`
(time series, i.e. when
`group_by`
is used) | !
[
Insights example bar time series chart
](
img/insights_example_bar_time_series_chart.png
)
|
|
`pie`
| !
[
Insights example pie chart
](
img/insights_example_pie_chart.png
)
|
|
`line`
| !
[
Insights example stacked bar chart
](
img/insights_example_line_chart.png
)
|
|
`stacked-bar`
| !
[
Insights example stacked bar chart
](
img/insights_example_stacked_bar_chart.png
)
|
...
...
ee/app/assets/javascripts/insights/components/chart_js/bar.vue
View file @
bf894c6f
...
...
@@ -3,9 +3,6 @@ import BaseChart from './insights_chart.vue';
import
*
as
chartOptions
from
'
~/lib/utils/chart_utils
'
;
export
default
{
components
:
{
BaseChart
,
},
extends
:
BaseChart
,
computed
:
{
config
()
{
...
...
ee/app/assets/javascripts/insights/components/chart_js/line.vue
View file @
bf894c6f
...
...
@@ -2,9 +2,6 @@
import
BaseChart
from
'
./insights_chart.vue
'
;
export
default
{
components
:
{
BaseChart
,
},
extends
:
BaseChart
,
computed
:
{
config
()
{
...
...
ee/app/assets/javascripts/insights/components/chart_js/pie.vue
0 → 100644
View file @
bf894c6f
<
script
>
import
BaseChart
from
'
./insights_chart.vue
'
;
import
*
as
chartOptions
from
'
~/lib/utils/chart_utils
'
;
export
default
{
extends
:
BaseChart
,
computed
:
{
config
()
{
return
{
type
:
'
pie
'
,
data
:
this
.
data
,
options
:
{
...
chartOptions
.
pieChartOptions
(),
...
this
.
title
(),
...
this
.
commonOptions
(),
},
};
},
},
};
</
script
>
<
template
>
<div
class=
"chart-canvas-wrapper"
>
<canvas
ref=
"insightsChart"
class=
"pie"
height=
"180"
></canvas>
</div>
</
template
>
ee/app/assets/javascripts/insights/components/chart_js/stacked_bar.vue
View file @
bf894c6f
...
...
@@ -3,9 +3,6 @@ import BaseChart from './insights_chart.vue';
import
*
as
chartOptions
from
'
~/lib/utils/chart_utils
'
;
export
default
{
components
:
{
BaseChart
,
},
extends
:
BaseChart
,
computed
:
{
config
()
{
...
...
ee/app/assets/javascripts/insights/components/insights_page.vue
View file @
bf894c6f
...
...
@@ -7,18 +7,20 @@ import { GlLoadingIcon } from '@gitlab/ui';
import
InsightsChartError
from
'
./insights_chart_error.vue
'
;
import
InsightsConfigWarning
from
'
./insights_config_warning.vue
'
;
import
StackedBar
from
'
./chart_js/stacked_bar.vue
'
;
import
Bar
from
'
./chart_js/bar.vue
'
;
import
LineChart
from
'
./chart_js/line.vue
'
;
import
Pie
from
'
./chart_js/pie.vue
'
;
import
StackedBar
from
'
./chart_js/stacked_bar.vue
'
;
export
default
{
components
:
{
GlLoadingIcon
,
InsightsChartError
,
InsightsConfigWarning
,
StackedBar
,
Bar
,
LineChart
,
Pie
,
StackedBar
,
},
props
:
{
queryEndpoint
:
{
...
...
ee/app/controllers/concerns/insights_actions.rb
View file @
bf894c6f
...
...
@@ -65,7 +65,7 @@ module InsightsActions
case
chart_type_param
when
'stacked-bar'
,
'line'
Gitlab
::
Insights
::
Reducers
::
LabelCountPerPeriodReducer
.
reduce
(
issuables
,
period:
period_param
,
period_limit:
period_limit
,
labels:
collection_labels_param
)
when
'bar'
when
'bar'
,
'pie'
if
period_param
Gitlab
::
Insights
::
Reducers
::
CountPerPeriodReducer
.
reduce
(
issuables
,
period:
period_param
,
period_limit:
period_limit
)
else
...
...
@@ -84,7 +84,7 @@ module InsightsActions
case
chart_type_param
when
'stacked-bar'
Gitlab
::
Insights
::
Serializers
::
Chartjs
::
MultiSeriesSerializer
when
'bar'
when
'bar'
,
'pie'
if
period_param
Gitlab
::
Insights
::
Serializers
::
Chartjs
::
BarTimeSeriesSerializer
else
...
...
ee/changelogs/unreleased/11218-support-pie-chart-in-insights.yml
0 → 100644
View file @
bf894c6f
---
title
:
Support pie charts in Insights
merge_request
:
11186
author
:
type
:
added
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