暫無描述
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

LineInvestment.js 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. import { Line } from "react-chartjs-2";
  2. function LineInvestment({ investmentData }) {
  3. const data = {
  4. labels: ["2010", "2011", "2012", "2013", "2014", "2015", "2016"],
  5. datasets: [
  6. {
  7. label: "Youtube",
  8. data: investmentData.data,
  9. backgroundColor: "rgba(22, 82, 240,0.15)",
  10. borderColor: "#1652F0",
  11. pointRadius: 0,
  12. // lineTension: 0,
  13. },
  14. ],
  15. };
  16. const options = {
  17. responsive: true,
  18. maintainAspectRatio: false,
  19. animation: {
  20. animateRotate: true,
  21. animateScale: true,
  22. },
  23. tooltips: {
  24. enabled: false,
  25. },
  26. legend: {
  27. display: false,
  28. labels: {
  29. usePointStyle: false,
  30. },
  31. },
  32. scales: {
  33. xAxes: [{
  34. display: true,
  35. gridLines: {
  36. display: false,
  37. drawBorder: false
  38. },
  39. scaleLabel: {
  40. display: false,
  41. labelString: 'Month'
  42. }
  43. }],
  44. yAxes: [{
  45. display: true,
  46. gridLines: {
  47. display: false,
  48. drawBorder: false
  49. },
  50. scaleLabel: {
  51. display: false,
  52. labelString: 'Value'
  53. }
  54. }]
  55. },
  56. };
  57. return (
  58. <>
  59. <Line data={data} height={150} options={options} id="transaction-graph" />
  60. </>
  61. );
  62. }
  63. export default LineInvestment;