WornAnalyze.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. // 当年防汛统计
  2. import React, { PureComponent } from "react";
  3. import Chart from "../../utils/chart";
  4. class WornAnalyze extends PureComponent {
  5. constructor(props) {
  6. super(props);
  7. }
  8. getOptions() {
  9. return {
  10. color: ["#38b3ff", "#00CA95"],
  11. tooltip: {},
  12. // legend: {
  13. // data: ["破损率"],
  14. // textStyle: {
  15. // color: "#fff",
  16. // },
  17. // },
  18. grid: {
  19. top: 35,
  20. left: "3%",
  21. right: "4%",
  22. bottom: "3%",
  23. containLabel: true,
  24. },
  25. xAxis: [
  26. {
  27. type: "category",
  28. data: ["历下区", "天桥区", "市中区", "章丘区", "高新区"],
  29. axisLabel: {
  30. textStyle: {
  31. color: "#fff",
  32. fontSize: 14,
  33. },
  34. },
  35. axisLine: {
  36. symbol: ["none", "arrow"],
  37. lineStyle: {
  38. color: "#fff",
  39. },
  40. },
  41. axisTick: {
  42. show: false,
  43. },
  44. },
  45. ],
  46. yAxis: [
  47. {
  48. type: "value",
  49. name: "漏损率(%)",
  50. nameTextStyle: {
  51. align: "left",
  52. },
  53. axisTick: {
  54. show: false,
  55. },
  56. axisLine: {
  57. show: true,
  58. symbol: ["none", "arrow"],
  59. lineStyle: {
  60. color: "#fff",
  61. },
  62. },
  63. axisLabel: {
  64. show: false,
  65. },
  66. splitLine: {
  67. show: false,
  68. },
  69. },
  70. ],
  71. series: [
  72. {
  73. name: "受损内涝点数量",
  74. type: "bar",
  75. barWidth: "50%",
  76. data: [12, 14, 18, 10, 16],
  77. },
  78. ],
  79. };
  80. }
  81. render() {
  82. return (
  83. <div
  84. style={{
  85. width: "100%",
  86. height: "100%",
  87. }}
  88. >
  89. <Chart option={this.getOptions()} />
  90. </div>
  91. );
  92. } //endrender
  93. }
  94. export default WornAnalyze;