Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markers not showing as expected with 1-sec data #565

Closed
tschirmer opened this issue Sep 6, 2020 · 4 comments
Closed

Markers not showing as expected with 1-sec data #565

tschirmer opened this issue Sep 6, 2020 · 4 comments

Comments

@tschirmer
Copy link

tschirmer commented Sep 6, 2020

Lightweight Charts Version: 3.1.5

Steps/code to reproduce:

set Markers on line series:

        this.chartSeries = chart.addLineSeries(this.options);

        this.chartSeries.setData(this.data);
        this.chartSeries.setMarkers([
          {
            time: this.data[0].time,

            color: '#f68410',
            shape: 'square',
            text: 'D',
            size: 15
          },
          {
            time: this.data[parseInt(this.data.length/2)].time,
            position: "belowBar",
            color: '#f68410',
            shape: 'circle',
            text: 'D',
            size: 20
          },
          {
            time: this.data[this.data.length -1].time,
            position: "aboveBar",
            color: '#f68410',
            shape: 'square',
            text: 'D',
            size: 1
          }
        ]);

Actual behavior:

Markers are not shown "belowBar" and "aboveBar" as expected. The only orange marker that's visible where position is not defined.

Expected behavior:

Markers are should be shown "belowBar" and "aboveBar" as expected.

Screenshots:

lightwieghtChartsBug

CodeSandbox/JSFiddle/etc link:

@tschirmer tschirmer changed the title Markers not showing as expected Markers not showing as expected with 1-sec data Sep 6, 2020
@tschirmer
Copy link
Author

Found the Problem - The data I was passing through (value) was a string (not a float). As a string, it was rendering the graph, but not able to add the marker. probably worth a quick parseFloat within the marker renderer.

@timocov
Copy link
Contributor

timocov commented Sep 7, 2020

The data I was passing through (value) was a string (not a float).

Which one? Is the issue solved now?

@tschirmer
Copy link
Author

each marker now shows. But the graph shows with a string value in the datapoint {time: unitTimestamp, value: "20.0"}, but the marker won't render.

after changing the datapoint to the format: {time: unitTimestamp, value: 20.0 }, it renders fine.

Ideally, this would either fail to render on the string value (and force all users to put in the correct float value), or render the markers with the string value. for consistency.

@timocov
Copy link
Contributor

timocov commented Sep 9, 2020

Ideally, this would either fail to render on the string value (and force all users to put in the correct float value), or render the markers with the string value. for consistency.

See #315

@timocov timocov closed this as completed Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants