ConsoleNodeLoad.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <div id="ConsoleNodeLoad" style="width: 100%; height: 100%; background: #FFFFFF; text-align: center">
  3. <ve-histogram ref="consoleNodeLoad" :data="chartData" :extend="extend" :settings="chartSettings" width="100%" height="100%" :legend-visible="true"></ve-histogram>
  4. </div>
  5. </template>
  6. <script>
  7. import moment from "moment/moment";
  8. export default {
  9. name: 'ConsoleNodeLoad',
  10. data() {
  11. return {
  12. chartData: {
  13. columns: ['id', 'push', 'proxy', 'gbReceive', 'gbSend'],
  14. rows: []
  15. },
  16. chartSettings: {
  17. labelMap: {
  18. 'push': '直播推流',
  19. 'proxy': '拉流代理',
  20. 'gbReceive': '国标收流',
  21. 'gbSend': '国标推流',
  22. },
  23. },
  24. extend: {
  25. title: {
  26. show: true,
  27. text: "节点负载",
  28. left: "center",
  29. top: 20,
  30. },
  31. legend: {
  32. left: "center",
  33. bottom: "15px",
  34. },
  35. label: {
  36. show: true,
  37. position: "top"
  38. }
  39. }
  40. };
  41. },
  42. mounted() {
  43. this.$nextTick(_ => {
  44. setTimeout(()=>{
  45. this.$refs.consoleNodeLoad.echarts.resize()
  46. }, 100)
  47. })
  48. },
  49. destroyed() {
  50. },
  51. methods: {
  52. setData: function(data) {
  53. this.chartData .rows = data;
  54. }
  55. }
  56. };
  57. </script>