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

andileco’s picture

This is a cool patch! We want you to know you are not being ignored! We will try to get back to this in the next couple of weeks.

nikathone’s picture

Status: Reviewed & tested by the community » Needs work

Not sure if I am missing something but it looks like the features is only affecting rows. I couldn't see a way to move a column left or right.

andileco’s picture

Status: Needs work » Needs review
StatusFileSize
new11.92 MB

@nikathone - please see my video. It's working pretty much as expected for me.

nikathone’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for the video and the rebase Daniel. @cballenar thanks for your contribution and @anjuelsaphilip2020 for the review.

  • andileco committed 31fb661a on 5.2.x authored by cballenar
    feat: #3585865 Allow reordering rows and columns in the data collector...
andileco’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.