sakura.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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. (function(root, factory) {
  20. if (typeof define === 'function' && define.amd) {
  21. // AMD. Register as an anonymous module.
  22. define(['exports', 'echarts'], factory);
  23. } else if (
  24. typeof exports === 'object' &&
  25. typeof exports.nodeName !== 'string'
  26. ) {
  27. // CommonJS
  28. factory(exports, require('echarts/lib/echarts'));
  29. } else {
  30. // Browser globals
  31. factory({}, root.echarts);
  32. }
  33. })(this, function(exports, echarts) {
  34. var log = function(msg) {
  35. if (typeof console !== 'undefined') {
  36. console && console.error && console.error(msg);
  37. }
  38. };
  39. if (!echarts) {
  40. log('ECharts is not Loaded');
  41. return;
  42. }
  43. var colorPalette = [
  44. '#e52c3c',
  45. '#f7b1ab',
  46. '#fa506c',
  47. '#f59288',
  48. '#f8c4d8',
  49. '#e54f5c',
  50. '#f06d5c',
  51. '#e54f80',
  52. '#f29c9f',
  53. '#eeb5b7'
  54. ];
  55. var theme = {
  56. color: colorPalette,
  57. title: {
  58. textStyle: {
  59. fontWeight: 'normal',
  60. color: '#e52c3c'
  61. }
  62. },
  63. visualMap: {
  64. color: ['#e52c3c', '#f7b1ab']
  65. },
  66. dataRange: {
  67. color: ['#e52c3c', '#f7b1ab']
  68. },
  69. candlestick: {
  70. itemStyle: {
  71. color: '#e52c3c',
  72. color0: '#f59288'
  73. },
  74. lineStyle: {
  75. width: 1,
  76. color: '#e52c3c',
  77. color0: '#f59288'
  78. },
  79. areaStyle: {
  80. color: '#fa506c',
  81. color0: '#f8c4d8'
  82. }
  83. },
  84. map: {
  85. itemStyle: {
  86. color: '#e52c3c',
  87. borderColor: '#fff',
  88. borderWidth: 1
  89. },
  90. areaStyle: {
  91. color: '#ccc'
  92. },
  93. label: {
  94. color: 'rgba(139,69,19,1)',
  95. show: false
  96. }
  97. },
  98. graph: {
  99. itemStyle: {
  100. color: '#f2385a'
  101. },
  102. nodeStyle: {
  103. brushType: 'both',
  104. strokeColor: '#e54f5c'
  105. },
  106. linkStyle: {
  107. color: '#f2385a',
  108. strokeColor: '#e54f5c'
  109. },
  110. label: {
  111. color: '#f2385a',
  112. show: false
  113. }
  114. },
  115. gauge: {
  116. axisLine: {
  117. lineStyle: {
  118. color: [
  119. [0.2, '#e52c3c'],
  120. [0.8, '#f7b1ab'],
  121. [1, '#fa506c']
  122. ],
  123. width: 8
  124. }
  125. }
  126. }
  127. };
  128. echarts.registerTheme('sakura', theme);
  129. });