Skip to content

ISeriesPrimitiveAxisView doesn't prevent overlapping #1886

Open
@mqklin

Description

@mqklin

Lightweight Charts™ Version: 5.0.6

Steps/code to reproduce:

import {
  type ISeriesPrimitive,
  type ISeriesPrimitiveAxisView,
  type Time,
} from 'lightweight-charts';

class VertLineTimeAxisView implements ISeriesPrimitiveAxisView {
  constructor(coordinate: number) {
    this._coordinate = coordinate;
  }
  coordinate() {
    return this._coordinate;
  }
  text() {
    return '123';
  }
  textColor() {
    return 'white';
  }
  backColor() {
    return 'black';
  }
}

class Label implements ISeriesPrimitive<Time> {
  constructor(coordinate: number) {
    this._coordinate = coordinate;
  }
  timeAxisViews() {
    return [new VertLineTimeAxisView(this._coordinate)];
  }
}

const label = new Label(0);
const label2 = new Label(40);
series.attachPrimitive(label);
series.attachPrimitive(label2);

Actual behavior:

Labels are overlapping

Expected behavior:

Labels should not overlap

Screenshots:

Image

CodeSandbox/JSFiddle/etc link:

Example of the bug that reproduces the screenshot above: https://github.com/tradingview/lightweight-charts/pull/1887/files

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @mqklin

        Issue actions

          ISeriesPrimitiveAxisView doesn't prevent overlapping · Issue #1886 · tradingview/lightweight-charts