|
1 | 1 | import React, { useState, useEffect, useContext } from 'react'; |
2 | | -import { Line, Bar, Pie } from 'react-chartjs-2'; |
3 | 2 | import OverviewContext from '../context/OverviewContext'; |
4 | 3 | import ServiceDetails from './ServiceDetails.jsx'; |
5 | 4 |
|
@@ -67,57 +66,15 @@ const ServiceOverview = (props) => { |
67 | 66 | return componentButtons; |
68 | 67 | }; |
69 | 68 |
|
70 | | - const newData = { |
71 | | - data: { |
72 | | - labels: ['Books.js', 'Customers.js', 'Orders.js'], |
73 | | - datasets: [ |
74 | | - { |
75 | | - label: 'Temperature (in Celcius)', |
76 | | - backgroundColor: 'rgb(150, 220, 75', |
77 | | - data: [39, 45, 50], |
78 | | - }, |
79 | | - ], |
80 | | - }, |
81 | | - }; |
82 | | - |
83 | | - const setGradientColor = (canvas, color) => { |
84 | | - const ctx = canvas.getContext('2d'); |
85 | | - const gradient = ctx.createLinearGradient(0, 0, 600, 550); |
86 | | - gradient.addColorStop(0, color); |
87 | | - gradient.addColorStop(0.95, 'rgba(133, 144, 0.5'); |
88 | | - return gradient; |
89 | | - }; |
90 | | - |
91 | | - const getChartData = (canvas) => { |
92 | | - const { data } = newData; |
93 | | - if (data.datasets) { |
94 | | - const colors = ['rgb(255, 206, 9)', 'rgb(150, 220, 75']; |
95 | | - data.datasets.forEach((set, i) => { |
96 | | - set.backgroundColor = setGradientColor(canvas, colors[i]); |
97 | | - set.borderColor = 'white'; |
98 | | - set.borderWidth = 2; |
99 | | - }); |
100 | | - } |
101 | | - return data; |
102 | | - }; |
103 | | - |
104 | 69 | if (detailsSelected) return detailsSelected; |
| 70 | + |
105 | 71 | return ( |
106 | 72 | <div className="mainContainer"> |
107 | 73 | <div> |
108 | 74 | <h1>Microservices Overview</h1> |
109 | 75 | </div> |
110 | 76 | <div /> |
111 | | - <div className="servicesList">{renderState()}</div> |
112 | | - {/* <div style={{ position: 'relative', width: 700, height: 650 }}> |
113 | | - <Bar |
114 | | - options={{ |
115 | | - title: { display: true, text: 'CPU Performance', fontSize: 30 }, |
116 | | - responsive: true, |
117 | | - }} |
118 | | - data={getChartData} |
119 | | - /> |
120 | | - </div> */} |
| 77 | + <div className="servicesList">{renderState()}</div> |
121 | 78 | <div /> |
122 | 79 | </div> |
123 | 80 | ); |
|
0 commit comments