PluginProbe
Chartify – WordPress Chart Plugin / 3.5.4
Chartify – WordPress Chart Plugin v3.5.4
3.8.0 3.7.9 3.7.8 3.7.7 3.7.6 3.7.5 trunk 1.0.0 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 All 83 releases
← All changes | includes/class-chart-builder-functions.php +42 -111 3.7.93.5.4 View file →
@@ -399,9 +399,9 @@
399 399 *
400 400 * @access public
401 401 * @return array
402 402 */
403 - public function get_chart_settings_google_admin($settings, $action, $source) {
403 + public function get_chart_settings_google_admin ($settings, $action, $source) {
404 404 $chart_default_colors = array('#3366cc','#dc3912','#ff9900','#109618', '#990099','#0099c6','#dd4477','#66aa00', '#b82e2e','#316395','#994499','#22aa99', '#aaaa11','#6633cc','#e67300','#8b0707', '#651067','#329262','#5574a6','#3b3eac', '#b77322','#16d620','#b91383','#f4359e', '#9c5935','#a9c413','#2a778d','#668d1c', '#bea413','#0c5922','#743411');
405 405
406 406 $tooltip_trigger_options = array(
407 407 "hover" => __("While hovering", "chart-builder"),
@@ -969,9 +969,9 @@
969 969
970 970 $settings['enable_img'] = ( isset( $settings['enable_img'] ) && $settings['enable_img'] != '' ) ? $settings['enable_img'] : 'off';
971 971 $settings['enable_img'] = isset( $settings['enable_img'] ) && $settings['enable_img'] == 'on' ? 'checked' : '';
972 972
973 - $counting_source = !empty($source) ? $source : array();
973 + $counting_source = $source;
974 974
975 975 $count_slices = (isset($counting_source) && !is_null($counting_source) && count($counting_source) > 0) ? count($counting_source) - 1 : 0;
976 976 $count_series = (isset($counting_source[0]) && !is_null($counting_source[0]) && count($counting_source[0]) > 0) ? count($counting_source[0]) - 1 : 0;
977 977 $count_rows = (isset($counting_source) && !is_null($counting_source) && count($counting_source) > 0) ? count(array_column($counting_source, 0)) - 1 : 0;
@@ -1397,58 +1397,58 @@
1397 1397 *
1398 1398 * @access public
1399 1399 * @return array
1400 1400 */
1401 - public function get_chart_settings_chartjs_admin($settings, $source) {
1401 + public function get_chart_settings_chartjs_admin ($settings) {
1402 1402 $chart_default_colors = array('#36A2EB','#FF6384','#FF9F40','#FFCD56', '#4BC0C0','#0099c6','#dd4477','#66aa00', '#b82e2e','#316395','#994499','#22aa99', '#aaaa11','#6633cc','#e67300','#8b0707', '#651067','#329262','#5574a6','#3b3eac', '#b77322','#16d620','#b91383','#f4359e', '#9c5935','#a9c413','#2a778d','#668d1c', '#bea413','#0c5922','#743411');
1403 1403
1404 1404 $title_positions = array(
1405 - "left" => __("Left", "chart-builder"),
1406 - "right" => __("Right", "chart-builder"),
1407 - "center" => __("Center", "chart-builder")
1405 + "left" => __("Left", "chart-builder"),
1406 + "right" => __("Right", "chart-builder"),
1407 + "center" => __("Center", "chart-builder")
1408 1408 );
1409 1409
1410 1410 $text_transforms = array(
1411 - "uppercase" => __("Uppercase", "chart-builder"),
1412 - "lowercase" => __("Lowercase", "chart-builder"),
1413 - "capitalize" => __("Capitalize", "chart-builder"),
1414 - "none" => __("None", "chart-builder"),
1411 + "uppercase" => __("Uppercase", "chart-builder"),
1412 + "lowercase" => __("Lowercase", "chart-builder"),
1413 + "capitalize" => __("Capitalize", "chart-builder"),
1414 + "none" => __("None", "chart-builder"),
1415 1415 );
1416 1416
1417 1417 $text_decorations = array(
1418 - "overline" => __("Overline", "chart-builder"),
1419 - "underline" => __("Underline", "chart-builder"),
1420 - "line-through" => __("Line through", "chart-builder"),
1421 - "none" => __("None", "chart-builder"),
1418 + "overline" => __("Overline", "chart-builder"),
1419 + "underline" => __("Underline", "chart-builder"),
1420 + "line-through" => __("Line through", "chart-builder"),
1421 + "none" => __("None", "chart-builder"),
1422 1422 );
1423 1423
1424 1424 $border_styles = array(
1425 - "solid" => __("Solid", "chart-builder"),
1426 - "dashed" => __("Dashed", "chart-builder"),
1427 - "dotted" => __("Dotted", "chart-builder"),
1428 - "double" => __("Double", "chart-builder"),
1429 - "groove" => __("Groove", "chart-builder"),
1430 - "inset" => __("Inset", "chart-builder"),
1431 - "outset" => __("Outset", "chart-builder"),
1432 - "ridge" => __("Ridge", "chart-builder")
1425 + "solid" => __("Solid", "chart-builder"),
1426 + "dashed" => __("Dashed", "chart-builder"),
1427 + "dotted" => __("Dotted", "chart-builder"),
1428 + "double" => __("Double", "chart-builder"),
1429 + "groove" => __("Groove", "chart-builder"),
1430 + "inset" => __("Inset", "chart-builder"),
1431 + "outset" => __("Outset", "chart-builder"),
1432 + "ridge" => __("Ridge", "chart-builder")
1433 1433 );
1434 1434
1435 1435 $legend_positions = array(
1436 - "top" => __("Above the chart", "chart-builder"),
1437 - "bottom" => __("Below the chart", "chart-builder"),
1438 - "left" => __("Left of the chart", "chart-builder"),
1439 - "right" => __("Right of the chart", "chart-builder"),
1436 + "top" => __("Above the chart", "chart-builder"),
1437 + "bottom" => __("Below the chart", "chart-builder"),
1438 + "left" => __("Left of the chart", "chart-builder"),
1439 + "right" => __("Right of the chart", "chart-builder"),
1440 1440 );
1441 1441
1442 1442 $legend_alignments = array(
1443 - "start" => __("Start", "chart-builder"),
1444 - "center" => __("Center", "chart-builder"),
1445 - "end" => __("End", "chart-builder"),
1443 + "start" => __("Start", "chart-builder"),
1444 + "center" => __("Center", "chart-builder"),
1445 + "end" => __("End", "chart-builder"),
1446 1446 );
1447 1447
1448 1448 $group_width_format_options = array(
1449 - "%" => __("%", "chart-builder"),
1450 - "px" => __("px", "chart-builder"),
1449 + "%" => __("%", "chart-builder"),
1450 + "px" => __("px", "chart-builder"),
1451 1451 );
1452 1452
1453 1453 // Width
1454 1454 $settings['width'] = isset( $settings['width'] ) && $settings['width'] != '' ? esc_attr( $settings['width'] ) : '100';
@@ -1455,10 +1455,10 @@
1455 1455 $settings['width_format'] = isset( $settings['width_format'] ) && $settings['width_format'] != '' ? esc_attr( $settings['width_format'] ) : '%';
1456 1456 $settings['width_format_options'] = $group_width_format_options;
1457 1457
1458 1458 // Height
1459 - $settings['height'] = isset( $settings['height'] ) && $settings['height'] != '' ? esc_attr( $settings['height'] ) : '100';
1460 - $settings['height_format'] = isset( $settings['height_format'] ) && $settings['height_format'] != '' ? esc_attr( $settings['height_format'] ) : '%';
1459 + $settings['height'] = isset( $settings['height'] ) && $settings['height'] != '' ? esc_attr( $settings['height'] ) : '400';
1460 + $settings['height_format'] = isset( $settings['height_format'] ) && $settings['height_format'] != '' ? esc_attr( $settings['height_format'] ) : 'px';
1461 1461
1462 1462 // Title color
1463 1463 $settings['title_color'] = isset( $settings['title_color'] ) && $settings['title_color'] != '' ? esc_attr( $settings['title_color'] ) : '#000000';
1464 1464
@@ -1584,22 +1584,8 @@
1584 1584
1585 1585 // start_angle
1586 1586 $settings['start_angle'] = isset( $settings['start_angle'] ) && $settings['start_angle'] != '' ? esc_attr( absint($settings['start_angle']) ) : 0;
1587 1587
1588 - // rotation_degree
1589 - $settings['rotation_degree'] = isset( $settings['rotation_degree'] ) && $settings['rotation_degree'] != '' ? esc_attr( absint($settings['rotation_degree']) ) : 0;
1590 -
1591 - // Tooltip text options
1592 - $tooltip_text_options = array(
1593 - "value" => __("Value", "chart-builder"),
1594 - "percentage" => __("Percent", "chart-builder"),
1595 - "both" => __("Value & Percent", "chart-builder")
1596 - );
1597 - $settings['tooltip_text_options'] = $tooltip_text_options;
1598 -
1599 - // Tooltip text
1600 - $settings['tooltip_text'] = isset( $settings['tooltip_text'] ) && $settings['tooltip_text'] != '' ? esc_attr( $settings['tooltip_text'] ) : 'value';
1601 -
1602 1588 // Show chart description
1603 1589 if (!isset($settings['show_description'])) {
1604 1590 $settings['show_description'] = 'checked';
1605 1591 } else {
@@ -1613,30 +1599,18 @@
1613 1599 } else {
1614 1600 $settings['show_title'] = ( $settings['show_title'] != '' ) ? $settings['show_title'] : 'off';
1615 1601 $settings['show_title'] = isset( $settings['show_title'] ) && $settings['show_title'] == 'on' ? 'checked' : '';
1616 1602 }
1617 -
1618 - // Enable interactivity
1619 - if (!isset($settings['enable_interactivity'])) {
1620 - $settings['enable_interactivity'] = 'checked';
1621 - } else {
1622 - $settings['enable_interactivity'] = ( $settings['enable_interactivity'] != '' ) ? $settings['enable_interactivity'] : 'off';
1623 - $settings['enable_interactivity'] = isset( $settings['enable_interactivity'] ) && $settings['enable_interactivity'] == 'on' ? 'checked' : '';
1624 - }
1625 -
1626 - $counting_source = !empty($source) ? $source : array();
1603 +
1627 1604 $count_slices = (isset($counting_source) && !is_null($counting_source) && count($counting_source) > 0) ? count($counting_source) - 1 : 0;
1628 1605
1629 1606 // Slices settings
1630 1607 $settings['slice_colors_default'] = $chart_default_colors;
1631 - $settings['slice_color'] = isset( $settings['slice_color'] ) && $settings['slice_color'] != '' ? json_decode($settings['slice_color'], true) : array_slice($chart_default_colors, 0, $count_slices);
1632 -
1608 + $settings['slice_color'] = isset( $settings['slice_color'] ) && $settings['slice_color'] != '' ? json_decode($settings['slice_color'], true) : array_slice($chart_default_colors, 0, $count_slices);;
1609 +
1633 1610 // Slice border color
1634 1611 $settings['slice_border_color'] = isset( $settings['slice_border_color'] ) && $settings['slice_border_color'] != '' ? esc_attr( $settings['slice_border_color'] ) : '#ffffff';
1635 -
1636 - // Slice border color
1637 - $settings['slices_border_color'] = isset( $settings['slices_border_color'] ) && $settings['slices_border_color'] != '' ? json_decode($settings['slices_border_color'], true) : array_fill(0, $count_slices, $settings['slice_border_color']);
1638 -
1612 +
1639 1613 // Slices border width
1640 1614 $settings['slice_border_width'] = isset( $settings['slice_border_width'] ) && $settings['slice_border_width'] != '' ? esc_attr( $settings['slice_border_width'] ) : '1';
1641 1615
1642 1616 // Tooltip text color
@@ -1641,28 +1615,8 @@
1641 1615
1642 1616 // Tooltip text color
1643 1617 $settings['tooltip_text_color'] = isset( $settings['tooltip_text_color'] ) && $settings['tooltip_text_color'] != '' ? esc_attr( $settings['tooltip_text_color'] ) : '#fff';
1644 1618
1645 - $settings['show_color_code'] = isset( $settings['show_color_code'] ) && $settings['show_color_code'] != '' ? esc_attr( $settings['show_color_code'] ) : 'off';
1646 - $settings['show_color_code'] = isset( $settings['show_color_code'] ) && $settings['show_color_code'] == 'on' ? 'checked' : '';
1647 -
1648 - $settings['tooltip_italic'] = ( isset( $settings['tooltip_italic'] ) && $settings['tooltip_italic'] != '' ) ? $settings['tooltip_italic'] : 'off';
1649 - $settings['tooltip_italic'] = isset( $settings['tooltip_italic'] ) && $settings['tooltip_italic'] == 'on' ? 'checked' : '';
1650 -
1651 - // Tooltip font size
1652 - $settings['tooltip_font_size'] = isset( $settings['tooltip_font_size'] ) && intval($settings['tooltip_font_size']) > 0 ? esc_attr( $settings['tooltip_font_size'] ) : '12';
1653 -
1654 - // Tooltip bold options
1655 - $tooltip_bold_options = array(
1656 - "default" => __("Default", "chart-builder"),
1657 - "true" => __("Enable", "chart-builder"),
1658 - "false" => __("Disable", "chart-builder")
1659 - );
1660 -
1661 - // Tooltip bold text
1662 - $settings['tooltip_bold'] = isset( $settings['tooltip_bold'] ) && $settings['tooltip_bold'] != '' ? esc_attr( $settings['tooltip_bold'] ) : 'default';
1663 - $settings['tooltip_bold_options'] = $tooltip_bold_options;
1664 -
1665 1619 // Legend font color
1666 1620 $settings['legend_color'] = isset( $settings['legend_color'] ) && $settings['legend_color'] != '' ? esc_attr( $settings['legend_color'] ) : '#000000';
1667 1621
1668 1622 // Legend font size
@@ -1697,11 +1651,11 @@
1697 1651 *
1698 1652 * @access public
1699 1653 * @return array
1700 1654 */
1701 - public function get_chart_settings_chartjs_public($settings, $chartData) {
1655 + public function get_chart_settings_chartjs_public ($settings) {
1702 1656 $chart_default_colors = array('#36A2EB','#FF6384','#FF9F40','#FFCD56', '#4BC0C0','#0099c6','#dd4477','#66aa00', '#b82e2e','#316395','#994499','#22aa99', '#aaaa11','#6633cc','#e67300','#8b0707', '#651067','#329262','#5574a6','#3b3eac', '#b77322','#16d620','#b91383','#f4359e', '#9c5935','#a9c413','#2a778d','#668d1c', '#bea413','#0c5922','#743411');
1703 - // echo "<pre>"; var_dump($settings); echo "</pre>";
1657 +
1704 1658 // Width
1705 1659 $settings['width'] = isset( $settings['width'] ) && $settings['width'] != '' ? esc_attr( $settings['width'] ) : '100';
1706 1660 $settings['width_format'] = isset( $settings['width_format'] ) && $settings['width_format'] != '' ? esc_attr( $settings['width_format'] ) : '%';
1707 1661 $settings['chart_width'] = $settings['width'].$settings['width_format'];
@@ -1706,10 +1660,10 @@
1706 1660 $settings['width_format'] = isset( $settings['width_format'] ) && $settings['width_format'] != '' ? esc_attr( $settings['width_format'] ) : '%';
1707 1661 $settings['chart_width'] = $settings['width'].$settings['width_format'];
1708 1662
1709 1663 // height
1710 - $settings['height'] = isset( $settings['height'] ) && $settings['height'] != '' ? esc_attr( $settings['height'] ) : '100';
1711 - $settings['height_format'] = isset( $settings['height_format'] ) && $settings['height_format'] != '' ? esc_attr( $settings['height_format'] ) : '%';
1664 + $settings['height'] = isset( $settings['height'] ) && $settings['height'] != '' ? esc_attr( $settings['height'] ) : '400';
1665 + $settings['height_format'] = isset( $settings['height_format'] ) && $settings['height_format'] != '' ? esc_attr( $settings['height_format'] ) : 'px';
1712 1666 $settings['chart_height'] = $settings['height'].$settings['height_format'];
1713 1667
1714 1668 // Show chart description
1715 1669 $settings['show_description'] = isset( $settings['show_description'] ) && $settings['show_description'] != '' ? esc_attr( $settings['show_description'] ) : 'on';
@@ -1715,12 +1669,9 @@
1715 1669 $settings['show_description'] = isset( $settings['show_description'] ) && $settings['show_description'] != '' ? esc_attr( $settings['show_description'] ) : 'on';
1716 1670
1717 1671 // Show chart title
1718 1672 $settings['show_title'] = isset( $settings['show_title'] ) && $settings['show_title'] != '' ? esc_attr( $settings['show_title'] ) : 'on';
1719 -
1720 - // Enable interactivity
1721 - $settings['enable_interactivity'] = isset( $settings['enable_interactivity'] ) && $settings['enable_interactivity'] != '' ? esc_attr( $settings['enable_interactivity'] ) : 'on';
1722 -
1673 +
1723 1674 // Title color
1724 1675 $settings['title_color'] = isset( $settings['title_color'] ) && $settings['title_color'] != '' ? esc_attr( $settings['title_color'] ) : '#000000';
1725 1676
1726 1677 // Title color
@@ -1840,14 +1791,8 @@
1840 1791
1841 1792 // start_angle
1842 1793 $settings['start_angle'] = isset( $settings['start_angle'] ) && $settings['start_angle'] != '' ? esc_attr( absint($settings['start_angle']) ) : 0;
1843 1794
1844 - // rotation_degree
1845 - $settings['rotation_degree'] = isset( $settings['rotation_degree'] ) && $settings['rotation_degree'] != '' ? esc_attr( absint($settings['rotation_degree']) ) : 0;
1846 -
1847 - // Tooltip text
1848 - $settings['tooltip_text'] = isset( $settings['tooltip_text'] ) && $settings['tooltip_text'] != '' ? esc_attr( $settings['tooltip_text'] ) : 'value';
1849 -
1850 1795 $count_slices = (isset($chartData['source']) && !is_null($chartData['source']) && count($chartData['source']) > 0) ? count($chartData['source']) - 1 : 0;
1851 1796 // Slices settings
1852 1797 $settings['slice_colors_default'] = $chart_default_colors;
1853 1798 $settings['slice_color'] = isset( $settings['slice_color'] ) && $settings['slice_color'] != '' ? json_decode($settings['slice_color'], true) : $chart_default_colors;
@@ -1853,11 +1798,8 @@
1853 1798 $settings['slice_color'] = isset( $settings['slice_color'] ) && $settings['slice_color'] != '' ? json_decode($settings['slice_color'], true) : $chart_default_colors;
1854 1799
1855 1800 // Slice border color
1856 1801 $settings['slice_border_color'] = isset( $settings['slice_border_color'] ) && $settings['slice_border_color'] != '' ? esc_attr( $settings['slice_border_color'] ) : '#ffffff';
1857 -
1858 - // Slice border color
1859 - $settings['slices_border_color'] = isset( $settings['slices_border_color'] ) && $settings['slices_border_color'] != '' ? json_decode($settings['slices_border_color'], true) : array_fill(0, $count_slices, $settings['slice_border_color']);
1860 1802
1861 1803 // Slices border width
1862 1804 $settings['slice_border_width'] = isset( $settings['slice_border_width'] ) && $settings['slice_border_width'] != '' ? esc_attr( $settings['slice_border_width'] ) : '1';
1863 1805
@@ -1863,19 +1805,8 @@
1863 1805
1864 1806 // Tooltip text color
1865 1807 $settings['tooltip_text_color'] = isset( $settings['tooltip_text_color'] ) && $settings['tooltip_text_color'] != '' ? esc_attr( $settings['tooltip_text_color'] ) : '#fff';
1866 1808
1867 - // Tooltip font size
1868 - $settings['tooltip_font_size'] = isset( $settings['tooltip_font_size'] ) && intval($settings['tooltip_font_size']) > 0 ? esc_attr( $settings['tooltip_font_size'] ) : 12;
1869 -
1870 - // Show color code
1871 - $settings['show_color_code'] = isset( $settings['show_color_code'] ) && $settings['show_color_code'] != '' ? esc_attr( $settings['show_color_code'] ) : 'off';
1872 - $settings['show_color_code'] = isset( $settings['show_color_code'] ) && $settings['show_color_code'] == 'on' ? 'checked' : '';
1873 -
1874 - // Tooltip Italic text
1875 - $settings['tooltip_italic'] = ( isset( $settings['tooltip_italic'] ) && $settings['tooltip_italic'] != '' ) ? $settings['tooltip_italic'] : 'off';
1876 - //$settings['tooltip_italic'] = isset( $settings['tooltip_italic'] ) && $settings['tooltip_italic'] == 'checked' ? 'italic' : 'normal';
1877 - $settings['tooltip_italic'] = ( isset( $settings['tooltip_italic'] ) && ($settings['tooltip_italic'] == 'checked' || $settings['tooltip_italic'] == 'on') ) ? 'italic' : 'normal';
1878 1809 // Legend font color
1879 1810 $settings['legend_color'] = isset( $settings['legend_color'] ) && $settings['legend_color'] != '' ? esc_attr( $settings['legend_color'] ) : '#000000';
1880 1811
1881 1812 // Legend font size