shortcode-vc-line-chart.php 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <?php
  2. if ( ! defined( 'ABSPATH' ) ) {
  3. die( '-1' );
  4. }
  5. return array(
  6. 'name' => esc_html__( 'Line Chart', 'js_composer' ),
  7. 'base' => 'vc_line_chart',
  8. 'class' => '',
  9. 'icon' => 'icon-wpb-vc-line-chart',
  10. 'category' => esc_html__( 'Content', 'js_composer' ),
  11. 'description' => esc_html__( 'Line and Bar 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__( 'Line', 'js_composer' ) => 'line',
  26. esc_html__( 'Bar', 'js_composer' ) => 'bar',
  27. ),
  28. 'std' => 'bar',
  29. 'description' => esc_html__( 'Select type of chart.', 'js_composer' ),
  30. 'admin_label' => true,
  31. ),
  32. array(
  33. 'type' => 'dropdown',
  34. 'heading' => esc_html__( 'Style', 'js_composer' ),
  35. 'description' => esc_html__( 'Select chart color style.', 'js_composer' ),
  36. 'param_name' => 'style',
  37. 'value' => array(
  38. esc_html__( 'Flat', 'js_composer' ) => 'flat',
  39. esc_html__( 'Modern', 'js_composer' ) => 'modern',
  40. esc_html__( 'Custom', 'js_composer' ) => 'custom',
  41. ),
  42. 'dependency' => array(
  43. 'callback' => 'vcChartCustomColorDependency',
  44. ),
  45. ),
  46. array(
  47. 'type' => 'checkbox',
  48. 'heading' => esc_html__( 'Show legend?', 'js_composer' ),
  49. 'param_name' => 'legend',
  50. 'description' => esc_html__( 'If checked, chart will have legend.', 'js_composer' ),
  51. 'value' => array( esc_html__( 'Yes', 'js_composer' ) => 'yes' ),
  52. 'std' => 'yes',
  53. ),
  54. array(
  55. 'type' => 'checkbox',
  56. 'heading' => esc_html__( 'Show hover values?', 'js_composer' ),
  57. 'param_name' => 'tooltips',
  58. 'description' => esc_html__( 'If checked, chart will show values on hover.', 'js_composer' ),
  59. 'value' => array( esc_html__( 'Yes', 'js_composer' ) => 'yes' ),
  60. 'std' => 'yes',
  61. ),
  62. array(
  63. 'type' => 'textfield',
  64. 'heading' => esc_html__( 'X-axis values', 'js_composer' ),
  65. 'param_name' => 'x_values',
  66. 'description' => esc_html__( 'Enter values for axis (Note: separate values with ";").', 'js_composer' ),
  67. 'value' => 'JAN; FEB; MAR; APR; MAY; JUN; JUL; AUG',
  68. ),
  69. array(
  70. 'type' => 'param_group',
  71. 'heading' => esc_html__( 'Values', 'js_composer' ),
  72. 'param_name' => 'values',
  73. 'value' => rawurlencode( wp_json_encode( array(
  74. array(
  75. 'title' => esc_html__( 'One', 'js_composer' ),
  76. 'y_values' => '10; 15; 20; 25; 27; 25; 23; 25',
  77. 'color' => 'blue',
  78. ),
  79. array(
  80. 'title' => esc_html__( 'Two', 'js_composer' ),
  81. 'y_values' => '25; 18; 16; 17; 20; 25; 30; 35',
  82. 'color' => 'pink',
  83. ),
  84. ) ) ),
  85. 'params' => array(
  86. array(
  87. 'type' => 'textfield',
  88. 'heading' => esc_html__( 'Title', 'js_composer' ),
  89. 'param_name' => 'title',
  90. 'description' => esc_html__( 'Enter title for chart dataset.', 'js_composer' ),
  91. 'admin_label' => true,
  92. ),
  93. array(
  94. 'type' => 'textfield',
  95. 'heading' => esc_html__( 'Y-axis values', 'js_composer' ),
  96. 'param_name' => 'y_values',
  97. 'description' => esc_html__( 'Enter values for axis (Note: separate values with ";").', 'js_composer' ),
  98. ),
  99. array(
  100. 'type' => 'dropdown',
  101. 'heading' => esc_html__( 'Color', 'js_composer' ),
  102. 'param_name' => 'color',
  103. 'value' => vc_get_shared( 'colors-dashed' ),
  104. 'description' => esc_html__( 'Select chart color.', 'js_composer' ),
  105. 'param_holder_class' => 'vc_colored-dropdown',
  106. ),
  107. array(
  108. 'type' => 'colorpicker',
  109. 'heading' => esc_html__( 'Custom color', 'js_composer' ),
  110. 'param_name' => 'custom_color',
  111. 'description' => esc_html__( 'Select custom chart color.', 'js_composer' ),
  112. ),
  113. ),
  114. 'callbacks' => array(
  115. 'after_add' => 'vcChartParamAfterAddCallback',
  116. ),
  117. ),
  118. array(
  119. 'type' => 'dropdown',
  120. 'heading' => esc_html__( 'Animation', 'js_composer' ),
  121. 'description' => esc_html__( 'Select animation style.', 'js_composer' ),
  122. 'param_name' => 'animation',
  123. 'value' => vc_get_shared( 'animation styles' ),
  124. 'std' => 'easeInOutCubic',
  125. ),
  126. vc_map_add_css_animation(),
  127. array(
  128. 'type' => 'el_id',
  129. 'heading' => esc_html__( 'Element ID', 'js_composer' ),
  130. 'param_name' => 'el_id',
  131. '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>' ),
  132. ),
  133. array(
  134. 'type' => 'textfield',
  135. 'heading' => esc_html__( 'Extra class name', 'js_composer' ),
  136. 'param_name' => 'el_class',
  137. 'description' => esc_html__( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'js_composer' ),
  138. ),
  139. array(
  140. 'type' => 'css_editor',
  141. 'heading' => esc_html__( 'CSS box', 'js_composer' ),
  142. 'param_name' => 'css',
  143. 'group' => esc_html__( 'Design Options', 'js_composer' ),
  144. ),
  145. ),
  146. );