Skip to content

Commit

Permalink
Fix color undefined bug
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaelLyra8 committed Nov 5, 2024
1 parent e7cd6c6 commit c6df054
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION=1.3.6
VERSION=1.3.7
2 changes: 1 addition & 1 deletion src/components/Footer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import * as S from "./styled";

const version = "2024-10-02-4423ece";
const version = "2024-11-05-e7cd6c6";

const Footer: React.FC = () => {
return (
Expand Down
10 changes: 6 additions & 4 deletions src/entities/Chart/ChartJS/impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,16 +339,18 @@ class ChartJSControllerImpl implements ChartJSController {

ChartDispatcher.addAxisY(dataAxisSettings);
}

appendDataset(data: any[], optimized: boolean, diffted: boolean, bins: number, color: string|undefined, metadata: ArchiverMetadata): void {
const { pvName, EGU, PREC } = metadata;
const unit = eguNormalize(EGU, pvName);

const precision = PREC === 0 || PREC === undefined || PREC === null ? 4 : PREC;

// Parses the data fetched from the archiver the way that the chart's internal classes can plot
if(!color){
if(!color || color==="undefined"){
color = colorStack.length > 0 ? colorStack.pop() : randomColorGenerator();
if(color === undefined){
color = randomColorGenerator()
}
}else{
const idx_color = colorStack.indexOf(color);
delete colorStack[idx_color];
Expand Down

0 comments on commit c6df054

Please sign in to comment.