dark.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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 contrastColor = '#eee';
  20. var axisCommon = function () {
  21. return {
  22. axisLine: {
  23. lineStyle: {
  24. color: contrastColor
  25. }
  26. },
  27. axisTick: {
  28. lineStyle: {
  29. color: contrastColor
  30. }
  31. },
  32. axisLabel: {
  33. textStyle: {
  34. color: contrastColor
  35. }
  36. },
  37. splitLine: {
  38. lineStyle: {
  39. type: 'dashed',
  40. color: '#aaa'
  41. }
  42. },
  43. splitArea: {
  44. areaStyle: {
  45. color: contrastColor
  46. }
  47. }
  48. };
  49. };
  50. var colorPalette = [
  51. '#dd6b66', '#759aa0', '#e69d87', '#8dc1a9', '#ea7e53',
  52. '#eedd78', '#73a373', '#73b9bc', '#7289ab', '#91ca8c', '#f49f42'
  53. ];
  54. var theme = {
  55. color: colorPalette,
  56. backgroundColor: '#333',
  57. tooltip: {
  58. axisPointer: {
  59. lineStyle: {
  60. color: contrastColor
  61. },
  62. crossStyle: {
  63. color: contrastColor
  64. },
  65. label: {
  66. color: '#000'
  67. }
  68. }
  69. },
  70. legend: {
  71. textStyle: {
  72. color: contrastColor
  73. }
  74. },
  75. textStyle: {
  76. color: contrastColor
  77. },
  78. title: {
  79. textStyle: {
  80. color: contrastColor
  81. }
  82. },
  83. toolbox: {
  84. iconStyle: {
  85. normal: {
  86. borderColor: contrastColor
  87. }
  88. }
  89. },
  90. dataZoom: {
  91. textStyle: {
  92. color: contrastColor
  93. }
  94. },
  95. visualMap: {
  96. textStyle: {
  97. color: contrastColor
  98. }
  99. },
  100. timeline: {
  101. lineStyle: {
  102. color: contrastColor
  103. },
  104. itemStyle: {
  105. normal: {
  106. color: colorPalette[1]
  107. }
  108. },
  109. label: {
  110. normal: {
  111. textStyle: {
  112. color: contrastColor
  113. }
  114. }
  115. },
  116. controlStyle: {
  117. normal: {
  118. color: contrastColor,
  119. borderColor: contrastColor
  120. }
  121. }
  122. },
  123. timeAxis: axisCommon(),
  124. logAxis: axisCommon(),
  125. valueAxis: axisCommon(),
  126. categoryAxis: axisCommon(),
  127. line: {
  128. symbol: 'circle'
  129. },
  130. graph: {
  131. color: colorPalette
  132. },
  133. gauge: {
  134. title: {
  135. textStyle: {
  136. color: contrastColor
  137. }
  138. }
  139. },
  140. candlestick: {
  141. itemStyle: {
  142. normal: {
  143. color: '#FD1050',
  144. color0: '#0CF49B',
  145. borderColor: '#FD1050',
  146. borderColor0: '#0CF49B'
  147. }
  148. }
  149. }
  150. };
  151. theme.categoryAxis.splitLine.show = false;
  152. export default theme;