diff --git a/apis/charts_graphs_google_charts/charts_graphs_google_charts.class.inc b/apis/charts_graphs_google_charts/charts_graphs_google_charts.class.inc
index 76887c9..e0d188a 100644
--- a/apis/charts_graphs_google_charts/charts_graphs_google_charts.class.inc
+++ b/apis/charts_graphs_google_charts/charts_graphs_google_charts.class.inc
@@ -162,7 +162,11 @@ class ChartsGraphsGoogleCharts extends ChartsGraphsCanvas {
     }
     $this->parameters_to_send[CHARTS_GRAPHS_GOOGLE_CHARTS_DATA_PARAMETER] =
       CHARTS_GRAPHS_GOOGLE_CHARTS_DATA_STARTER . implode('|', $chd);
-    $this->parameters_to_send[CHARTS_GRAPHS_GOOGLE_CHARTS_LEGEND] = implode('|', $chdl);
+    if ($this->showlegend) {
+      $chdl = array_map('htmlspecialchars_decode', $chdl);
+      $chdl = array_map('drupal_encode_path', $chdl);
+      $this->parameters_to_send[CHARTS_GRAPHS_GOOGLE_CHARTS_LEGEND] = implode('|', $chdl);
+    }
     if ($is_pie) {
       $this->parameters_to_send[CHARTS_GRAPHS_GOOGLE_CHARTS_PIE_LABELS] =
         implode('|', $chl);
