Problem/Motivation

Pareto charts (80/20 rule) are essential business intelligence tools used to identify the most significant factors in a data set. While Highcharts supports Pareto functionality via a dedicated module, the Drupal Charts Highcharts submodule currently lacks an interface to enable this feature. Adding this allows users to overlay a cumulative percentage line on bar and column charts without manual #raw_options configuration.

Steps to reproduce

N/A (Feature Request)

Proposed resolution

  • Register the Highcharts pareto.js library in charts_highcharts.libraries.yml.
  • Add a global configuration toggle to enable/disable the Pareto library across the site.
  • Enhance the Bar and Column chart configuration forms to include an "Enable Pareto line" checkbox and a "Pareto line color" picker.
  • Automate the generation of the secondary Y-axis (Percentage) and the linked Pareto series in the Highcharts plugin logic.
  • Ensure cumulative values are formatted to two decimal places for tooltips, data labels, and axis labels for better readability.

Remaining tasks

  • Review the patch.
  • Test with various data sets to ensure the secondary axis scaling is correct.

User interface changes

  • Global Settings: A new checkbox "Enable Highcharts' Pareto library" in the Highcharts module configuration.
  • Chart Settings: When "Bar" or "Column" is selected, new fields for "Enable Pareto line" and "Pareto line color" will appear in the library-specific options section.

API changes

None. This utilizes existing Highcharts plugin hooks.

Data model changes

The charts_highcharts.schema.yml is updated to include pareto_library in global settings and pareto_line/pareto_color in the bar/column mapping.

Issue fork charts-3570689

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

andileco created an issue. See original summary.

andileco’s picture

Issue summary: View changes

andileco’s picture

Assigned: andileco » Unassigned
Status: Active » Needs review

This is working well for me now.

nikathone’s picture

Status: Needs review » Needs work
andileco’s picture

Status: Needs work » Needs review
nikathone’s picture

Status: Needs review » Reviewed & tested by the community

Looks good.

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.