shortcode-vc-round-chart.php 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <?php
  2. if ( ! defined( 'ABSPATH' ) ) {
  3. die( '-1' );
  4. }
  5. return array(
  6. 'name' => esc_html__( 'Round Chart', 'js_composer' ),
  7. 'base' => 'vc_round_chart',
  8. 'class' => '',
  9. 'icon' => 'icon-wpb-vc-round-chart',
  10. 'category' => esc_html__( 'Content', 'js_composer' ),
  11. 'description' => esc_html__( 'Pie and Doughnut charts', 'js_composer' ),
  12. 'params' => array(
  13. array(
  14. 'type' => 'textfield',
  15. 'heading' => esc_html__( 'Widget title', 'js_composer' ),
  16. 'param_name' => 'title',
  17. 'description' => esc_html__( 'Enter text used as widget title (Note: located above content element).', 'js_composer' ),
  18. 'admin_label' => true,
  19. ),
  20. array(
  21. 'type' => 'dropdown',
  22. 'heading' => esc_html__( 'Design', 'js_composer' ),
  23. 'param_name' => 'type',
  24. 'value' => array(
  25. esc_html__( 'Pie', 'js_composer' ) => 'pie',
  26. esc_html__( 'Doughnut', 'js_composer' ) => 'doughnut',
  27. ),
  28. 'description' => esc_html__( 'Select type of chart.', 'js_composer' ),
  29. 'admin_label' => true,
  30. ),
  31. array(
  32. 'type' => 'dropdown',
  33. 'heading' => esc_html__( 'Style', 'js_composer' ),
  34. 'description' => esc_html__( 'Select chart color style.', 'js_composer' ),
  35. 'param_name' => 'style',
  36. 'value' => array(
  37. esc_html__( 'Flat', 'js_composer' ) => 'flat',
  38. esc_html__( 'Modern', 'js_composer' ) => 'modern',
  39. esc_html__( 'Custom', 'js_composer' ) => 'custom',
  40. ),
  41. 'dependency' => array(
  42. 'callback' => 'vcChartCustomColorDependency',
  43. ),
  44. ),
  45. array(
  46. 'type' => 'dropdown',
  47. 'heading' => esc_html__( 'Gap', 'js_composer' ),
  48. 'param_name' => 'stroke_width',
  49. 'value' => array(
  50. 0 => 0,
  51. 1 => 1,
  52. 2 => 2,
  53. 5 => 5,
  54. ),
  55. 'description' => esc_html__( 'Select gap size.', 'js_composer' ),
  56. 'std' => 2,
  57. ),
  58. array(
  59. 'type' => 'dropdown',
  60. 'heading' => esc_html__( 'Outline color', 'js_composer' ),
  61. 'param_name' => 'stroke_color',
  62. 'value' => vc_get_shared( 'colors-dashed' ) + array( esc_html__( 'Custom', 'js_composer' ) => 'custom' ),
  63. 'description' => esc_html__( 'Select outline color.', 'js_composer' ),
  64. 'param_holder_class' => 'vc_colored-dropdown',
  65. 'std' => 'white',
  66. 'dependency' => array(
  67. 'element' => 'stroke_width',
  68. 'value_not_equal_to' => '0',
  69. ),
  70. ),
  71. array(
  72. 'type' => 'colorpicker',
  73. 'heading' => esc_html__( 'Custom outline color', 'js_composer' ),
  74. 'param_name' => 'custom_stroke_color',
  75. 'description' => esc_html__( 'Select custom outline color.', 'js_composer' ),
  76. 'dependency' => array(
  77. 'element' => 'stroke_color',
  78. 'value' => array( 'custom' ),
  79. ),
  80. ),
  81. array(
  82. 'type' => 'checkbox',
  83. 'heading' => esc_html__( 'Show legend?', 'js_composer' ),
  84. 'param_name' => 'legend',
  85. 'description' => esc_html__( 'If checked, chart will have legend.', 'js_composer' ),
  86. 'value' => array( esc_html__( 'Yes', 'js_composer' ) => 'yes' ),
  87. 'std' => 'yes',
  88. ),
  89. array(
  90. 'type' => 'checkbox',
  91. 'heading' => esc_html__( 'Show hover values?', 'js_composer' ),
  92. 'param_name' => 'tooltips',
  93. 'description' => esc_html__( 'If checked, chart will show values on hover.', 'js_composer' ),
  94. 'value' => array( esc_html__( 'Yes', 'js_composer' ) => 'yes' ),
  95. 'std' => 'yes',
  96. ),
  97. array(
  98. 'type' => 'param_group',
  99. 'heading' => esc_html__( 'Values', 'js_composer' ),
  100. 'param_name' => 'values',
  101. 'value' => rawurlencode( wp_json_encode( array(
  102. array(
  103. 'title' => esc_html__( 'One', 'js_composer' ),
  104. 'value' => '60',
  105. 'color' => 'blue',
  106. ),
  107. array(
  108. 'title' => esc_html__( 'Two', 'js_composer' ),
  109. 'value' => '40',
  110. 'color' => 'pink',
  111. ),
  112. ) ) ),
  113. 'params' => array(
  114. array(
  115. 'type' => 'textfield',
  116. 'heading' => esc_html__( 'Title', 'js_composer' ),
  117. 'param_name' => 'title',
  118. 'description' => esc_html__( 'Enter title for chart area.', 'js_composer' ),
  119. 'admin_label' => true,
  120. ),
  121. array(
  122. 'type' => 'textfield',
  123. 'heading' => esc_html__( 'Value', 'js_composer' ),
  124. 'param_name' => 'value',
  125. 'description' => esc_html__( 'Enter value for area.', 'js_composer' ),
  126. ),
  127. array(
  128. 'type' => 'dropdown',
  129. 'heading' => esc_html__( 'Color', 'js_composer' ),
  130. 'param_name' => 'color',
  131. 'value' => vc_get_shared( 'colors-dashed' ),
  132. 'description' => esc_html__( 'Select area color.', 'js_composer' ),
  133. 'param_holder_class' => 'vc_colored-dropdown',
  134. ),
  135. array(
  136. 'type' => 'colorpicker',
  137. 'heading' => esc_html__( 'Custom color', 'js_composer' ),
  138. 'param_name' => 'custom_color',
  139. 'description' => esc_html__( 'Select custom area color.', 'js_composer' ),
  140. ),
  141. ),
  142. 'callbacks' => array(
  143. 'after_add' => 'vcChartParamAfterAddCallback',
  144. ),
  145. ),
  146. array(
  147. 'type' => 'dropdown',
  148. 'heading' => esc_html__( 'Animation', 'js_composer' ),
  149. 'description' => esc_html__( 'Select animation style.', 'js_composer' ),
  150. 'param_name' => 'animation',
  151. 'value' => vc_get_shared( 'animation styles' ),
  152. 'std' => 'easeInOutCubic',
  153. ),
  154. vc_map_add_css_animation(),
  155. array(
  156. 'type' => 'el_id',
  157. 'heading' => esc_html__( 'Element ID', 'js_composer' ),
  158. 'param_name' => 'el_id',
  159. 'description' => sprintf( esc_html__( 'Enter element ID (Note: make sure it is unique and valid according to %sw3c specification%s).', 'js_composer' ), '<a href="https://www.w3schools.com/tags/att_global_id.asp" target="_blank">', '</a>' ),
  160. ),
  161. array(
  162. 'type' => 'textfield',
  163. 'heading' => esc_html__( 'Extra class name', 'js_composer' ),
  164. 'param_name' => 'el_class',
  165. 'description' => esc_html__( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
  166. ),
  167. array(
  168. 'type' => 'css_editor',
  169. 'heading' => esc_html__( 'CSS box', 'js_composer' ),
  170. 'param_name' => 'css',
  171. 'group' => esc_html__( 'Design Options', 'js_composer' ),
  172. ),
  173. ),
  174. );