信通院-灾备 图表源码(在产品图表库基础上进行修改),开发逻辑和产品图表库一致
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.js 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. import ChartBar from '../../../src/chart/line/ChartLine21/ChartLine21.js';
  2. let bar = new ChartBar(document.getElementsByClassName('c1')[0], {});
  3. window.addEventListener('resize', () => {
  4. bar.resize();
  5. });
  6. const obj = {
  7. color: ['#1fcfff', '#00f7fe', '#006dff', '#fe6cfd', '#ffdc00', '#fcfefd'],
  8. bg: {
  9. backgroundColor: "#000000",
  10. showBgPlane: true,
  11. bgPlaneColor: '#ffffff',
  12. borderColor: '#0000ff'
  13. },
  14. legend: {
  15. show: true,
  16. left: "70%",
  17. top: '5%',
  18. orient: 'horizontal',
  19. itemWidth: 8,
  20. itemHeight: 8,
  21. borderRadius: 0,
  22. textStyle: {
  23. fontSize: 14,
  24. color: "#ffffff"
  25. }
  26. },
  27. grid: {
  28. left: "0%",
  29. right: "-50%",
  30. top: "0%",
  31. bottom: "0%",
  32. // show: true
  33. },
  34. yAxis: {
  35. type: "value",
  36. splitNumber: 5,
  37. textStyle: {
  38. fontSize: 12,
  39. color: "#ffffff",
  40. shadowBlur: 0,
  41. shadowColor: "#ffffff"
  42. }
  43. },
  44. xAxis: {
  45. type: "category",
  46. textStyle: {
  47. fontSize: 20,
  48. color: "#ffffff",
  49. shadowBlur: 0,
  50. shadowColor: "#ffffff"
  51. },
  52. data: [0, 10, 20, 30, 40, 50],
  53. },
  54. toolTip: {
  55. lineColor: '#ffffff',
  56. sign: {
  57. centerColor: 'red',
  58. size: 31
  59. },
  60. font: {
  61. fontSize: 122,
  62. fontColor: '#fff'
  63. }
  64. },
  65. shape: {
  66. lineColor: '#02daf1',
  67. planeColor: 'red',
  68. axisColor: 'red'
  69. },
  70. series: [{
  71. name: '净价',
  72. data: [10, 8, 9.3, 11.5, 13.2, 10.7]
  73. }, {
  74. name: '全价',
  75. data: [12, 11, 8.4, 14.3, 16.6, 16]
  76. }, {
  77. name: '总收益',
  78. data: [20, 24, 21.4, 25, 23, 31]
  79. }, {
  80. name: '中债到期收益率',
  81. data: [8, 31, 25, 26.7, 31, 32.5]
  82. }, {
  83. name: '中债综合指数',
  84. data: [26, 28, 25, 20.4, 23.6, 25]
  85. }, {
  86. name: '中债全价总指数',
  87. data: [17, 19, 21.3, 24, 20, 21]
  88. }]
  89. }
  90. setTimeout(()=>{
  91. // bar.setOption(obj)
  92. }, 3000)