axisDefault.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing,
  13. * software distributed under the License is distributed on an
  14. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  15. * KIND, either express or implied. See the License for the
  16. * specific language governing permissions and limitations
  17. * under the License.
  18. */
  19. /**
  20. * AUTO-GENERATED FILE. DO NOT MODIFY.
  21. */
  22. /*
  23. * Licensed to the Apache Software Foundation (ASF) under one
  24. * or more contributor license agreements. See the NOTICE file
  25. * distributed with this work for additional information
  26. * regarding copyright ownership. The ASF licenses this file
  27. * to you under the Apache License, Version 2.0 (the
  28. * "License"); you may not use this file except in compliance
  29. * with the License. You may obtain a copy of the License at
  30. *
  31. * http://www.apache.org/licenses/LICENSE-2.0
  32. *
  33. * Unless required by applicable law or agreed to in writing,
  34. * software distributed under the License is distributed on an
  35. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  36. * KIND, either express or implied. See the License for the
  37. * specific language governing permissions and limitations
  38. * under the License.
  39. */
  40. import * as zrUtil from 'zrender/lib/core/util.js';
  41. var defaultOption = {
  42. show: true,
  43. // zlevel: 0,
  44. z: 0,
  45. // Inverse the axis.
  46. inverse: false,
  47. // Axis name displayed.
  48. name: '',
  49. // 'start' | 'middle' | 'end'
  50. nameLocation: 'end',
  51. // By degree. By default auto rotate by nameLocation.
  52. nameRotate: null,
  53. nameTruncate: {
  54. maxWidth: null,
  55. ellipsis: '...',
  56. placeholder: '.'
  57. },
  58. // Use global text style by default.
  59. nameTextStyle: {},
  60. // The gap between axisName and axisLine.
  61. nameGap: 15,
  62. // Default `false` to support tooltip.
  63. silent: false,
  64. // Default `false` to avoid legacy user event listener fail.
  65. triggerEvent: false,
  66. tooltip: {
  67. show: false
  68. },
  69. axisPointer: {},
  70. axisLine: {
  71. show: true,
  72. onZero: true,
  73. onZeroAxisIndex: null,
  74. lineStyle: {
  75. color: '#6E7079',
  76. width: 1,
  77. type: 'solid'
  78. },
  79. // The arrow at both ends the the axis.
  80. symbol: ['none', 'none'],
  81. symbolSize: [10, 15]
  82. },
  83. axisTick: {
  84. show: true,
  85. // Whether axisTick is inside the grid or outside the grid.
  86. inside: false,
  87. // The length of axisTick.
  88. length: 5,
  89. lineStyle: {
  90. width: 1
  91. }
  92. },
  93. axisLabel: {
  94. show: true,
  95. // Whether axisLabel is inside the grid or outside the grid.
  96. inside: false,
  97. rotate: 0,
  98. // true | false | null/undefined (auto)
  99. showMinLabel: null,
  100. // true | false | null/undefined (auto)
  101. showMaxLabel: null,
  102. margin: 8,
  103. // formatter: null,
  104. fontSize: 12
  105. },
  106. splitLine: {
  107. show: true,
  108. showMinLine: true,
  109. showMaxLine: true,
  110. lineStyle: {
  111. color: ['#E0E6F1'],
  112. width: 1,
  113. type: 'solid'
  114. }
  115. },
  116. splitArea: {
  117. show: false,
  118. areaStyle: {
  119. color: ['rgba(250,250,250,0.2)', 'rgba(210,219,238,0.2)']
  120. }
  121. }
  122. };
  123. var categoryAxis = zrUtil.merge({
  124. // The gap at both ends of the axis. For categoryAxis, boolean.
  125. boundaryGap: true,
  126. // Set false to faster category collection.
  127. deduplication: null,
  128. // splitArea: {
  129. // show: false
  130. // },
  131. splitLine: {
  132. show: false
  133. },
  134. axisTick: {
  135. // If tick is align with label when boundaryGap is true
  136. alignWithLabel: false,
  137. interval: 'auto'
  138. },
  139. axisLabel: {
  140. interval: 'auto'
  141. }
  142. }, defaultOption);
  143. var valueAxis = zrUtil.merge({
  144. boundaryGap: [0, 0],
  145. axisLine: {
  146. // Not shown when other axis is categoryAxis in cartesian
  147. show: 'auto'
  148. },
  149. axisTick: {
  150. // Not shown when other axis is categoryAxis in cartesian
  151. show: 'auto'
  152. },
  153. // TODO
  154. // min/max: [30, datamin, 60] or [20, datamin] or [datamin, 60]
  155. splitNumber: 5,
  156. minorTick: {
  157. // Minor tick, not available for cateogry axis.
  158. show: false,
  159. // Split number of minor ticks. The value should be in range of (0, 100)
  160. splitNumber: 5,
  161. // Length of minor tick
  162. length: 3,
  163. // Line style
  164. lineStyle: {
  165. // Default to be same with axisTick
  166. }
  167. },
  168. minorSplitLine: {
  169. show: false,
  170. lineStyle: {
  171. color: '#F4F7FD',
  172. width: 1
  173. }
  174. }
  175. }, defaultOption);
  176. var timeAxis = zrUtil.merge({
  177. splitNumber: 6,
  178. axisLabel: {
  179. // To eliminate labels that are not nice
  180. showMinLabel: false,
  181. showMaxLabel: false,
  182. rich: {
  183. primary: {
  184. fontWeight: 'bold'
  185. }
  186. }
  187. },
  188. splitLine: {
  189. show: false
  190. }
  191. }, valueAxis);
  192. var logAxis = zrUtil.defaults({
  193. logBase: 10
  194. }, valueAxis);
  195. export default {
  196. category: categoryAxis,
  197. value: valueAxis,
  198. time: timeAxis,
  199. log: logAxis
  200. };