ChartData.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. import React, { Component } from "react";
  2. import ContentWrapper from "@/components/Layout/ContentWrapper";
  3. import { Container, Row, Col, Card, CardHeader, CardBody } from "reactstrap";
  4. import Sparkline from "@/components/Common/Sparklines.js";
  5. import FlotChart from "@/components/Charts/Flot.js";
  6. const ChartSpline = {
  7. data: [
  8. {
  9. // label: "Uniques",
  10. color: "#3e3a8e",
  11. data: [
  12. ["Jan", 20],
  13. ["Feb", 90],
  14. ["Mar", 40],
  15. ["Apr", 85],
  16. ["Mei", 59],
  17. ["Jun", 93],
  18. ["Jul", 66],
  19. ["Agu", 86],
  20. ["Sep", 60],
  21. ["Okt", 70],
  22. ["Nov", 60],
  23. ["Des", 30],
  24. ],
  25. },
  26. ],
  27. options: {
  28. series: {
  29. lines: {
  30. show: false,
  31. },
  32. points: {
  33. show: true,
  34. radius: 4,
  35. },
  36. splines: {
  37. show: true,
  38. tension: 0.4,
  39. lineWidth: 1,
  40. fill: 0.5,
  41. },
  42. },
  43. grid: {
  44. borderColor: "#eee",
  45. borderWidth: 1,
  46. hoverable: true,
  47. backgroundColor: "#fcfcfc",
  48. },
  49. tooltip: true,
  50. tooltipOpts: {
  51. content: (label, x, y) => x + " : " + y,
  52. },
  53. xaxis: {
  54. tickColor: "#fcfcfc",
  55. mode: "categories",
  56. },
  57. yaxis: {
  58. min: 0,
  59. max: 150, // optional: use it for a clear represetation
  60. tickColor: "#eee",
  61. //position: 'right' or 'left',
  62. tickFormatter: (v) => v /* + ' visitors'*/,
  63. },
  64. shadowSize: 0,
  65. },
  66. };
  67. class ChartData extends Component {
  68. render() {
  69. return (
  70. <Col lg={12}>
  71. <Card className="card-default">
  72. <CardBody>
  73. <FlotChart
  74. options={ChartSpline.options}
  75. data={ChartSpline.data}
  76. className="flot-chart"
  77. height="250px"
  78. />
  79. </CardBody>
  80. <div align="center">
  81. <span>Data Statistik Pengunjung Tahun 2022</span>
  82. </div>
  83. </Card>
  84. </Col>
  85. );
  86. }
  87. }
  88. export default ChartData;