|
|
|
@ -41,8 +41,7 @@ export default function StatisticsSearch({
|
|
|
|
|
const chartInit = () => { |
|
|
|
|
const { topData, graphData } = searchData; |
|
|
|
|
|
|
|
|
|
const filteredData = data => |
|
|
|
|
data.filter(i => i && !['nodata', 'NoData'].includes(i)); |
|
|
|
|
const filteredData = data => data.filter(i => i && i !== 'NoData'); |
|
|
|
|
|
|
|
|
|
const graph = filteredData(graphData.map(i => i.value)); |
|
|
|
|
const top = filteredData(topData.map(i => i.value)); |
|
|
|
@ -133,8 +132,8 @@ export default function StatisticsSearch({
|
|
|
|
|
ticks: { |
|
|
|
|
callback: function (value, index, values) { |
|
|
|
|
if (searchType.category === 'TIME') { |
|
|
|
|
const dateValue = formatSeconds(value); |
|
|
|
|
return dateValue; |
|
|
|
|
const isLastIndex = index === values.length - 1; |
|
|
|
|
return formatSeconds(value, isLastIndex); |
|
|
|
|
} else if (searchType.category === 'DISTANCE') { |
|
|
|
|
return value + 'm'; |
|
|
|
|
} |
|
|
|
@ -231,7 +230,7 @@ export default function StatisticsSearch({
|
|
|
|
|
] |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const handlerPlugins = chartData => { |
|
|
|
|
const plugins = chartData => { |
|
|
|
|
return [ |
|
|
|
|
{ |
|
|
|
|
afterDraw: function (chart) { |
|
|
|
@ -418,7 +417,7 @@ export default function StatisticsSearch({
|
|
|
|
|
data={totalData} |
|
|
|
|
options={barOptions} |
|
|
|
|
height={400} |
|
|
|
|
plugins={handlerPlugins(totalData)} |
|
|
|
|
plugins={plugins(totalData)} |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
</CardBody> |
|
|
|
@ -437,7 +436,7 @@ export default function StatisticsSearch({
|
|
|
|
|
data={topData} |
|
|
|
|
options={doughnutOptions} |
|
|
|
|
height={275} |
|
|
|
|
plugins={handlerPlugins(topData)} |
|
|
|
|
plugins={plugins(topData)} |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
{/* <div className='d-flex justify-content-between mt-3 mb-1'> |
|
|
|
|