From 38b120eedbf3e340c15976c3e620d0e7d623fc45 Mon Sep 17 00:00:00 2001
From: Nathan Haug <nate@lullabot.com>
Date: Mon, 17 Mar 2014 22:44:22 -0700
Subject: [PATCH] Issue #2167563: HTML encodings (e.g. &#039; and &amp;)
 showing up in legend.

---
 views/charts_plugin_style_chart.inc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/views/charts_plugin_style_chart.inc b/views/charts_plugin_style_chart.inc
index baeafde..756e186 100644
--- a/views/charts_plugin_style_chart.inc
+++ b/views/charts_plugin_style_chart.inc
@@ -170,7 +170,8 @@ class charts_plugin_style_chart extends views_plugin_style {
       foreach ($renders as $row_number => $row) {
         $data_row = array();
         if ($label_field_key) {
-          $data_row[] = $renders[$row_number][$label_field_key];
+          // Labels need to be decoded, as the charting library will re-encode.
+          $data_row[] = htmlspecialchars_decode($renders[$row_number][$label_field_key], ENT_QUOTES);
         }
         // Convert empty strings to NULL.
         if ($renders[$row_number][$data_field_key] === '') {
-- 
GitLab