Exemplo n.º 1
0
$title = $el_class = $value = $label_value = $units = '';
$atts = vc_shortcode_attribute_parse(array('title' => '', 'el_class' => '', 'value' => '50', 'units' => '', 'color' => 'turquoise', 'label_value' => '', 'custom_color' => '', 'width' => '', 'label_type' => 'number', 'icon_type' => ''), $atts);
extract($atts);
wp_enqueue_script('vc_pie');
$color = trim($color);
$set_back_color = false;
if ($color == 'om-theme-color') {
    $color = get_option(OM_THEME_PREFIX . 'hightlight_color');
    $set_back_color = true;
} elseif ($color == 'custom') {
    $color = $custom_color;
    $set_back_color = true;
}
if (substr($color, 0, 1) == '#') {
    $color = om_rgba2string(om_hex2rgb($color));
}
if (is_numeric($width)) {
    $width .= 'px';
}
$animate_label = 1;
if ($label_type == 'title' || $label_type == 'icon') {
    $animate_label = 0;
}
$vc_pie_chart_value = '';
if ($label_type == 'title') {
    $vc_pie_chart_value = $title;
} elseif ($label_type == 'icon') {
    $iconClass = isset(${"icon_" . $icon_type}) ? ${"icon_" . $icon_type} : '';
    if ($iconClass) {
        vc_icon_element_fonts_enqueue($icon_type);
Exemplo n.º 2
0
$lines_color[3] = 0.25;
$lines_color = om_rgba2string($lines_color);
$grid_color[3] = 0.12;
$grid_color = om_rgba2string($grid_color);
$backdrop_color = om_rgb2hsl($backdrop_color);
if ($backdrop_color[2] <= 0.7) {
    $backdrop_color[2] += 0.5;
} else {
    $backdrop_color[2] -= 0.5;
}
if ($backdrop_color[2] > 1) {
    $backdrop_color[2] = 1;
}
$backdrop_color = om_hsl2rgb($backdrop_color);
$backdrop_color[3] = 0.75;
$backdrop_color = om_rgba2string($backdrop_color);
?>
jQuery(function($){
	<?php 
if (in_array($type, array('Line', 'Bar', 'Radar'))) {
    ?>
	var data = {
	    labels: [<?php 
    echo implode(',', $labels);
    ?>
],
	    datasets: [<?php 
    echo implode(',', $data_);
    ?>
]
	};