PluginProbe
Chartify – WordPress Chart Plugin / 3.5.4
Chartify – WordPress Chart Plugin v3.5.4
3.8.1 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 All 84 releases
← All changes | includes/class-chart-builder-functions.php +42 -96 3.7.8 → 3.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,10 +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 1588 // Show chart description
1591 1589 if (!isset($settings['show_description'])) {
1592 1590 $settings['show_description'] = 'checked';
1593 1591 } else {
@@ -1601,30 +1599,18 @@
1601 1599 } else {
1602 1600 $settings['show_title'] = ( $settings['show_title'] != '' ) ? $settings['show_title'] : 'off';
1603 1601 $settings['show_title'] = isset( $settings['show_title'] ) && $settings['show_title'] == 'on' ? 'checked' : '';
1604 1602 }
1605 -
1606 - // Enable interactivity
1607 - if (!isset($settings['enable_interactivity'])) {
1608 - $settings['enable_interactivity'] = 'checked';
1609 - } else {
1610 - $settings['enable_interactivity'] = ( $settings['enable_interactivity'] != '' ) ? $settings['enable_interactivity'] : 'off';
1611 - $settings['enable_interactivity'] = isset( $settings['enable_interactivity'] ) && $settings['enable_interactivity'] == 'on' ? 'checked' : '';
1612 - }
1613 -
1614 - $counting_source = !empty($source) ? $source : array();
1603 +
1615 1604 $count_slices = (isset($counting_source) && !is_null($counting_source) && count($counting_source) > 0) ? count($counting_source) - 1 : 0;
1616 1605
1617 1606 // Slices settings
1618 1607 $settings['slice_colors_default'] = $chart_default_colors;
1619 - $settings['slice_color'] = isset( $settings['slice_color'] ) && $settings['slice_color'] != '' ? json_decode($settings['slice_color'], true) : array_slice($chart_default_colors, 0, $count_slices);
1620 -
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 +
1621 1610 // Slice border color
1622 1611 $settings['slice_border_color'] = isset( $settings['slice_border_color'] ) && $settings['slice_border_color'] != '' ? esc_attr( $settings['slice_border_color'] ) : '#ffffff';
1623 -
1624 - // Slice border color
1625 - $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']);
1626 -
1612 +
1627 1613 // Slices border width
1628 1614 $settings['slice_border_width'] = isset( $settings['slice_border_width'] ) && $settings['slice_border_width'] != '' ? esc_attr( $settings['slice_border_width'] ) : '1';
1629 1615
1630 1616 // Tooltip text color
@@ -1629,28 +1615,8 @@
1629 1615
1630 1616 // Tooltip text color
1631 1617 $settings['tooltip_text_color'] = isset( $settings['tooltip_text_color'] ) && $settings['tooltip_text_color'] != '' ? esc_attr( $settings['tooltip_text_color'] ) : '#fff';
1632 1618
1633 - $settings['show_color_code'] = isset( $settings['show_color_code'] ) && $settings['show_color_code'] != '' ? esc_attr( $settings['show_color_code'] ) : 'off';
1634 - $settings['show_color_code'] = isset( $settings['show_color_code'] ) && $settings['show_color_code'] == 'on' ? 'checked' : '';
1635 -
1636 - $settings['tooltip_italic'] = ( isset( $settings['tooltip_italic'] ) && $settings['tooltip_italic'] != '' ) ? $settings['tooltip_italic'] : 'off';
1637 - $settings['tooltip_italic'] = isset( $settings['tooltip_italic'] ) && $settings['tooltip_italic'] == 'on' ? 'checked' : '';
1638 -
1639 - // Tooltip font size
1640 - $settings['tooltip_font_size'] = isset( $settings['tooltip_font_size'] ) && intval($settings['tooltip_font_size']) > 0 ? esc_attr( $settings['tooltip_font_size'] ) : '12';
1641 -
1642 - // Tooltip bold options
1643 - $tooltip_bold_options = array(
1644 - "default" => __("Default", "chart-builder"),
1645 - "true" => __("Enable", "chart-builder"),
1646 - "false" => __("Disable", "chart-builder")
1647 - );
1648 -
1649 - // Tooltip bold text
1650 - $settings['tooltip_bold'] = isset( $settings['tooltip_bold'] ) && $settings['tooltip_bold'] != '' ? esc_attr( $settings['tooltip_bold'] ) : 'default';
1651 - $settings['tooltip_bold_options'] = $tooltip_bold_options;
1652 -
1653 1619 // Legend font color
1654 1620 $settings['legend_color'] = isset( $settings['legend_color'] ) && $settings['legend_color'] != '' ? esc_attr( $settings['legend_color'] ) : '#000000';
1655 1621
1656 1622 // Legend font size
@@ -1685,11 +1651,11 @@
1685 1651 *
1686 1652 * @access public
1687 1653 * @return array
1688 1654 */
1689 - public function get_chart_settings_chartjs_public($settings, $chartData) {
1655 + public function get_chart_settings_chartjs_public ($settings) {
1690 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');
1691 - // echo "<pre>"; var_dump($settings); echo "</pre>";
1657 +
1692 1658 // Width
1693 1659 $settings['width'] = isset( $settings['width'] ) && $settings['width'] != '' ? esc_attr( $settings['width'] ) : '100';
1694 1660 $settings['width_format'] = isset( $settings['width_format'] ) && $settings['width_format'] != '' ? esc_attr( $settings['width_format'] ) : '%';
1695 1661 $settings['chart_width'] = $settings['width'].$settings['width_format'];
@@ -1694,10 +1660,10 @@
1694 1660 $settings['width_format'] = isset( $settings['width_format'] ) && $settings['width_format'] != '' ? esc_attr( $settings['width_format'] ) : '%';
1695 1661 $settings['chart_width'] = $settings['width'].$settings['width_format'];
1696 1662
1697 1663 // height
1698 - $settings['height'] = isset( $settings['height'] ) && $settings['height'] != '' ? esc_attr( $settings['height'] ) : '100';
1699 - $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';
1700 1666 $settings['chart_height'] = $settings['height'].$settings['height_format'];
1701 1667
1702 1668 // Show chart description
1703 1669 $settings['show_description'] = isset( $settings['show_description'] ) && $settings['show_description'] != '' ? esc_attr( $settings['show_description'] ) : 'on';
@@ -1703,12 +1669,9 @@
1703 1669 $settings['show_description'] = isset( $settings['show_description'] ) && $settings['show_description'] != '' ? esc_attr( $settings['show_description'] ) : 'on';
1704 1670
1705 1671 // Show chart title
1706 1672 $settings['show_title'] = isset( $settings['show_title'] ) && $settings['show_title'] != '' ? esc_attr( $settings['show_title'] ) : 'on';
1707 -
1708 - // Enable interactivity
1709 - $settings['enable_interactivity'] = isset( $settings['enable_interactivity'] ) && $settings['enable_interactivity'] != '' ? esc_attr( $settings['enable_interactivity'] ) : 'on';
1710 -
1673 +
1711 1674 // Title color
1712 1675 $settings['title_color'] = isset( $settings['title_color'] ) && $settings['title_color'] != '' ? esc_attr( $settings['title_color'] ) : '#000000';
1713 1676
1714 1677 // Title color
@@ -1828,11 +1791,8 @@
1828 1791
1829 1792 // start_angle
1830 1793 $settings['start_angle'] = isset( $settings['start_angle'] ) && $settings['start_angle'] != '' ? esc_attr( absint($settings['start_angle']) ) : 0;
1831 1794
1832 - // rotation_degree
1833 - $settings['rotation_degree'] = isset( $settings['rotation_degree'] ) && $settings['rotation_degree'] != '' ? esc_attr( absint($settings['rotation_degree']) ) : 0;
1834 -
1835 1795 $count_slices = (isset($chartData['source']) && !is_null($chartData['source']) && count($chartData['source']) > 0) ? count($chartData['source']) - 1 : 0;
1836 1796 // Slices settings
1837 1797 $settings['slice_colors_default'] = $chart_default_colors;
1838 1798 $settings['slice_color'] = isset( $settings['slice_color'] ) && $settings['slice_color'] != '' ? json_decode($settings['slice_color'], true) : $chart_default_colors;
@@ -1838,11 +1798,8 @@
1838 1798 $settings['slice_color'] = isset( $settings['slice_color'] ) && $settings['slice_color'] != '' ? json_decode($settings['slice_color'], true) : $chart_default_colors;
1839 1799
1840 1800 // Slice border color
1841 1801 $settings['slice_border_color'] = isset( $settings['slice_border_color'] ) && $settings['slice_border_color'] != '' ? esc_attr( $settings['slice_border_color'] ) : '#ffffff';
1842 -
1843 - // Slice border color
1844 - $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']);
1845 1802
1846 1803 // Slices border width
1847 1804 $settings['slice_border_width'] = isset( $settings['slice_border_width'] ) && $settings['slice_border_width'] != '' ? esc_attr( $settings['slice_border_width'] ) : '1';
1848 1805
@@ -1848,19 +1805,8 @@
1848 1805
1849 1806 // Tooltip text color
1850 1807 $settings['tooltip_text_color'] = isset( $settings['tooltip_text_color'] ) && $settings['tooltip_text_color'] != '' ? esc_attr( $settings['tooltip_text_color'] ) : '#fff';
1851 1808
1852 - // Tooltip font size
1853 - $settings['tooltip_font_size'] = isset( $settings['tooltip_font_size'] ) && intval($settings['tooltip_font_size']) > 0 ? esc_attr( $settings['tooltip_font_size'] ) : 12;
1854 -
1855 - // Show color code
1856 - $settings['show_color_code'] = isset( $settings['show_color_code'] ) && $settings['show_color_code'] != '' ? esc_attr( $settings['show_color_code'] ) : 'off';
1857 - $settings['show_color_code'] = isset( $settings['show_color_code'] ) && $settings['show_color_code'] == 'on' ? 'checked' : '';
1858 -
1859 - // Tooltip Italic text
1860 - $settings['tooltip_italic'] = ( isset( $settings['tooltip_italic'] ) && $settings['tooltip_italic'] != '' ) ? $settings['tooltip_italic'] : 'off';
1861 - //$settings['tooltip_italic'] = isset( $settings['tooltip_italic'] ) && $settings['tooltip_italic'] == 'checked' ? 'italic' : 'normal';
1862 - $settings['tooltip_italic'] = ( isset( $settings['tooltip_italic'] ) && ($settings['tooltip_italic'] == 'checked' || $settings['tooltip_italic'] == 'on') ) ? 'italic' : 'normal';
1863 1809 // Legend font color
1864 1810 $settings['legend_color'] = isset( $settings['legend_color'] ) && $settings['legend_color'] != '' ? esc_attr( $settings['legend_color'] ) : '#000000';
1865 1811
1866 1812 // Legend font size