File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
portal-ui/src/screens/Console/Dashboard/Prometheus/Widgets Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,7 @@ const LinearGraphWidget = ({
109
109
const [ loading , setLoading ] = useState < boolean > ( true ) ;
110
110
const [ hover , setHover ] = useState < boolean > ( false ) ;
111
111
const [ data , setData ] = useState < object [ ] > ( [ ] ) ;
112
+ const [ csvData , setCsvData ] = useState < object [ ] > ( [ ] ) ;
112
113
const [ dataMax , setDataMax ] = useState < number > ( 0 ) ;
113
114
const [ result , setResult ] = useState < IDashboardPanel | null > ( null ) ;
114
115
@@ -180,6 +181,14 @@ const LinearGraphWidget = ({
180
181
const onStopHover = ( ) => {
181
182
setHover ( false ) ;
182
183
} ;
184
+ useEffect ( ( ) => {
185
+ var dateFormatData = data ;
186
+ dateFormatData . forEach ( ( element : any ) => {
187
+ var date = new Date ( element . name * 1000 ) ;
188
+ element . name = date ;
189
+ } ) ;
190
+ setCsvData ( dateFormatData ) ;
191
+ } , [ data ] ) ;
183
192
184
193
const linearConfiguration = result
185
194
? ( result ?. widgetConfiguration as ILinearGraphConfiguration [ ] )
@@ -227,7 +236,7 @@ const LinearGraphWidget = ({
227
236
< DownloadWidgetDataButton
228
237
title = { title }
229
238
componentRef = { componentRef }
230
- data = { data }
239
+ data = { csvData }
231
240
/>
232
241
</ Grid >
233
242
</ Grid >
You can’t perform that action at this time.
0 commit comments