theme.js 1.5 KB

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