Browse Source

bar graph plugins 추가

pull/2/head
hhjk00 10 months ago
parent
commit
ff0a0dc942
  1. 26
      src/containers/statistics/AbnormalSituationContainer.js
  2. 26
      src/containers/statistics/FlightContainer.js
  3. 26
      src/containers/statistics/FlightResultContainer.js

26
src/containers/statistics/AbnormalSituationContainer.js

@ -553,7 +553,31 @@ export default function AbnormalSituationContainer({
</CardHeader>
<CardBody>
<div style={{ height: '400px' }}>
<Bar data={data} options={options} height={400} />
<Bar
data={data}
options={options}
height={400}
plugins={{
afterDraw: function (chart) {
if (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();
}
}
}}
/>
</div>
</CardBody>
</Card>

26
src/containers/statistics/FlightContainer.js

@ -498,7 +498,31 @@ export default function FlightContainer({
</CardHeader>
<CardBody>
<div style={{ height: '400px' }}>
<Bar data={data} options={options} height={400} />
<Bar
data={data}
options={options}
height={400}
plugins={{
afterDraw: function (chart) {
if (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();
}
}
}}
/>
</div>
</CardBody>
</Card>

26
src/containers/statistics/FlightResultContainer.js

@ -469,7 +469,31 @@ export default function ResultContainer({
</CardHeader>
<CardBody>
<div style={{ height: '400px' }}>
<Bar data={data} options={options} height={400} />
<Bar
data={data}
options={options}
height={400}
plugins={{
afterDraw: function (chart) {
if (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();
}
}
}}
/>
</div>
</CardBody>
</Card>

Loading…
Cancel
Save