Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
f943f877
Commit
f943f877
authored
Jun 6, 2011
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
New: Graph js librairie can accept url to click on values.
parent
a3755324
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
htdocs/lib/functions.lib.php
+9
-3
9 additions, 3 deletions
htdocs/lib/functions.lib.php
with
9 additions
and
3 deletions
htdocs/lib/functions.lib.php
+
9
−
3
View file @
f943f877
...
...
@@ -1238,8 +1238,9 @@ function dolibarr_trunc($string,$size=40,$trunc='right',$stringencoding='')
* @param showlegend Show legend
* @param type Type of graph ('pie', 'barline')
* @param showpercent Show percent (with type='pie' only)
* @param url Param to add an url to click values
*/
function
dol_print_graph
(
$htmlid
,
$width
,
$height
,
$data
,
$showlegend
=
0
,
$type
=
'pie'
,
$showpercent
=
0
)
function
dol_print_graph
(
$htmlid
,
$width
,
$height
,
$data
,
$showlegend
=
0
,
$type
=
'pie'
,
$showpercent
=
0
,
$url
=
''
)
{
global
$conf
,
$langs
;
global
$theme_datacolor
;
// To have var kept when function is called several times
...
...
@@ -1301,9 +1302,14 @@ function dol_print_graph($htmlid,$width,$height,$data,$showlegend=0,$type='pie',
formatter: function(label, series) {
var percent=Math.round(series.percent);
var number=series.data[0][1];
return \'<div style="font-size:8pt;text-align:center;padding:2px;color:white;">\'+'
.
(
$showlegend
?
'number'
:
'label+\'<br/>\'+number'
);
return \''
;
print
'<div style="font-size:8pt;text-align:center;padding:2px;color:white;">'
;
if
(
$url
)
print
'<a style="color: #FFFFFF;" border="0" href="'
.
$url
.
'=">'
;
print
'\'+'
.
(
$showlegend
?
'number'
:
'label+\'<br/>\'+number'
);
if
(
!
empty
(
$showpercent
))
print
'+\'<br/>\'+percent+\'%\''
;
print
'+\'</div>\';
print
'+\''
;
if
(
$url
)
print
'</a>'
;
print
'</div>\';
},
background: {
opacity: 0.5,
...
...
...
...
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