From 64ed420183af7c9fc216b9ce107c98ddc0b6c7b2 Mon Sep 17 00:00:00 2001 From: Chris Jackson Date: Sat, 1 Nov 2014 13:54:14 +0000 Subject: [PATCH] Add 'style' option to group for lineChart. Allows overriding of class definitions which provides a much simpler interface for programatically setting user defined options. --- lib/timeline/component/GraphGroup.js | 1 + lib/timeline/component/LineGraph.js | 3 +++ 2 files changed, 4 insertions(+) diff --git a/lib/timeline/component/GraphGroup.js b/lib/timeline/component/GraphGroup.js index 5917c79b..e757827f 100644 --- a/lib/timeline/component/GraphGroup.js +++ b/lib/timeline/component/GraphGroup.js @@ -71,6 +71,7 @@ GraphGroup.prototype.update = function(group) { this.content = group.content || 'graph'; this.className = group.className || this.className || "graphGroup" + this.groupsUsingDefaultStyles[0] % 10; this.visible = group.visible === undefined ? true : group.visible; + this.style = group.style; this.setOptions(group.options); }; diff --git a/lib/timeline/component/LineGraph.js b/lib/timeline/component/LineGraph.js index 2736079a..9195734f 100644 --- a/lib/timeline/component/LineGraph.js +++ b/lib/timeline/component/LineGraph.js @@ -1047,6 +1047,9 @@ LineGraph.prototype._drawLineGraph = function (dataset, group) { var svgHeight = Number(this.svg.style.height.replace("px","")); path = DOMutil.getSVGElement('path', this.svgElements, this.svg); path.setAttributeNS(null, "class", group.className); + if(group.style !== undefined) { + path.setAttributeNS(null, "style", group.style); + } // construct path from dataset if (group.options.catmullRom.enabled == true) {