Problem/Motivation

Currently, the data collector table in the Charts module does not allow users to easily reorder data once it has been entered. If a user needs to move a row/column, they must manually re-enter the data or re-import the CSV file.

Steps to reproduce

  1. Create or edit a chart
  2. Enter multiple rows/columns of data
  3. There are no controls to move rows nor columns

Proposed resolution

Implement comprehensive row and column reordering support for the ChartDataCollectorTable form element.

Remaining tasks

  • What is the long-term plan for drag-and-drop support in the data collector table? There are existing tabledrag hooks in the code, but they don't seem to be used.

User interface changes

  • New operation buttons (arrows) in the row and column operations cells.

API changes

No breaking changes to public APIs. Internal helper methods swapRows and swapColumns were added to facilitate reordering logic.

Data model changes

Issue fork charts-3585865

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

cballenar created an issue. See original summary.

andileco’s picture

Hi @cballenar - thank you for this ticket! Should the ticket status be "Needs review", or are you still working on it?

cballenar’s picture

Status: Active » Needs review

@andileco thanks for checking! This is ready for review/feedback.

anjuelsaphilip2020’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new49.65 KB
new62.82 KB

Hi,I’ve verified and tested MR !192 and applied the patch successfully on the Charts 5.2.x-dev version. The changes are working as expected.
Following steps I followed:

  1. Go to Structure → Block layout → Place a Charts block → Configure.
  2. Go to the Chart configurations section.
  3. Add the sample data.
  4. bserve the data collector table for row and column entries.

Testing Result: After applying the patch, the Chart Data Collector table displays reordering controls. Rows and columns can be reordered successfully, and the updated order is retained after saving the block. The chart correctly reflects the reordered data.
Attaching screenshots for reference.
Thanks