EnergyRanking .js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // 水厂能耗排名
  2. import React, { PureComponent } from "react";
  3. import { CapsuleChart } from "@jiaminghi/data-view-react";
  4. class EnergyRanking extends PureComponent {
  5. constructor(props) {
  6. super(props);
  7. this.state = {
  8. config: {
  9. // 单位
  10. unit: "",
  11. showValue: false,
  12. data: [],
  13. },
  14. };
  15. }
  16. render() {
  17. const userIdentityCategory = {
  18. data: [
  19. { value: 0.6, name: "南郊水厂" },
  20. { value: 0.65, name: "白龙泉水厂" },
  21. { value: 0.73, name: "大禹王水厂" },
  22. { value: 0.81, name: "东郊水厂" },
  23. { value: 0.9, name: "鹊华水厂" },
  24. ],
  25. showValue: true,
  26. unit: "kWh/m3",
  27. };
  28. const config = {
  29. ...this.state.config,
  30. ...userIdentityCategory,
  31. };
  32. return (
  33. <div
  34. style={{
  35. width: "100%",
  36. height: "100%",
  37. }}
  38. >
  39. <CapsuleChart
  40. config={config}
  41. style={{
  42. height: "100%",
  43. }}
  44. />
  45. </div>
  46. );
  47. }
  48. }
  49. export default EnergyRanking;