diff --git a/public/app/core/time_series2.ts b/public/app/core/time_series2.ts
index 1c4c94da6fb..0f3dcbc1171 100644
--- a/public/app/core/time_series2.ts
+++ b/public/app/core/time_series2.ts
@@ -1,5 +1,3 @@
-///
-
import kbn from 'app/core/utils/kbn';
import _ from 'lodash';
@@ -23,6 +21,7 @@ export default class TimeSeries {
id: string;
label: string;
alias: string;
+ aliasEscaped: string;
color: string;
valueFormater: any;
stats: any;
@@ -52,6 +51,7 @@ export default class TimeSeries {
this.label = opts.alias;
this.id = opts.alias;
this.alias = opts.alias;
+ this.aliasEscaped = _.escape(opts.alias);
this.color = opts.color;
this.valueFormater = kbn.valueFormats.none;
this.stats = {};
diff --git a/public/app/features/panel/query_troubleshooter.ts b/public/app/features/panel/query_troubleshooter.ts
index 39c9cb0055b..60baf54c18f 100644
--- a/public/app/features/panel/query_troubleshooter.ts
+++ b/public/app/features/panel/query_troubleshooter.ts
@@ -21,11 +21,8 @@ const template = `
diff --git a/public/app/plugins/panel/graph/graph_tooltip.js b/public/app/plugins/panel/graph/graph_tooltip.js
index ba1458d66d0..89197717e42 100644
--- a/public/app/plugins/panel/graph/graph_tooltip.js
+++ b/public/app/plugins/panel/graph/graph_tooltip.js
@@ -127,7 +127,7 @@ function ($, core) {
value: value,
hoverIndex: hoverIndex,
color: series.color,
- label: series.label,
+ label: series.aliasEscaped,
time: pointTime,
distance: hoverDistance,
index: i
@@ -264,7 +264,7 @@ function ($, core) {
else if (item) {
series = seriesList[item.seriesIndex];
group = '';
if (panel.stack && panel.tooltip.value_type === 'individual') {
value = item.datapoint[1] - item.datapoint[2];
diff --git a/public/app/plugins/panel/graph/legend.js b/public/app/plugins/panel/graph/legend.js
index 1a29743b09d..265efa05748 100644
--- a/public/app/plugins/panel/graph/legend.js
+++ b/public/app/plugins/panel/graph/legend.js
@@ -169,7 +169,7 @@ function (angular, _, $) {
html += '';
html += '';
- html += '' + _.escape(series.label) + '';
+ html += '' + series.aliasEscaped + '';
if (panel.legend.values) {
var avg = series.formatValue(series.stats.avg);