cambio de fuentes css

This commit is contained in:
marcos 2021-05-25 09:32:29 +02:00
parent 9e13604f49
commit 191dfa9c53
9 changed files with 85 additions and 47 deletions

View File

@ -176,6 +176,7 @@ if (file_exists('languages/'.$user_language.'.mo') === true) {
$params['only_image'] = false; $params['only_image'] = false;
$params['menu'] = false; $params['menu'] = false;
$params['disable_black'] = true;
$params_combined = json_decode($data_combined, true); $params_combined = json_decode($data_combined, true);
$module_list = json_decode($data_module_list, true); $module_list = json_decode($data_module_list, true);
@ -219,6 +220,7 @@ if (file_exists('languages/'.$user_language.'.mo') === true) {
break; break;
case 'pie_chart': case 'pie_chart':
$params['pdf'] = true;
echo flot_pie_chart( echo flot_pie_chart(
$params['values'], $params['values'],
$params['keys'], $params['keys'],
@ -234,10 +236,12 @@ if (file_exists('languages/'.$user_language.'.mo') === true) {
break; break;
case 'vbar': case 'vbar':
$params['pdf'] = true;
echo flot_vcolumn_chart($params); echo flot_vcolumn_chart($params);
break; break;
case 'hbar': case 'hbar':
$params['pdf'] = true;
echo flot_hcolumn_chart( echo flot_hcolumn_chart(
$params['chart_data'], $params['chart_data'],
$params['width'], $params['width'],
@ -248,11 +252,13 @@ if (file_exists('languages/'.$user_language.'.mo') === true) {
$params['backgroundColor'], $params['backgroundColor'],
$params['tick_color'], $params['tick_color'],
$params['val_min'], $params['val_min'],
$params['val_max'] $params['val_max'],
$params['pdf']
); );
break; break;
case 'ring_graph': case 'ring_graph':
$params['pdf'] = true;
echo flot_custom_pie_chart( echo flot_custom_pie_chart(
$params['chart_data'], $params['chart_data'],
$params['width'], $params['width'],
@ -271,7 +277,8 @@ if (file_exists('languages/'.$user_language.'.mo') === true) {
$params['homeurl'], $params['homeurl'],
$params['background_color'], $params['background_color'],
$params['legend_position'], $params['legend_position'],
$params['background_color'] $params['background_color'],
$params['pdf']
); );
break; break;

View File

@ -735,6 +735,10 @@ function grafico_modulo_sparse($params)
$params['backgroundColor'] = 'white'; $params['backgroundColor'] = 'white';
} }
if (isset($params['only_image']) === true) {
$params['backgroundColor'] = 'transparent';
}
if (isset($params['percentil']) === false) { if (isset($params['percentil']) === false) {
$params['percentil'] = null; $params['percentil'] = null;
} }
@ -1530,9 +1534,13 @@ function graphic_combined_module(
} }
$long_index = ''; $long_index = '';
if ($config['style'] === 'pandora_black') {
if ($config['style'] === 'pandora_black' && ($params['pdf'] === false || $params['pdf'] === null )
) {
$background_color = '#222'; $background_color = '#222';
$params['legend_color'] = '#fff'; $params['legend_color'] = '#fff';
} else if ($params['pdf']) {
$params['legend_color'] = '#000';
} }
switch ($params_combined['stacked']) { switch ($params_combined['stacked']) {
@ -2262,7 +2270,11 @@ function graphic_combined_module(
$ttl, $ttl,
$homeurl, $homeurl,
$background_color, $background_color,
'#c1c1c1' '#c1c1c1',
null,
null,
false,
$params['pdf']
); );
} }
@ -2282,10 +2294,10 @@ function graphic_combined_module(
$options['generals']['forceTicks'] = true; $options['generals']['forceTicks'] = true;
$options['x']['labelWidth'] = ($params['pdf'] === true) ? 30 : $sizeLabelTickWidth; $options['x']['labelWidth'] = ($params['pdf'] === true) ? 30 : $sizeLabelTickWidth;
$options['generals']['arrayColors'] = $color; $options['generals']['arrayColors'] = $color;
$options['grid']['backgroundColor'] = 'transparent';
$options['grid']['backgroundColor'] = $background_color; $options['grid']['backgroundColor'] = $background_color;
$options['y']['color'] = $background_color; $options['y']['color'] = $background_color;
$options['x']['color'] = $background_color; $options['x']['color'] = $background_color;
$options['pdf'] = $params['pdf'];
$output = vbar_graph($graph_values, $options, $ttl); $output = vbar_graph($graph_values, $options, $ttl);
} }
@ -2382,7 +2394,8 @@ function graphic_combined_module(
false, false,
$color, $color,
false, false,
$background_color $background_color,
$params['pdf']
); );
break; break;
} }
@ -3816,6 +3829,7 @@ function graph_custom_sql_graph(
$options['generals']['forceTicks'] = true; $options['generals']['forceTicks'] = true;
$options['generals']['arrayColors'] = $color; $options['generals']['arrayColors'] = $color;
$options['x']['labelWidth'] = 75; $options['x']['labelWidth'] = 75;
$options['pdf'] = $only_image;
if ($ttl === 2) { if ($ttl === 2) {
$options['x']['labelWidth'] = 35; $options['x']['labelWidth'] = 35;
$options['backgroundColor'] = 'transparent'; $options['backgroundColor'] = 'transparent';
@ -3824,7 +3838,6 @@ function graph_custom_sql_graph(
$options['x']['color'] = 'transparent'; $options['x']['color'] = 'transparent';
$options['generals']['pdf']['width'] = $width; $options['generals']['pdf']['width'] = $width;
$options['generals']['pdf']['height'] = $height; $options['generals']['pdf']['height'] = $height;
$output .= '<img src="data:image/jpg;base64,'; $output .= '<img src="data:image/jpg;base64,';
$output .= vbar_graph($data, $options, $ttl); $output .= vbar_graph($data, $options, $ttl);
$output .= '" />'; $output .= '" />';

View File

@ -4902,7 +4902,7 @@ function reporting_sql_graph(
$width, $width,
$height, $height,
$content['type'], $content['type'],
true, $only_image,
ui_get_full_url(false, false, false, false), ui_get_full_url(false, false, false, false),
$ttl, $ttl,
$content['top_n_value'] $content['top_n_value']

View File

@ -218,7 +218,9 @@ function vbar_graph(
if (isset($options['x']['font']['color']) === false) { if (isset($options['x']['font']['color']) === false) {
$options['x']['font']['color'] = '#545454'; $options['x']['font']['color'] = '#545454';
if ($config['style'] === 'pandora_black') { if ($options['pdf'] === true) {
$options['x']['font']['color'] = '#000';
} else if ($config['style'] === 'pandora_black') {
$options['x']['font']['color'] = '#fff'; $options['x']['font']['color'] = '#fff';
} }
} }
@ -301,9 +303,10 @@ function vbar_graph(
if (isset($options['y']['font']['color']) === false) { if (isset($options['y']['font']['color']) === false) {
$options['y']['font']['color'] = '#545454'; $options['y']['font']['color'] = '#545454';
if ($options['pdf'] === true) {
if ($config['style'] === 'pandora_black') { $options['y']['font']['color'] = '#000';
$options['y']['font']['color'] = '#222'; } else if ($config['style'] === 'pandora_black') {
$options['y']['font']['color'] = '#fff';
} }
} }
@ -359,7 +362,7 @@ function vbar_graph(
if (isset($options['grid']['color']) === false) { if (isset($options['grid']['color']) === false) {
$options['grid']['color'] = '#ffffff'; $options['grid']['color'] = '#ffffff';
if ($config['style'] === 'pandora_black') { if ($config['style'] === 'pandora_black') {
$options['grid']['color'] = '#222'; $options['grid']['color'] = '#111';
} }
} }
@ -370,7 +373,7 @@ function vbar_graph(
'#ffffff', '#ffffff',
], ],
]; ];
if ($config['style'] === 'pandora_black') { if ($config['style'] === 'pandora_black' && $ttl === 1) {
$options['grid']['backgroundColor'] = [ $options['grid']['backgroundColor'] = [
'colors' => [ 'colors' => [
'#222', '#222',
@ -714,7 +717,8 @@ function hbar_graph(
$tick_color='white', $tick_color='white',
$val_min=null, $val_min=null,
$val_max=null, $val_max=null,
$base64=false $base64=false,
$pdf=false
) { ) {
global $config; global $config;
if ($water_mark !== false) { if ($water_mark !== false) {
@ -742,7 +746,11 @@ function hbar_graph(
return generator_chart_to_pdf('hbar', $params); return generator_chart_to_pdf('hbar', $params);
} }
if ($config['style'] === 'pandora_black') { if ($config['style'] === 'pandora_black' && $ttl === 1) {
$backgroundColor = '#222';
}
if ($config['style'] === 'pandora_black' && $ttl === 1) {
$tick_color = '#fff'; $tick_color = '#fff';
} }
@ -756,7 +764,8 @@ function hbar_graph(
$backgroundColor, $backgroundColor,
$tick_color, $tick_color,
$val_min, $val_min,
$val_max $val_max,
$pdf
); );
} }
@ -859,7 +868,8 @@ function ring_graph(
$legend_position=false, $legend_position=false,
$colors='', $colors='',
$hide_labels=false, $hide_labels=false,
$background_color='white' $background_color='white',
$pdf=false
) { ) {
if (empty($chart_data)) { if (empty($chart_data)) {
return graph_nodata_image($width, $height, 'pie'); return graph_nodata_image($width, $height, 'pie');
@ -887,7 +897,7 @@ function ring_graph(
'homeurl' => $homeurl, 'homeurl' => $homeurl,
'background_color' => $background_color, 'background_color' => $background_color,
'legend_position' => $legend_position, 'legend_position' => $legend_position,
'background_color' => $background_color, 'pdf' => $pdf,
]; ];
return generator_chart_to_pdf('ring_graph', $params); return generator_chart_to_pdf('ring_graph', $params);
@ -911,6 +921,7 @@ function ring_graph(
$homeurl, $homeurl,
$background_color, $background_color,
$legend_position, $legend_position,
$background_color $background_color,
$pdf
); );
} }

View File

@ -235,7 +235,7 @@ function pandoraFlotPieCustom(
if (background_color == "transparent") { if (background_color == "transparent") {
$(".legend>table").css("background-color", ""); $(".legend>table").css("background-color", "");
$(".legend>div").css("background-color", ""); $(".legend>div").css("background-color", "");
$(".legend>table").css("color", "#aaa"); $(".legend>table").css("color", "#000");
} else if (background_color == "white") { } else if (background_color == "white") {
$(".legend>table").css("background-color", "white"); $(".legend>table").css("background-color", "white");
$(".legend>table").css("color", "black"); $(".legend>table").css("color", "black");
@ -627,7 +627,9 @@ function pandoraFlotVBars(settings) {
return ticksformatter[Math.round(v)]; return ticksformatter[Math.round(v)];
}; };
} }
font.family = "lato"; settings.x.font.family = "lato";
settings.y.font.family = "lato";
var options = { var options = {
series: { series: {
bars: { bars: {

View File

@ -145,11 +145,14 @@ function flot_area_graph(
break; break;
} }
if ($config['style'] === 'pandora_black') { if ($config['style'] === 'pandora_black' && ($params['pdf'] === false || $params['pdf'] === null )
) {
$background_style = '#222'; $background_style = '#222';
$params['grid_color'] = '#fff'; $params['grid_color'] = '#fff';
$params['backgroundColor'] = '#222'; $params['backgroundColor'] = '#222';
$params['legend_color'] = '#fff'; $params['legend_color'] = '#fff';
} else if ($params['pdf']) {
$params['legend_color'] = '#000';
} }
// Parent layer. // Parent layer.
@ -482,15 +485,13 @@ function flot_custom_pie_chart(
$ttl, $ttl,
$homeurl, $homeurl,
$background_color, $background_color,
$legend_position $legend_position,
$pdf
) { ) {
global $config; global $config;
if ($config['style'] === 'pandora_black') {
$background_color = 'black_theme';
}
// TODO // TODO
// include_javascript_dependencies_flot_graph(); // include_javascript_dependencies_flot_graph();.
$total_modules = $graph_values['total_modules']; $total_modules = $graph_values['total_modules'];
unset($graph_values['total_modules']); unset($graph_values['total_modules']);
@ -546,18 +547,23 @@ function flot_custom_pie_chart(
} }
// Returns a 3D column chart // Returns a 3D column chart.
function flot_hcolumn_chart($graph_data, $width, $height, $water_mark, $font='', $font_size=7, $background_color='white', $tick_color='white', $val_min=null, $val_max=null) function flot_hcolumn_chart($graph_data, $width, $height, $water_mark, $font='', $font_size=7, $background_color='white', $tick_color='white', $val_min=null, $val_max=null, $pdf=false)
{ {
global $config; global $config;
// include_javascript_dependencies_flot_graph(); if ($pdf === true) {
$background_color = 'white';
$tick_color = '#000';
}
// Include_javascript_dependencies_flot_graph().
$return = ''; $return = '';
$stacked_str = ''; $stacked_str = '';
$multicolor = true; $multicolor = true;
// Get a unique identifier to graph // Get a unique identifier to graph.
$graph_id = uniqid('graph_'); $graph_id = uniqid('graph_');
$graph_id2 = uniqid('graph_'); $graph_id2 = uniqid('graph_');
@ -573,11 +579,11 @@ function flot_hcolumn_chart($graph_data, $width, $height, $water_mark, $font='',
} }
// Set a weird separator to serialize and unserialize passing data // Set a weird separator to serialize and unserialize passing data
// from php to javascript // from php to javascript.
$separator = ';;::;;'; $separator = ';;::;;';
$separator2 = ':,:,,,:,:'; $separator2 = ':,:,,,:,:';
// Transform data from our format to library format // Transform data from our format to library format.
$labels = []; $labels = [];
$a = []; $a = [];
$vars = []; $vars = [];
@ -614,10 +620,10 @@ function flot_hcolumn_chart($graph_data, $width, $height, $water_mark, $font='',
$val_max = $max; $val_max = $max;
} }
// Store serialized data to use it from javascript // Store serialized data to use it from javascript.
$labels = implode($separator, $labels); $labels = implode($separator, $labels);
// Store data series in javascript format // Store data series in javascript format.
$jsvars = ''; $jsvars = '';
$jsseries = []; $jsseries = [];
@ -633,7 +639,7 @@ function flot_hcolumn_chart($graph_data, $width, $height, $water_mark, $font='',
$jsseries = implode(',', $jsseries); $jsseries = implode(',', $jsseries);
// Javascript code // Javascript code.
$return .= "<script type='text/javascript'>"; $return .= "<script type='text/javascript'>";
$return .= "pandoraFlotHBars('$graph_id', '$values', '$labels', $max, '$water_mark', '$separator', '$separator2', '$font', $font_size, '$background_color', '$tick_color', $val_min, $val_max)"; $return .= "pandoraFlotHBars('$graph_id', '$values', '$labels', $max, '$water_mark', '$separator', '$separator2', '$font', $font_size, '$background_color', '$tick_color', $val_min, $val_max)";
$return .= '</script>'; $return .= '</script>';
@ -683,14 +689,6 @@ function flot_vcolumn_chart(array $options)
$options['graphId'] = $graphId; $options['graphId'] = $graphId;
// If pandora_black theme its enabled then change grid colors. // If pandora_black theme its enabled then change grid colors.
/*
if ($config['style'] === 'pandora_black') {
$options['grid']['backgroundColor']['colors'][0] = 'transparent';
$options['grid']['backgroundColor']['colors'][1] = 'transparent';
$options['y']['color'] = 'transparent';
$options['x']['color'] = 'transparent';
}*/
$settings = base64_encode(json_encode($options)); $settings = base64_encode(json_encode($options));
// Javascript code. // Javascript code.

View File

@ -1,6 +1,6 @@
.new_task p, .new_task p,
.new_task div { .new_task div {
font-weight: lighter; font-weight: inherit;
} }
.new_task { .new_task {
margin-top: 30px; margin-top: 30px;

View File

@ -1031,3 +1031,7 @@ li.ui-tabs-tab.ui-corner-top.ui-state-default.ui-tab {
.new_task div { .new_task div {
font-weight: initial; font-weight: initial;
} }
.flot-base {
background-color: #222;
}

View File

@ -96,7 +96,10 @@ if (check_acl_restricted_all($config['id_user'], $report_group, 'RW')) {
$options['main']['text'] = '<a href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=main&action=edit&id_report='.$id_report.'&pure='.$pure.'">'.html_print_image( $options['main']['text'] = '<a href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=main&action=edit&id_report='.$id_report.'&pure='.$pure.'">'.html_print_image(
'images/op_reporting.png', 'images/op_reporting.png',
true, true,
['title' => __('Main data')] [
'title' => __('Main data'),
'class' => 'invert_filter',
]
).'</a>'; ).'</a>';
$options['list_items']['text'] = '<a href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=edit&id_report='.$id_report.'&pure='.$pure.'">'.html_print_image( $options['list_items']['text'] = '<a href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=edit&id_report='.$id_report.'&pure='.$pure.'">'.html_print_image(