static parseData(data) {
      const labels = Object.keys(data);
      const newData = {};

      labels.forEach((val) => {
        switch (typeof data[val]) {
        case "object":
          if (data[val].length !== undefined) {
            newData[val] = data[val];
          } else {
            newData[val] = [0];
          }
          break;
        case "number":
          newData[val] = [data[val]];
          break;
        case "string":
          if (data[val].includes(",")) {
            newData[val] = data[val].split(",").map(d => Number(d.trim()) || 0);
          } else {
            newData[val] = [Number(data[val]) || 0];
          }
          break;
        default:
          newData[val] = [Number(data[val]) || 0];
        }
      });

      const values = Object.values(newData);
      const length = GraphUIUtilities.getMaxLength(values);
      values.map(val => GraphUIUtilities.padArray(val, length));

      return newData;
    }
/**
     * Parse the value of object and return a correctly formatted data.
     * @param {Object} data Object of data to parse.
     * @returns {Object}
     */
Parse the value of object and return a correctly formatted data.
@param {Object} data Object of data to parse.
@returns {Object}
Parse the value of object and return a correctly formatted data . @param { Object } data Object of data to parse . @returns { Object }
static parseData(data) {
      const labels = Object.keys(data);
      const newData = {};
      labels.forEach((val) => {
        switch (typeof data[val]) {
        case "object":
          if (data[val].length !== undefined) {
            newData[val] = data[val];
          } else {
            newData[val] = [0];
          }
          break;
        case "number":
          newData[val] = [data[val]];
          break;
        case "string":
          if (data[val].includes(",")) {
            newData[val] = data[val].split(",").map(d => Number(d.trim()) || 0);
          } else {
            newData[val] = [Number(data[val]) || 0];
          }
          break;
        default:
          newData[val] = [Number(data[val]) || 0];
        }
      });
      const values = Object.values(newData);
      const length = GraphUIUtilities.getMaxLength(values);
      values.map(val => GraphUIUtilities.padArray(val, length));
      return newData;
    }
static parseData ( data ) { const labels = Object . keys ( data ) ; const newData = { } ; labels . forEach ( ( val ) => { switch ( typeof data [ val ] ) { case "object" : if ( data [ val ] . length !== undefined ) { newData [ val ] = data [ val ] ; } else { newData [ val ] = [ 0 ] ; } break ; case "number" : newData [ val ] = [ data [ val ] ] ; break ; case "string" : if ( data [ val ] . includes ( "," ) ) { newData [ val ] = data [ val ] . split ( "," ) . map ( d => Number ( d . trim ( ) ) || 0 ) ; } else { newData [ val ] = [ Number ( data [ val ] ) || 0 ] ; } break ; default : newData [ val ] = [ Number ( data [ val ] ) || 0 ] ; } } ) ; const values = Object . values ( newData ) ; const length = GraphUIUtilities . getMaxLength ( values ) ; values . map ( val => GraphUIUtilities . padArray ( val , length ) ) ; return newData ; }
Parse the value of object and return a correctly formatted data.
Parse the value of object and return a correctly formatted data .