ParallelAxis.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. var zrUtil = require("zrender/lib/core/util");
  20. var Axis = require("../Axis");
  21. /*
  22. * Licensed to the Apache Software Foundation (ASF) under one
  23. * or more contributor license agreements. See the NOTICE file
  24. * distributed with this work for additional information
  25. * regarding copyright ownership. The ASF licenses this file
  26. * to you under the Apache License, Version 2.0 (the
  27. * "License"); you may not use this file except in compliance
  28. * with the License. You may obtain a copy of the License at
  29. *
  30. * http://www.apache.org/licenses/LICENSE-2.0
  31. *
  32. * Unless required by applicable law or agreed to in writing,
  33. * software distributed under the License is distributed on an
  34. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  35. * KIND, either express or implied. See the License for the
  36. * specific language governing permissions and limitations
  37. * under the License.
  38. */
  39. /**
  40. * @constructor module:echarts/coord/parallel/ParallelAxis
  41. * @extends {module:echarts/coord/Axis}
  42. * @param {string} dim
  43. * @param {*} scale
  44. * @param {Array.<number>} coordExtent
  45. * @param {string} axisType
  46. */
  47. var ParallelAxis = function (dim, scale, coordExtent, axisType, axisIndex) {
  48. Axis.call(this, dim, scale, coordExtent);
  49. /**
  50. * Axis type
  51. * - 'category'
  52. * - 'value'
  53. * - 'time'
  54. * - 'log'
  55. * @type {string}
  56. */
  57. this.type = axisType || 'value';
  58. /**
  59. * @type {number}
  60. * @readOnly
  61. */
  62. this.axisIndex = axisIndex;
  63. };
  64. ParallelAxis.prototype = {
  65. constructor: ParallelAxis,
  66. /**
  67. * Axis model
  68. * @param {module:echarts/coord/parallel/AxisModel}
  69. */
  70. model: null,
  71. /**
  72. * @override
  73. */
  74. isHorizontal: function () {
  75. return this.coordinateSystem.getModel().get('layout') !== 'horizontal';
  76. }
  77. };
  78. zrUtil.inherits(ParallelAxis, Axis);
  79. var _default = ParallelAxis;
  80. module.exports = _default;