demo.html 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <!DOCTYPE html><meta charset="utf-8" /><title>shaluDashBoardUi demo</title>
  2. <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
  3. <script src="./shaluDashBoardUi.umd.js"></script>
  4. <link rel="stylesheet" href="./shaluDashBoardUi.css" />
  5. <body>
  6. <div id="app">
  7. <fm-dashboard-basic-bar
  8. :width="400"
  9. :height="300"
  10. :dataSource="dataSource"
  11. v-bind="other"
  12. />
  13. </div>
  14. <script>
  15. Vue.createApp({
  16. data() {
  17. return {
  18. message: "hello",
  19. dataSource: {
  20. sourceType: 0,
  21. data: {
  22. xData: ["轴标签A", "轴标签B", "轴标签C", "轴标签D"],
  23. series: [
  24. {
  25. type: "bar",
  26. name: "系列1",
  27. data: [89.3, 92.1, 94.4, 85.4],
  28. },
  29. {
  30. type: "bar",
  31. name: "系列2",
  32. data: [95.8, 89.4, 91.2, 76.9],
  33. },
  34. ],
  35. },
  36. },
  37. other: {
  38. title: {
  39. left: "center",
  40. top: 8,
  41. textStyle: {
  42. color: "#fff",
  43. fontSize: 16,
  44. },
  45. },
  46. // 图例
  47. legend: {
  48. textStyle: {
  49. color: "#fff",
  50. },
  51. top: 32,
  52. },
  53. // 布局
  54. grid: {
  55. bottom: 34,
  56. right: 20,
  57. top: 60,
  58. },
  59. // 提示框
  60. tooltip: {},
  61. // x轴
  62. xAxis: {
  63. type: "category",
  64. axisLabel: {
  65. color: "#9fadbf",
  66. },
  67. },
  68. // y轴
  69. yAxis: {
  70. axisLabel: {
  71. color: "#9fadbf",
  72. },
  73. splitLine: {
  74. lineStyle: {
  75. type: "dashed",
  76. color: "#36485f",
  77. },
  78. },
  79. },
  80. },
  81. };
  82. },
  83. })
  84. .use(shaluDashBoardUi)
  85. .mount("#app");
  86. </script>
  87. </body>