- Status changed to Needs review
over 1 year ago 9:13pm 6 April 2023 - πΊπΈUnited States andileco
I'm a little bit expecting this to not apply because I am missing a previous small commit, but checking just in case.
The last submitted patch, 11: 3293577-subtitle-11.patch, failed testing. View results β
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.- πΊπΈUnited States andileco
This should fix the broken test and a few of the new code style issues.
- πΊπΈUnited States andileco
Happy to see this pass!
Some notes:
- Highcharts and Chart.js have full support for a subtitle option (yay!)
- Billboard.js supports a MultilineTitle, so I used this and placed the subtitle into the second line. Needed to update the library versions for this to work well.
- C3.js does not support a subtitle or multi-line title. Because the subtitle field is going to show in all the settings forms, I want it to have an effect if a user adds a value. What I do is just append the subtitle to the title with ": " as a separator. If users don't want this separator, they can just use the title field and leave the subtitle field blank.
- Google Charts is pretty complicated. The "corechart" package does not support subtitles, so where "corechart" is used, I apply the same solution as described above for C3.js (trying to be consistent as possible). However, for a handful of chart types (Bar/Column, Line/Spline, and Scatter), Google has a "Material Design" option. The Material Design option does support a subtitle. To make use of Material Design charts, navigate to /admin/config/content/charts, set Google as your default library, click the "Google settings" tab, and then check the "Use Material Design" checkbox. Then, for any of the above-mentioned chart types, you will see your chart rendered using the Material Design package and it will show a subtitle as a true subtitle rather than just the title with a subtitle appended. You can read a little more about the Material Design implementation here: https://developers.google.com/chart/interactive/docs/gallery/barchart#cr....
FYI: I plan to implement the subtitle feature in the contrib charts_echarts module as soon as this patch goes through (it also has true support for a subtitle).
- πΊπΈUnited States andileco
One more patch (hoping to be the last) that adds a couple features:
- Uses the "states" property to disable the subtitle until a value is added for the title.
- Allows use of tokens in views.
Couple other small tweaks.
-
andileco β
committed dab0d128 on 5.0.x
Issue #3293577 by andileco, hmdnawaz, Munavijayalakshmi, erutan,...
-
andileco β
committed dab0d128 on 5.0.x
-
andileco β
committed 0bd0e464 on 5.0.x
Issue #3293577 by hmdnawaz, Munavijayalakshmi, andileco, erutan: Provide...
-
andileco β
committed 0bd0e464 on 5.0.x
- Status changed to Fixed
over 1 year ago 7:44pm 21 April 2023 Automatically closed - issue fixed for 2 weeks with no activity.
- Assigned to FlameIngo
The new field "subtitle" leads to a warning for existing content: Warning: Undefined array key "subtitle" in Drupal\charts\Element\Chart::buildElement() (line 322 of modules/contrib/charts/src/Element/Chart.php).
If you save the corresponding content again, the warning disappears.
I suspect that the field "subtitle" is not stored in the database and therefore is fixed when saving again.
But this is not reasonable for some websites, 30k+ content.
Any suggestions for a solution?
- Issue was unassigned.