Compare commits

..

No commits in common. '701feaaf2ff3038feb4254fc696657d5201b6741' and 'f38829787c1a71f36bc38f03e8a9053709c28a35' have entirely different histories.

  1. 2
      package.json
  2. 7
      src/components/markers.ts

2
package.json

@ -1,6 +1,6 @@
{ {
"name": "@chartwerk/line-pod", "name": "@chartwerk/line-pod",
"version": "0.7.2", "version": "0.7.1",
"description": "Chartwerk line chart", "description": "Chartwerk line chart",
"main": "dist/index.js", "main": "dist/index.js",
"files": [ "files": [

7
src/components/markers.ts

@ -105,11 +105,12 @@ export class Markers {
const linePosition = this._getLinePosition(marker); const linePosition = this._getLinePosition(marker);
const div = this._chartContainer this._chartContainer
.append('div') .append('div')
.attr('class', `marker-content marker-content-${marker.x}`) .attr('class', `marker-content marker-content-${marker.x}`)
// @ts-ignore // TODO: remove ignore but boxParams are protected // @ts-ignore // TODO: remove ignore but boxParams are protected
.style('top', `${this._state.boxParams.height - this._chartHeight}px`) .style('top', `${this._state.boxParams.height - this._chartHeight}px`)
.style('left', `${linePosition + this._margin.left + 10}px`)
.style('visibility', marker.alwaysDisplay ? 'visible' : 'hidden') .style('visibility', marker.alwaysDisplay ? 'visible' : 'hidden')
.style('position', 'absolute') .style('position', 'absolute')
.style('border', '1px solid black') .style('border', '1px solid black')
@ -124,10 +125,6 @@ export class Markers {
.style('pointer-events', 'none') .style('pointer-events', 'none')
.style('z-index', 1) .style('z-index', 1)
.html(marker.html); .html(marker.html);
// align tooltip: center (we need it to be rendered first)
// PS: 8px is the empiric constant to center the div ideally
div.style('left', `${linePosition + this._margin.left - div.node().getBoundingClientRect().width / 2 + 8}px`)
} }
protected renderSerie(serie: MarkerSerie) { protected renderSerie(serie: MarkerSerie) {

Loading…
Cancel
Save