Browse Source

made style work with barcharts

flowchartTest
Alex de Mulder 9 years ago
parent
commit
e5d2692e6d
3 changed files with 5591 additions and 5583 deletions
  1. +5585
    -5581
      dist/vis.js
  2. +4
    -1
      lib/DOMutil.js
  3. +2
    -1
      lib/timeline/component/graph2d_types/bar.js

+ 5585
- 5581
dist/vis.js
File diff suppressed because it is too large
View File


+ 4
- 1
lib/DOMutil.js View File

@ -186,7 +186,7 @@ exports.drawPoint = function(x, y, group, JSONcontainer, svgContainer, labelObj)
* @param y * @param y
* @param className * @param className
*/ */
exports.drawBar = function (x, y, width, height, className, JSONcontainer, svgContainer) {
exports.drawBar = function (x, y, width, height, className, JSONcontainer, svgContainer, style) {
if (height != 0) { if (height != 0) {
if (height < 0) { if (height < 0) {
height *= -1; height *= -1;
@ -198,5 +198,8 @@ exports.drawBar = function (x, y, width, height, className, JSONcontainer, svgCo
rect.setAttributeNS(null, "width", width); rect.setAttributeNS(null, "width", width);
rect.setAttributeNS(null, "height", height); rect.setAttributeNS(null, "height", height);
rect.setAttributeNS(null, "class", className); rect.setAttributeNS(null, "class", className);
if (style) {
rect.setAttributeNS(null, "style", style);
}
} }
}; };

+ 2
- 1
lib/timeline/component/graph2d_types/bar.js View File

@ -116,7 +116,8 @@ Bargraph.draw = function (groupIds, processedGroupData, framework) {
else if (group.options.barChart.align === 'right') {drawData.offset += 0.5*drawData.width;} else if (group.options.barChart.align === 'right') {drawData.offset += 0.5*drawData.width;}
} }
} }
DOMutil.drawBar(combinedData[i].x + drawData.offset, combinedData[i].y - heightOffset, drawData.width, group.zeroPosition - combinedData[i].y, group.className + ' vis-bar', framework.svgElements, framework.svg);
console.log(group)
DOMutil.drawBar(combinedData[i].x + drawData.offset, combinedData[i].y - heightOffset, drawData.width, group.zeroPosition - combinedData[i].y, group.className + ' vis-bar', framework.svgElements, framework.svg, group.style);
// draw points // draw points
if (group.options.drawPoints.enabled === true) { if (group.options.drawPoints.enabled === true) {
Points.draw([combinedData[i]], group, framework, drawData.offset); Points.draw([combinedData[i]], group, framework, drawData.offset);

Loading…
Cancel
Save