Enhancement in gmaps module
This commit is contained in:
parent
5f06e2dc16
commit
2e51ab945f
@ -1141,7 +1141,7 @@ function dol_print_address($address,$htmlid='gmap',$mode,$id)
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
'; */
|
'; */
|
||||||
print ' <a href="'.$url.'" target="_gmaps"><img id="'.$htmlid.'" src="'.DOL_URL_ROOT.'/theme/common/gmap.png"></a>';
|
print ' <a href="'.$url.'" target="_gmaps"><img id="'.$htmlid.'" border="0" src="'.DOL_URL_ROOT.'/theme/common/gmap.png"></a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1241,8 +1241,9 @@ function dol_print_graph($htmlid,$width,$height,$data,$showlegend=0,$type='pie')
|
|||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
if (empty($conf->use_javascript_ajax)) return;
|
if (empty($conf->use_javascript_ajax)) return;
|
||||||
$jsgraphlib='flot';
|
$jsgraphlib='flot';
|
||||||
$datacolor=array("#d18b2c", "#dba255", "#919733");
|
$datacolor=array();
|
||||||
|
|
||||||
|
// Load colors of theme into $datacolor array
|
||||||
$color_file = DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/graph-color.php";
|
$color_file = DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/graph-color.php";
|
||||||
if (is_readable($color_file))
|
if (is_readable($color_file))
|
||||||
{
|
{
|
||||||
@ -1261,23 +1262,11 @@ function dol_print_graph($htmlid,$width,$height,$data,$showlegend=0,$type='pie')
|
|||||||
// We use Flot js lib
|
// We use Flot js lib
|
||||||
if ($jsgraphlib == 'flot')
|
if ($jsgraphlib == 'flot')
|
||||||
{
|
{
|
||||||
print '<script type="text/javascript">
|
|
||||||
jQuery(function () {
|
|
||||||
// data
|
|
||||||
/*var data = [
|
|
||||||
{ label: "Series1<br>aa", data: 10},
|
|
||||||
{ label: "Series2", data: 30},
|
|
||||||
{ label: "Series3", data: 90}
|
|
||||||
];
|
|
||||||
var data = [
|
|
||||||
{ label: "Series1", data: [[1,10]]},
|
|
||||||
{ label: "Series2", data: [[1,30]]},
|
|
||||||
{ label: "Series3", data: [[1,90]]}
|
|
||||||
];*/
|
|
||||||
';
|
|
||||||
if ($type == 'pie')
|
if ($type == 'pie')
|
||||||
{
|
{
|
||||||
print 'var data = ['."\n";
|
print '<script type="text/javascript">
|
||||||
|
jQuery(function () {
|
||||||
|
var data = ['."\n";
|
||||||
$i=0;
|
$i=0;
|
||||||
foreach($data as $serie)
|
foreach($data as $serie)
|
||||||
{
|
{
|
||||||
@ -1308,16 +1297,20 @@ function dol_print_graph($htmlid,$width,$height,$data,$showlegend=0,$type='pie')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} },
|
} },
|
||||||
colors: [';
|
';
|
||||||
$j=0;
|
if (sizeof($datacolor))
|
||||||
foreach($datacolor as $val)
|
{
|
||||||
{
|
print 'colors: [';
|
||||||
print '"'.$val.'"';
|
$j=0;
|
||||||
if ($j < sizeof($datacolor)) print ',';
|
foreach($datacolor as $val)
|
||||||
$j++;
|
{
|
||||||
}
|
print '"'.$val.'"';
|
||||||
print '],
|
if ($j < sizeof($datacolor)) print ',';
|
||||||
legend: {show: '.($showlegend?'true':'false').'}
|
$j++;
|
||||||
|
}
|
||||||
|
print '], ';
|
||||||
|
}
|
||||||
|
print 'legend: {show: '.($showlegend?'true':'false').'}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>';
|
</script>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user