Browse Source

Add 'style' option to group for lineChart.

Allows overriding of class definitions which provides a much simpler interface for programatically setting user defined options.
v3_develop
Chris Jackson 10 years ago
parent
commit
64ed420183
2 changed files with 4 additions and 0 deletions
  1. +1
    -0
      lib/timeline/component/GraphGroup.js
  2. +3
    -0
      lib/timeline/component/LineGraph.js

+ 1
- 0
lib/timeline/component/GraphGroup.js View File

@ -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);
};

+ 3
- 0
lib/timeline/component/LineGraph.js View File

@ -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) {

Loading…
Cancel
Save