theme.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /**
  2. * @fileOverview default theme
  3. * @author dxq613@gail.com
  4. */
  5. var Util = require('./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: Util.mix({}, defaultAxis, {
  42. grid: null
  43. }),
  44. left: Util.mix({}, defaultAxis, {
  45. line: null
  46. }),
  47. right: Util.mix({}, defaultAxis, {
  48. line: null
  49. }),
  50. circle: Util.mix({}, defaultAxis, {
  51. line: null
  52. }),
  53. radius: Util.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. module.exports = Theme;