Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
charts
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor 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
drupal.org
charts
Commits
4bb9056e
Commit
4bb9056e
authored
15 years ago
by
Bruno Massa
Browse files
Options
Downloads
Patches
Plain Diff
New features:
* Google pie charts now accepts multiple series
parent
4a6094ed
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
google_charts/google_charts.inc
+20
-6
20 additions, 6 deletions
google_charts/google_charts.inc
with
20 additions
and
6 deletions
google_charts/google_charts.inc
+
20
−
6
View file @
4bb9056e
...
...
@@ -33,7 +33,12 @@ function _google_charts_chart(&$chart, &$data) {
return
t
(
'This type is not possible using %chartplugin'
,
array
(
'%chartplugin'
=>
'Google Chart'
));
}
$chart
[]
=
'cht='
.
$options
[
$data
[
'#type'
]];
if
(
$data
[
'#type'
]
==
'pie2D'
and
count
(
element_children
(
$data
))
>
1
)
{
$chart
[]
=
'cht=pc'
;
}
else
{
$chart
[]
=
'cht='
.
$options
[
$data
[
'#type'
]];
}
// Convert the chat SIZE into the Google Chart way.
// Since its a requirement to build the chart on Google, if the value
...
...
@@ -134,6 +139,10 @@ function _google_charts_series(&$chart, &$data) {
$chart_data
.
=
','
;
}
if
(
$data
[
'#type'
]
==
'pie2D'
and
!
empty
(
$series
))
{
}
// Get only the numeric values from the series
$series_data
=
_charts_series_values
(
$data
[
$series
]);
...
...
@@ -163,12 +172,12 @@ function _google_charts_series(&$chart, &$data) {
$value_labels
+=
$value_labels_temp
;
}
if
(
$data
[
'#type'
]
!=
'pie2D'
)
{
// Series legends
$legends
[]
=
empty
(
$data
[
$series
][
'#legend'
])
?
NULL
:
$data
[
$series
][
'#legend'
];
if
(
$data
[
'#type'
]
!=
'pie2D'
)
{
// Series legends
$legends
[]
=
empty
(
$data
[
$series
][
'#legend'
])
?
NULL
:
$data
[
$series
][
'#legend'
];
// Series colors
$colors
[]
=
empty
(
$data
[
$series
][
'#color'
])
?
NULL
:
substr
(
$data
[
$series
][
'#color'
],
1
);
// Series colors
$colors
[]
=
empty
(
$data
[
$series
][
'#color'
])
?
NULL
:
substr
(
$data
[
$series
][
'#color'
],
1
);
}
}
...
...
@@ -195,5 +204,10 @@ function _google_charts_series(&$chart, &$data) {
$chart
[]
=
'chl='
.
implode
(
'|'
,
$value_labels
);
}
// Insert multiple series tag
if
(
!
empty
(
$legends
))
{
$chart
[]
=
'chdl='
.
implode
(
'|'
,
$legends
);
}
return
;
}
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