chart is working!

This commit is contained in:
Luke Berndt
2023-04-13 08:21:50 -04:00
parent 9bd532c645
commit efc6b5a25b
2 changed files with 12 additions and 13 deletions

View File

@@ -26,14 +26,14 @@ const CallChart = (props) => {
const parseDate = timeParse("%Y%m%d");
const format = timeFormat("%b %d");
const formatDate = (date) => format(parseDate(date));
const parseTime = timeParse('%Y-%m-%dT%H:%M:%S.%LZ');
// Then we'll create some bounds
const xMax = width - margin.left - margin.right;
const yMax = height - margin.top - margin.bottom;
// accessors
const x = d => d.x;
const y = d => d.y;
//const x = d => d.x;
//const y = d => d.y;
var xScale, yScale;
if (callData) {
@@ -50,7 +50,9 @@ const CallChart = (props) => {
});
}
// accessors
const x = d => xScale(d.x);
const y = d => yScale(d.y);
return (
<svg width={width} height={height}>
<Group left={margin.left} top={margin.top}>
@@ -60,18 +62,15 @@ const CallChart = (props) => {
data={callTotals}
x={x}
y={y}
xScale={xScale}
yScale={yScale}
strokeWidth={2}
stroke="#333"
stroke="blue"
curve={curveStep}
/>
<LinePath
data={uploadErrors}
x={x}
y={y}
xScale={xScale}
yScale={yScale}
strokeWidth={2}
stroke="red"
curve={curveStep}

View File

@@ -59,7 +59,7 @@ const System = () => {
const freqErrors = errors[freq];
var data = [];
for (var i = 0; i < freqErrors.errorHistory.length; i++) {
let spotsBack = freqErrors.errorHistory.length - i;
let spotsBack = i; //freqErrors.errorHistory.length - i;
let time = new Date(now - spotsBack * 15 * MS_PER_MINUTE);
if (time < minDate) minDate = time;
@@ -106,7 +106,7 @@ const System = () => {
var MS_PER_MINUTE = 60000;
if (statistic) {
for (let j = 0; j < statistic.callTotals.length; j++) {
let spotsBack = statistic.callTotals.length - j;
let spotsBack = j;//statistic.callTotals.length - j;
let time = new Date(now - spotsBack * 15 * MS_PER_MINUTE);
if (time < minDate) minDate = time;
if (statistic.callTotals[j] > maxValue)
@@ -238,11 +238,11 @@ const System = () => {
}, [groupsData])
useEffect(() => {
if (isSystemsSuccess) {
if (isSystemsSuccess && systemsData.stats[shortName]) {
processStatistics(systemsData.stats[shortName])
processErrors(systemsData.stats[shortName])
}
}, [isSystemsSuccess]);
}, [isSystemsSuccess, systemsData]);
/*
useEffect(() => {
if (isErrorsSuccess) {