Browse Source

Fixed #1140, labels and points correctly stack.

kamadaKawai
Alex de Mulder 9 years ago
parent
commit
0bc11f9f6f
3 changed files with 21 additions and 8 deletions
  1. +8
    -2
      dist/vis.js
  2. +7
    -1
      lib/timeline/component/graph2d_types/bar.js
  3. +6
    -5
      lib/timeline/component/graph2d_types/points.js

+ 8
- 2
dist/vis.js View File

@ -5,7 +5,7 @@
* A dynamic, browser-based visualization library. * A dynamic, browser-based visualization library.
* *
* @version 4.6.1-SNAPSHOT * @version 4.6.1-SNAPSHOT
* @date 2015-07-27
* @date 2015-07-30
* *
* @license * @license
* Copyright (C) 2011-2014 Almende B.V, http://almende.com * Copyright (C) 2011-2014 Almende B.V, http://almende.com
@ -25795,7 +25795,13 @@ return /******/ (function(modules) { // webpackBootstrap
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); 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);
var pointData = {
x: combinedData[i].x + drawData.offset,
y: combinedData[i].y - heightOffset,
groupId: combinedData[i].groupId,
label: combinedData[i].label
};
Points.draw([pointData], group, framework, drawData.offset);
//DOMutil.drawPoint(combinedData[i].x + drawData.offset, combinedData[i].y, group, framework.svgElements, framework.svg); //DOMutil.drawPoint(combinedData[i].x + drawData.offset, combinedData[i].y, group, framework.svgElements, framework.svg);
} }
} }

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

@ -119,7 +119,13 @@ Bargraph.draw = function (groupIds, processedGroupData, framework) {
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); 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);
let pointData = {
x:combinedData[i].x + drawData.offset,
y:combinedData[i].y - heightOffset,
groupId: combinedData[i].groupId,
label: combinedData[i].label,
};
Points.draw([pointData], group, framework, drawData.offset);
//DOMutil.drawPoint(combinedData[i].x + drawData.offset, combinedData[i].y, group, framework.svgElements, framework.svg); //DOMutil.drawPoint(combinedData[i].x + drawData.offset, combinedData[i].y, group, framework.svgElements, framework.svg);
} }
} }

+ 6
- 5
lib/timeline/component/graph2d_types/points.js View File

@ -37,11 +37,12 @@ Points.draw = function (dataset, group, framework, offset) {
if (!callback) { if (!callback) {
// draw the point the simple way. // draw the point the simple way.
DOMutil.drawPoint(dataset[i].x + offset, dataset[i].y, getGroupTemplate(), framework.svgElements, framework.svg, dataset[i].label); DOMutil.drawPoint(dataset[i].x + offset, dataset[i].y, getGroupTemplate(), framework.svgElements, framework.svg, dataset[i].label);
} else {
var callbackResult = callback(dataset[i], group, framework); // result might be true, false or an object
if (callbackResult === true || typeof callbackResult === 'object') {
DOMutil.drawPoint(dataset[i].x + offset, dataset[i].y, getGroupTemplate(callbackResult), framework.svgElements, framework.svg, dataset[i].label);
}
}
else {
var callbackResult = callback(dataset[i], group, framework); // result might be true, false or an object
if (callbackResult === true || typeof callbackResult === 'object') {
DOMutil.drawPoint(dataset[i].x + offset, dataset[i].y, getGroupTemplate(callbackResult), framework.svgElements, framework.svg, dataset[i].label);
}
} }
} }

Loading…
Cancel
Save