I’m building a Drupal 11 site and using the “Charts” contrib module to render data from a custom content type (medicion) via JSON:API. My content type has a date field (field_fecha_de_medicion) and numeric fields (field_valor_medido, field_relacion_senal_ruido, etc.). I’ve already set up a View with the Charts formatter to display a chart powered by Chart.js, which works fine—but I need two things that Chart.js can’t easily do in this setup:
Interactive zooming (drag, mouse wheel or buttons)
A horizontal threshold line (e.g. a red line at y = 50)
I decided to switch to C3.js by changing my View’s format to Chart (C3.js) and adding an Attachment display so I can show both the existing Chart.js graph and a new C3.js graph on the same page. I’ve configured my Attachment like this:
Chart type: Line
Label field: field_fecha_de_medicion
Data series: field_valor_medido
…but I never see the “Library options” (JSON) textarea in the C3.js configuration dialog
Switching the display to “Attachment” and attaching it to the Page
Enabling C3.js Charts and clearing caches (drush cr)
Verifying my View configuration in YAML export/import
Checking that the library_options keys appear in the exported YAML
You’re doing great integrating advanced chart features into Drupal 11 with the Charts module, and your strategy of switching to C3.js for its support for features like interactive zoom and threshold lines is spot on. The issue you’re encountering—not seeing the “Library options” JSON textarea—is most likely due to how the Charts module determines when to expose advanced configuration options based on the chart type and display mode.
Here’s a structured approach to troubleshoot and solve the problem:
1. Understand why “Library options” is missing
The “Library options” textarea should appear when:
You’re using a chart library that supports it (like C3.js).
You’re using a View display format that supports additional options.
The module version and settings allow exposing that UI (some older versions only expose it for certain chart types).
2. Make sure your Chart display uses C3.js correctly
In your View display:
Set Format to Chart (C3.js)
Under Format settings, ensure that the Chart type is set (e.g. Line, Bar).
Then, look under “Library options” — if it’s still missing:
3. Edit View display YAML directly (workaround)
Since you mentioned YAML import/export works, you can add library_options manually in the YAML and re-import. Example: