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

Display single point in line chart #462

Closed
walfen opened this issue Jul 2, 2017 · 9 comments
Closed

Display single point in line chart #462

walfen opened this issue Jul 2, 2017 · 9 comments

Comments

@walfen
Copy link

walfen commented Jul 2, 2017

I'm submitting a ... (check one with "x")

[ ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[x] support request => Please do not submit support request here

Current behavior
How can I display a single point in a line chart? Sorry if this isn't the correct place for this question but I can't find another one.

Expected behavior

Improve documentation with this topic.

Please tell us about your environment:

  • ngx-charts version: 5.3.1
  • Angular version: 4.2.5
  • Browser: [all]
  • Language: [TypeScript]
@metodribic
Copy link

metodribic commented Jul 5, 2017

It seem this is a bug, because point does get rendered, but the grid for some reason is not, and since you can not display points in lines by default, you can not see it. You can put the data in activeEntries and you'll se that point is there but everything else is missing. But on the other hand, one point "line" is not a viable line, so this could potentially be expected behaviour.

@metodribic
Copy link

metodribic commented Jul 6, 2017

I noticed that if you set autoScale=false the grid does get rendered, but it is still a problem that the point is visible only if you put it in the result+ in activeEntries and it disappears once you hover it.

@walfen
Copy link
Author

walfen commented Jul 19, 2017

See solution of #467

@walfen walfen closed this as completed Jul 19, 2017
@joshigauravv
Copy link

I used solution of #467 but unable to get the result or persists circle

@FrankL-git
Copy link

I used stroke-width and stroke-linecap after the chart has been displayed. Assume the third line of your chart consists of a single data point. Then you can it display as follows:

const el = document.querySelectorAll('g.line-series path')[2];
el.setAttribute('stroke-width', '5');
el.setAttribute('stroke-linecap', 'round');

@chriszrc
Copy link

@FrankL-git that works great, thanks! I added that answer to the SO post here as well- https://stackoverflow.com/a/69193173/228369

@ppratikcr7
Copy link

I have posted a way simpler answer on the above SO post here: https://stackoverflow.com/a/75131314/9286991

@Mateusz19021996
Copy link

@ppratikcr7 this soultion does not work , could You please provide some more precise example?

@vivek-andani
Copy link

Can anyone suggest method to change color of dot for individual dot displayed in this ngx-line chart?
https://stackblitz.com/edit/swimlane-line-chart-pvyaj6?file=app%2Fcustom-liner-chart-service.service.ts

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

8 participants