roma.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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'));
  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. '#E01F54',
  45. '#001852',
  46. '#f5e8c8',
  47. '#b8d2c7',
  48. '#c6b38e',
  49. '#a4d8c2',
  50. '#f3d999',
  51. '#d3758f',
  52. '#dcc392',
  53. '#2e4783',
  54. '#82b6e9',
  55. '#ff6347',
  56. '#a092f1',
  57. '#0a915d',
  58. '#eaf889',
  59. '#6699FF',
  60. '#ff6666',
  61. '#3cb371',
  62. '#d5b158',
  63. '#38b6b6'
  64. ];
  65. var theme = {
  66. color: colorPalette,
  67. visualMap: {
  68. color: ['#e01f54', '#e7dbc3'],
  69. textStyle: {
  70. color: '#333'
  71. }
  72. },
  73. candlestick: {
  74. itemStyle: {
  75. color: '#e01f54',
  76. color0: '#001852'
  77. },
  78. lineStyle: {
  79. width: 1,
  80. color: '#f5e8c8',
  81. color0: '#b8d2c7'
  82. },
  83. areaStyle: {
  84. color: '#a4d8c2',
  85. color0: '#f3d999'
  86. }
  87. },
  88. graph: {
  89. itemStyle: {
  90. color: '#a4d8c2'
  91. },
  92. linkStyle: {
  93. color: '#f3d999'
  94. }
  95. },
  96. gauge: {
  97. axisLine: {
  98. lineStyle: {
  99. color: [
  100. [0.2, '#E01F54'],
  101. [0.8, '#b8d2c7'],
  102. [1, '#001852']
  103. ],
  104. width: 8
  105. }
  106. }
  107. }
  108. };
  109. echarts.registerTheme('roma', theme);
  110. });