parse()->value_labels[ M_Chart_Parse::LABELS_FIRST_ROW ] ) ) { $first_row = m_chart()->parse()->value_labels[ M_Chart_Parse::LABELS_FIRST_ROW ]; $labels = m_chart()->parse()->value_labels[ M_Chart_Parse::LABELS_FIRST_COLUMN ]; // Rows parsing collects the data as raw_data[ row ][ column ] while columns parsing collects it as raw_data[ column ][ row ] $row_column = M_Chart_Parse::PARSE_ROWS === m_chart()->parse()->parse_in; ?> $label ) { ?> $label ) { if ( $row_column ) { $raw = m_chart()->parse()->raw_data[ $row ][ $column ] ?? null; } else { $raw = m_chart()->parse()->raw_data[ $column ][ $row ] ?? null; } ?> parse()->value_labels_position && M_Chart_Parse::PARSE_ROWS === m_chart()->parse()->parse_in && [] !== m_chart()->parse()->value_labels ) { // The labels came from the first column of the spreadsheet // Render one table row per label so the table matches the spreadsheet's vertical arrangement $labels = m_chart()->parse()->value_labels; $raw = m_chart()->parse()->raw_data; $per_row = (int) ceil( count( $raw ) / count( $labels ) ); $chunks = $per_row ? array_chunk( $raw, $per_row ) : []; ?> $label ) { ?> parse()->value_labels; // Chunk the flat cell stream into rows of one label-width each // Multi-row bodies get a generated row header so every data cell has row context $columns = count( $first_row ); $rows = $columns ? array_chunk( m_chart()->parse()->raw_data, $columns ) : []; $multi_row = 1 < count( $rows ); ?> $cells ) { ?>
parse()->format_raw( $raw ) ); ?>
parse()->format_raw( $raw ) ); ?>
parse()->format_raw( $raw ) ); ?>