From a14309d95ffdab8294d5ecdb69638fd60fad08b9 Mon Sep 17 00:00:00 2001 From: Nils Asmussen Date: Sat, 22 Aug 2015 13:47:01 +0200 Subject: [PATCH] Added tooltipTitleTemplate option. --- docs/00-Getting-Started.md | 3 +++ src/Chart.Core.js | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/00-Getting-Started.md b/docs/00-Getting-Started.md index dc5c75616..8659d6cbd 100644 --- a/docs/00-Getting-Started.md +++ b/docs/00-Getting-Started.md @@ -177,6 +177,9 @@ Chart.defaults.global = { // String - Tooltip title font colour tooltipTitleFontColor: "#fff", + // String - Tooltip title template + tooltipTitleTemplate: "<%= label%>", + // Number - pixel width of padding around tooltip text tooltipYPadding: 6, diff --git a/src/Chart.Core.js b/src/Chart.Core.js index 44db42dfc..aa6c58d8d 100755 --- a/src/Chart.Core.js +++ b/src/Chart.Core.js @@ -150,6 +150,9 @@ // String - Tooltip title font colour tooltipTitleFontColor: "#fff", + // String - Tooltip title template + tooltipTitleTemplate: "<%= label%>", + // Number - pixel width of padding around tooltip text tooltipYPadding: 6, @@ -1097,7 +1100,7 @@ labels: tooltipLabels, legendColors: tooltipColors, legendColorBackground : this.options.multiTooltipKeyBackground, - title: ChartElements[0].label, + title: template(this.options.tooltipTitleTemplate,ChartElements[0]), chart: this.chart, ctx: this.chart.ctx, custom: this.options.customTooltips -- 2.47.2