SandSignika.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /* *
  2. *
  3. * (c) 2010-2021 Torstein Honsi
  4. *
  5. * License: www.highcharts.com/license
  6. *
  7. * Sand-Signika theme for Highcharts JS
  8. *
  9. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  10. *
  11. * */
  12. 'use strict';
  13. /* global document */
  14. import Highcharts from '../../Core/Globals.js';
  15. import O from '../../Core/Options.js';
  16. var setOptions = O.setOptions;
  17. import U from '../../Core/Utilities.js';
  18. var addEvent = U.addEvent, createElement = U.createElement;
  19. // Load the fonts
  20. createElement('link', {
  21. href: 'https://fonts.googleapis.com/css?family=Signika:400,700',
  22. rel: 'stylesheet',
  23. type: 'text/css'
  24. }, null, document.getElementsByTagName('head')[0]);
  25. // Add the background image to the container
  26. addEvent(Highcharts.Chart, 'afterGetContainer', function () {
  27. // eslint-disable-next-line no-invalid-this
  28. this.container.style.background =
  29. 'url(https://www.highcharts.com/samples/graphics/sand.png)';
  30. });
  31. Highcharts.theme = {
  32. colors: ['#f45b5b', '#8085e9', '#8d4654', '#7798BF', '#aaeeee',
  33. '#ff0066', '#eeaaee', '#55BF3B', '#DF5353', '#7798BF', '#aaeeee'],
  34. chart: {
  35. backgroundColor: null,
  36. style: {
  37. fontFamily: 'Signika, serif'
  38. }
  39. },
  40. title: {
  41. style: {
  42. color: 'black',
  43. fontSize: '16px',
  44. fontWeight: 'bold'
  45. }
  46. },
  47. subtitle: {
  48. style: {
  49. color: 'black'
  50. }
  51. },
  52. tooltip: {
  53. borderWidth: 0
  54. },
  55. labels: {
  56. style: {
  57. color: '#6e6e70'
  58. }
  59. },
  60. legend: {
  61. backgroundColor: '#E0E0E8',
  62. itemStyle: {
  63. fontWeight: 'bold',
  64. fontSize: '13px'
  65. }
  66. },
  67. xAxis: {
  68. labels: {
  69. style: {
  70. color: '#6e6e70'
  71. }
  72. }
  73. },
  74. yAxis: {
  75. labels: {
  76. style: {
  77. color: '#6e6e70'
  78. }
  79. }
  80. },
  81. plotOptions: {
  82. series: {
  83. shadow: true
  84. },
  85. candlestick: {
  86. lineColor: '#404048'
  87. },
  88. map: {
  89. shadow: false
  90. }
  91. },
  92. // Highcharts Stock specific
  93. navigator: {
  94. xAxis: {
  95. gridLineColor: '#D0D0D8'
  96. }
  97. },
  98. rangeSelector: {
  99. buttonTheme: {
  100. fill: 'white',
  101. stroke: '#C0C0C8',
  102. 'stroke-width': 1,
  103. states: {
  104. select: {
  105. fill: '#D0D0D8'
  106. }
  107. }
  108. }
  109. },
  110. scrollbar: {
  111. trackBorderColor: '#C0C0C8'
  112. }
  113. };
  114. // Apply the theme
  115. setOptions(Highcharts.theme);