axisDefault.js 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  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. import tokens from '../visual/tokens.js';
  42. var defaultOption = {
  43. show: true,
  44. // zlevel: 0,
  45. z: 0,
  46. // Inverse the axis.
  47. inverse: false,
  48. // Axis name displayed.
  49. name: '',
  50. // 'start' | 'middle' | 'end'
  51. nameLocation: 'end',
  52. // By degree. By default auto rotate by nameLocation.
  53. nameRotate: null,
  54. nameTruncate: {
  55. maxWidth: null,
  56. ellipsis: '...',
  57. placeholder: '.'
  58. },
  59. // Use global text style by default.
  60. nameTextStyle: {
  61. // textMargin: never, // The default value will be specified based on `nameLocation`.
  62. },
  63. // The gap between axisName and axisLine.
  64. nameGap: 15,
  65. // Default `false` to support tooltip.
  66. silent: false,
  67. // Default `false` to avoid legacy user event listener fail.
  68. triggerEvent: false,
  69. tooltip: {
  70. show: false
  71. },
  72. axisPointer: {},
  73. axisLine: {
  74. show: true,
  75. onZero: true,
  76. onZeroAxisIndex: null,
  77. lineStyle: {
  78. color: tokens.color.axisLine,
  79. width: 1,
  80. type: 'solid'
  81. },
  82. // The arrow at both ends the the axis.
  83. symbol: ['none', 'none'],
  84. symbolSize: [10, 15],
  85. breakLine: true
  86. },
  87. axisTick: {
  88. show: true,
  89. // Whether axisTick is inside the grid or outside the grid.
  90. inside: false,
  91. // The length of axisTick.
  92. length: 5,
  93. lineStyle: {
  94. width: 1
  95. }
  96. },
  97. axisLabel: {
  98. show: true,
  99. // Whether axisLabel is inside the grid or outside the grid.
  100. inside: false,
  101. rotate: 0,
  102. // true | false | null/undefined (auto)
  103. showMinLabel: null,
  104. // true | false | null/undefined (auto)
  105. showMaxLabel: null,
  106. margin: 8,
  107. // formatter: null,
  108. fontSize: 12,
  109. color: tokens.color.axisLabel,
  110. // In scenarios like axis labels, when labels text's progression direction matches the label
  111. // layout direction (e.g., when all letters are in a single line), extra start/end margin is
  112. // needed to prevent the text from appearing visually joined. In the other case, when lables
  113. // are stacked (e.g., having rotation or horizontal labels on yAxis), the layout needs to be
  114. // compact, so NO extra top/bottom margin should be applied.
  115. textMargin: [0, 3]
  116. },
  117. splitLine: {
  118. show: true,
  119. showMinLine: true,
  120. showMaxLine: true,
  121. lineStyle: {
  122. color: tokens.color.axisSplitLine,
  123. width: 1,
  124. type: 'solid'
  125. }
  126. },
  127. splitArea: {
  128. show: false,
  129. areaStyle: {
  130. color: [tokens.color.backgroundTint, tokens.color.backgroundTransparent]
  131. }
  132. },
  133. breakArea: {
  134. show: true,
  135. itemStyle: {
  136. color: tokens.color.neutral00,
  137. // Break border color should be darker than the splitLine
  138. // because it has opacity and should be more prominent
  139. borderColor: tokens.color.border,
  140. borderWidth: 1,
  141. borderType: [3, 3],
  142. opacity: 0.6
  143. },
  144. zigzagAmplitude: 4,
  145. zigzagMinSpan: 4,
  146. zigzagMaxSpan: 20,
  147. zigzagZ: 100,
  148. expandOnClick: true
  149. },
  150. breakLabelLayout: {
  151. moveOverlap: 'auto'
  152. }
  153. };
  154. var categoryAxis = zrUtil.merge({
  155. // The gap at both ends of the axis. For categoryAxis, boolean.
  156. boundaryGap: true,
  157. // Set false to faster category collection.
  158. deduplication: null,
  159. jitter: 0,
  160. jitterOverlap: true,
  161. jitterMargin: 2,
  162. // splitArea: {
  163. // show: false
  164. // },
  165. splitLine: {
  166. show: false
  167. },
  168. axisTick: {
  169. // If tick is align with label when boundaryGap is true
  170. alignWithLabel: false,
  171. interval: 'auto',
  172. show: 'auto'
  173. },
  174. axisLabel: {
  175. interval: 'auto'
  176. }
  177. }, defaultOption);
  178. var valueAxis = zrUtil.merge({
  179. boundaryGap: [0, 0],
  180. axisLine: {
  181. // Not shown when other axis is categoryAxis in cartesian
  182. show: 'auto'
  183. },
  184. axisTick: {
  185. // Not shown when other axis is categoryAxis in cartesian
  186. show: 'auto'
  187. },
  188. // TODO
  189. // min/max: [30, datamin, 60] or [20, datamin] or [datamin, 60]
  190. splitNumber: 5,
  191. minorTick: {
  192. // Minor tick, not available for cateogry axis.
  193. show: false,
  194. // Split number of minor ticks. The value should be in range of (0, 100)
  195. splitNumber: 5,
  196. // Length of minor tick
  197. length: 3,
  198. // Line style
  199. lineStyle: {
  200. // Default to be same with axisTick
  201. }
  202. },
  203. minorSplitLine: {
  204. show: false,
  205. lineStyle: {
  206. color: tokens.color.axisMinorSplitLine,
  207. width: 1
  208. }
  209. }
  210. }, defaultOption);
  211. var timeAxis = zrUtil.merge({
  212. splitNumber: 6,
  213. axisLabel: {
  214. // To eliminate labels that are not nice
  215. showMinLabel: false,
  216. showMaxLabel: false,
  217. rich: {
  218. primary: {
  219. fontWeight: 'bold'
  220. }
  221. }
  222. },
  223. splitLine: {
  224. show: false
  225. }
  226. }, valueAxis);
  227. var logAxis = zrUtil.defaults({
  228. logBase: 10
  229. }, valueAxis);
  230. export default {
  231. category: categoryAxis,
  232. value: valueAxis,
  233. time: timeAxis,
  234. log: logAxis
  235. };