Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
(Awesome module!)
I have a chart based on a view in which the label field has some values that contain apostrophes and ampersands.
' and &
are showing up in the legend. Is there any way to display the apostrophe or ampersand in the legend?
In my view I tried setting the "rewrite results / strip html tags" to true in order to remove them, but had no impact.
Comment | File | Size | Author |
---|---|---|---|
#5 | charts-decode_entities_legend-2167563-2.patch | 833 bytes | itsekhmistro |
#3 | charts_decode_entities_legend-2167563.patch | 762 bytes | quicksketch |
Comments
Comment #1
quicksketchThis sounds like a bug. What charting implementation are you using? Google Charts or Highcharts?
Comment #2
quicksketchNevermind, I reproduced this problem by adding an ampersand to one of my content type names and then looking at the example pie chart produced by Views that comes with the module (admin/structure/views/view/charts_demo/edit/pie).
It looks like this has to do with Views encoding the results before they get to the Charts module, I'll see what we can do about this; we may need to manually de-encode the returned HTML.
Comment #3
quicksketchI've committed this patch which decodes HTML entities when the labels are coming from a rendered Views field (since it encoded the value previously).
Comment #5
itsekhmistro CreditAttribution: itsekhmistro commentedThank you @quicksketch
But current patch fixes the issue only for a CHARTS_SINGLE_AXIS type of charts.
It should be applied to other types as well. (issue in the Version 7.x-2.0-rc1)
Please see attached addition.
Comment #6
itsekhmistro CreditAttribution: itsekhmistro commentedComment #7
itsekhmistro CreditAttribution: itsekhmistro commentedComment #8
Pierre.Vriens CreditAttribution: Pierre.Vriens commented@itsekhmistro: sorry it took so long to get back on this issue (but I do so now ...). Thank you for this extra patch. Note the status update of this issue (and the parent issue I'm adding). Expect the patch to be applied to the current dev version soon (after I've done some extra QA-testing about it myself).
Comment #11
andileco CreditAttribution: andileco at JSI Research & Training Institute, Inc. (JSI) commentedComment #12
andileco CreditAttribution: andileco at JSI Research & Training Institute, Inc. (JSI) commented