Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
unstable
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PROINFODATA
unstable
Commits
38b9bd0b
Commit
38b9bd0b
authored
11 years ago
by
Eduardo L. Buratti
Browse files
Options
Downloads
Patches
Plain Diff
web: Change os distros colors
Signed-off-by:
Eduardo L. Buratti
<
elb09@c3sl.ufpr.br
>
parent
a49aa23f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
web/public/charts/os.js
+71
-47
71 additions, 47 deletions
web/public/charts/os.js
with
71 additions
and
47 deletions
web/public/charts/os.js
+
71
−
47
View file @
38b9bd0b
...
...
@@ -139,6 +139,36 @@ var Charts = {
var
colors
=
Highcharts
.
getOptions
().
colors
;
var
categories
=
{
le
:
{
name
:
'
Linux Educacional
'
,
color
:
'
#437600
'
},
windows
:
{
name
:
'
Windows
'
,
color
:
'
#18537D
'
},
others
:
{
name
:
'
Outros
'
,
color
:
'
#8F1111
'
,
}
};
var
distros
=
{
'
Linux Educacional 5.0
'
:
{
color
:
'
#437600
'
,
category
:
categories
.
le
},
'
Linux Educacional 4.0
'
:
{
color
:
'
#68950A
'
,
category
:
categories
.
le
},
'
Linux Educacional 3.0
'
:
{
color
:
'
#8DB414
'
,
category
:
categories
.
le
},
'
Linux Educacional 2.0
'
:
{
color
:
'
#B2D31D
'
,
category
:
categories
.
le
},
'
Linux Educacional 1.0
'
:
{
color
:
'
#D7F227
'
,
category
:
categories
.
le
},
'
Windows 7
'
:
{
color
:
'
#18537D
'
,
category
:
categories
.
windows
},
'
Windows MultiPoint Server
'
:{
color
:
'
#73A0B4
'
,
category
:
categories
.
windows
},
'
Ubuntu
'
:
{
color
:
'
#8F1111
'
,
category
:
categories
.
others
},
'
Debian
'
:
{
color
:
'
#C25147
'
,
category
:
categories
.
others
},
'
Outros
'
:
{
color
:
'
#F5917D
'
,
category
:
categories
.
others
},
};
var
DEFAULT_DISTRO
=
{
color
:
'
#FFFEDE
'
,
category
:
categories
.
others
};
/* PIE CHART */
jsRoutes
.
controllers
.
Data
.
os
().
ajax
({
contentType
:
"
application/json
"
,
...
...
@@ -146,63 +176,52 @@ var Charts = {
success
:
function
(
data
)
{
var
total
=
0
;
var
categories
=
[
{
name
:
'
Windows
'
,
y
:
0
,
color
:
colors
[
2
],
sub
:
[]
},
{
name
:
'
Linux Educacional
'
,
y
:
0
,
color
:
colors
[
4
],
sub
:
[]
},
{
name
:
'
Outros
'
,
y
:
0
,
color
:
colors
[
8
],
sub
:
[]
}
];
categories
.
le
.
y
=
0
;
categories
.
windows
.
y
=
0
;
categories
.
others
.
y
=
0
;
for
(
d
in
distros
)
{
distros
[
d
].
y
=
0
;
}
var
distrosArray
=
[];
$
.
each
(
data
,
function
(
key
,
value
)
{
var
val
=
parseInt
(
value
[
0
][
1
]);
var
distro
=
distros
[
key
];
/*if (key === "Linux Educacional 4.0") {
val = 1;
}*/
if
(
typeof
distro
===
'
undefined
'
)
{
distro
=
DEFAULT_DISTRO
;
}
distro
.
category
.
y
+=
val
;
distro
.
name
=
key
;
distro
.
y
+=
val
;
total
+=
val
;
});
var
les
=
[],
windows
=
[],
others
=
[];
if
(
key
.
substring
(
0
,
7
)
==
'
Windows
'
)
{
categories
[
0
].
y
+=
val
;
categories
[
0
].
sub
.
push
({
name
:
key
,
y
:
val
}
);
for
(
d
in
distros
)
{
if
(
distros
[
d
].
category
===
categories
.
le
)
{
les
.
push
(
distros
[
d
]
);
}
else
if
(
key
.
substring
(
0
,
17
)
==
'
Linux Educacional
'
)
{
categories
[
1
].
y
+=
val
;
categories
[
1
].
sub
.
push
({
name
:
key
,
y
:
val
});
else
if
(
distros
[
d
].
category
===
categories
.
le
)
{
windows
.
push
(
distros
[
d
]);
}
else
{
categories
[
2
].
y
+=
val
;
categories
[
2
].
sub
.
push
({
name
:
key
,
y
:
val
});
others
.
push
(
distros
[
d
]);
}
});
var
merge
=
[];
$
.
each
(
categories
,
function
(
key
,
val
)
{
var
baseColor
=
this
.
color
,
len
=
this
.
sub
.
length
,
j
=
0
;
$
.
each
(
this
.
sub
,
function
()
{
var
brightness
=
0.2
-
(
j
/
len
)
/
5
;
this
.
color
=
Highcharts
.
Color
(
baseColor
).
brighten
(
brightness
).
get
()
merge
.
push
(
this
);
j
++
;
});
});
}
Charts
.
pieChart
.
addSeries
({
name
:
'
Sistemas Operacionais
'
,
data
:
categories
,
data
:
[
categories
.
le
,
categories
.
windows
,
categories
.
others
]
,
size
:
'
60%
'
,
dataLabels
:
{
formatter
:
function
()
{
...
...
@@ -216,7 +235,7 @@ var Charts = {
Charts
.
pieChart
.
addSeries
({
name
:
'
Versões
'
,
data
:
merge
,
data
:
les
.
concat
(
windows
,
others
)
,
size
:
'
80%
'
,
innerSize
:
'
60%
'
,
dataLabels
:
{
...
...
@@ -241,15 +260,20 @@ var Charts = {
data
:
'
{"type": "historical", "project": "
'
+
project
+
'
"}
'
,
success
:
function
(
data
)
{
$
.
each
(
data
,
function
(
key
,
value
)
{
var
distro
=
distros
[
key
];
if
(
typeof
distro
===
'
undefined
'
)
{
distro
=
DEFAULT_DISTRO
;
}
for
(
var
i
=
0
;
i
<
value
.
length
;
i
++
)
{
value
[
i
][
0
]
=
parseInt
(
value
[
i
][
0
]);
value
[
i
][
1
]
=
parseInt
(
value
[
i
][
1
]);
};
Charts
.
histChart
.
addSeries
({
name
:
key
,
data
:
value
data
:
value
,
color
:
distro
.
color
},
false
);
});
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment