theme.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. "use strict";
  2. /**
  3. * @fileOverview default theme
  4. * @author dxq613@gail.com
  5. */
  6. var Util = require('./util/common');
  7. var color1 = '#E8E8E8'; // color of axis-line and axis-grid
  8. var color2 = '#808080'; // color of axis label
  9. var defaultAxis = {
  10. label: {
  11. fill: color2,
  12. fontSize: 10
  13. },
  14. line: {
  15. stroke: color1,
  16. lineWidth: 1
  17. },
  18. grid: {
  19. type: 'line',
  20. stroke: color1,
  21. lineWidth: 1,
  22. lineDash: [2]
  23. },
  24. tickLine: null,
  25. labelOffset: 7.5
  26. };
  27. var Theme = {
  28. fontFamily: '"Helvetica Neue", "San Francisco", Helvetica, Tahoma, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", sans-serif',
  29. defaultColor: '#1890FF',
  30. pixelRatio: 1,
  31. padding: 'auto',
  32. appendPadding: 15,
  33. colors: ['#1890FF', '#2FC25B', '#FACC14', '#223273', '#8543E0', '#13C2C2', '#3436C7', '#F04864'],
  34. shapes: {
  35. line: ['line', 'dash'],
  36. point: ['circle', 'hollowCircle']
  37. },
  38. sizes: [4, 10],
  39. axis: {
  40. common: defaultAxis,
  41. // common axis configuration
  42. bottom: Util.mix({}, defaultAxis, {
  43. grid: null
  44. }),
  45. left: Util.mix({}, defaultAxis, {
  46. line: null
  47. }),
  48. right: Util.mix({}, defaultAxis, {
  49. line: null
  50. }),
  51. circle: Util.mix({}, defaultAxis, {
  52. line: null
  53. }),
  54. radius: Util.mix({}, defaultAxis, {
  55. labelOffset: 4
  56. })
  57. },
  58. shape: {
  59. line: {
  60. lineWidth: 2,
  61. lineJoin: 'round',
  62. lineCap: 'round'
  63. },
  64. point: {
  65. lineWidth: 0,
  66. size: 3
  67. },
  68. area: {
  69. fillOpacity: 0.1
  70. }
  71. },
  72. _defaultAxis: defaultAxis
  73. };
  74. module.exports = Theme;