diff --git a/src/components/statistics/StatisticsSearch.js b/src/components/statistics/StatisticsSearch.js index 0059d54d..2c675e71 100644 --- a/src/components/statistics/StatisticsSearch.js +++ b/src/components/statistics/StatisticsSearch.js @@ -155,22 +155,24 @@ export default function StatisticsSearch({ }; const handlerPlugins = chartData => { - return { - afterDraw: function (chart) { - if (chartData.datasets[0].data.length <= 0) { - let ctx = chart.chart.ctx; - let width = chart.chart.width; - let height = chart.chart.height; + return [ + { + afterDraw: function (chart) { + if (chartData.datasets[0].data.length <= 0) { + let ctx = chart.chart.ctx; + let width = chart.chart.width; + let height = chart.chart.height; - chart.clear(); - ctx.save(); - ctx.textAlign = 'center'; - ctx.textBaseline = 'middle'; - ctx.fillText('표시할 데이터가 없습니다.', width / 2, height / 2); - ctx.restore(); + chart.clear(); + ctx.save(); + ctx.textAlign = 'center'; + ctx.textBaseline = 'middle'; + ctx.fillText('표시할 데이터가 없습니다.', width / 2, height / 2); + ctx.restore(); + } } } - }; + ]; }; return ( diff --git a/src/modules/statistics/models/index.ts b/src/modules/statistics/models/index.ts index 81fd2194..df266da0 100644 --- a/src/modules/statistics/models/index.ts +++ b/src/modules/statistics/models/index.ts @@ -30,17 +30,74 @@ export interface IStcsSearchRq { } export const initialState = { - flight: [], + flight: [ + { + name: '-', + year: '0', + month: '0', + day: '0' + }, + { + name: '-', + year: '0', + month: '0', + day: '0' + }, + { + name: '-', + year: '0', + month: '0', + day: '0' + } + ], flightSearch: { graphData: [], topData: [] }, - abnormal: [], + abnormal: [ + { + name: '-', + year: '0', + month: '0', + day: '0' + }, + { + name: '-', + year: '0', + month: '0', + day: '0' + }, + { + name: '-', + year: '0', + month: '0', + day: '0' + } + ], abnormalSearch: { graphData: [], topData: [] }, - result: [], + result: [ + { + name: '-', + year: '0', + month: '0', + day: '0' + }, + { + name: '-', + year: '0', + month: '0', + day: '0' + }, + { + name: '-', + year: '0', + month: '0', + day: '0' + } + ], resultSearch: { graphData: [], topData: []