axisDefault.js 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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. lineStyle: {
  109. color: ['#E0E6F1'],
  110. width: 1,
  111. type: 'solid'
  112. }
  113. },
  114. splitArea: {
  115. show: false,
  116. areaStyle: {
  117. color: ['rgba(250,250,250,0.2)', 'rgba(210,219,238,0.2)']
  118. }
  119. }
  120. };
  121. var categoryAxis = zrUtil.merge({
  122. // The gap at both ends of the axis. For categoryAxis, boolean.
  123. boundaryGap: true,
  124. // Set false to faster category collection.
  125. deduplication: null,
  126. // splitArea: {
  127. // show: false
  128. // },
  129. splitLine: {
  130. show: false
  131. },
  132. axisTick: {
  133. // If tick is align with label when boundaryGap is true
  134. alignWithLabel: false,
  135. interval: 'auto'
  136. },
  137. axisLabel: {
  138. interval: 'auto'
  139. }
  140. }, defaultOption);
  141. var valueAxis = zrUtil.merge({
  142. boundaryGap: [0, 0],
  143. axisLine: {
  144. // Not shown when other axis is categoryAxis in cartesian
  145. show: 'auto'
  146. },
  147. axisTick: {
  148. // Not shown when other axis is categoryAxis in cartesian
  149. show: 'auto'
  150. },
  151. // TODO
  152. // min/max: [30, datamin, 60] or [20, datamin] or [datamin, 60]
  153. splitNumber: 5,
  154. minorTick: {
  155. // Minor tick, not available for cateogry axis.
  156. show: false,
  157. // Split number of minor ticks. The value should be in range of (0, 100)
  158. splitNumber: 5,
  159. // Length of minor tick
  160. length: 3,
  161. // Line style
  162. lineStyle: {// Default to be same with axisTick
  163. }
  164. },
  165. minorSplitLine: {
  166. show: false,
  167. lineStyle: {
  168. color: '#F4F7FD',
  169. width: 1
  170. }
  171. }
  172. }, defaultOption);
  173. var timeAxis = zrUtil.merge({
  174. splitNumber: 6,
  175. axisLabel: {
  176. // To eliminate labels that are not nice
  177. showMinLabel: false,
  178. showMaxLabel: false,
  179. rich: {
  180. primary: {
  181. fontWeight: 'bold'
  182. }
  183. }
  184. },
  185. splitLine: {
  186. show: false
  187. }
  188. }, valueAxis);
  189. var logAxis = zrUtil.defaults({
  190. logBase: 10
  191. }, valueAxis);
  192. export default {
  193. category: categoryAxis,
  194. value: valueAxis,
  195. time: timeAxis,
  196. log: logAxis
  197. };