question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Line style for line charts

See original GitHub issue

I’m submitting a … (check one with “x”)

  • bug report - search github for a similar issue or PR before submitting
  • feature request
  • support request - use StackOverflow (add the ngx-charts tag) or the gitter chat for support questions

Current behavior Line charts (as far as i could see) has only one default appearance for every line (continuous)

Expected behavior Would be nice to be able to set line appearance to something like “dashed” or similar, bonus points for setting just a portion of the data as “dashed”

What is the motivation / use case for changing the behavior? Have a better visual of the resulting chart, for example to recognize real values against estimated values. Something like this: http://www.andypope.info/ngs/ng45.gif

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:27
  • Comments:11

github_iconTop GitHub Comments

13reactions
jrhitecommented, Mar 22, 2019

I used a combination of the two tips given to me above, stroke-dasharray property with nth-child by comfortme. It worked well.

// here 3 is the specific line I want to be dashed
g.line-chart > g:last-of-type > g:nth-child(3) g.line-series > path {
    stroke: #72b4ec;
    stroke-dasharray: 6 10;
}
3reactions
chriszrccommented, Jun 21, 2019

I used a similar css approach for getting other shapes besides circles in the bubble chart, but it still feels very hacky (partially because we can’t target these components with the component css, since it’s outside the angular css scope). Seems like a very common requirement to be able to add a css class to lines or points in a series, seems like this could really be a powerful change that could enable a lot more chart flexibility-

https://github.com/swimlane/ngx-charts/issues/998#issuecomment-503569946

@lukekroon I had to put it in the global scss file, since otherwise it can’t target these components outside of the angular component scope-

Read more comments on GitHub >

github_iconTop Results From Across the Web

Line Styling - Chart.js
Open source HTML5 Charts for your website. ... Line Styling. config setup. const config = { type: 'line', data: data, options: { responsive: ......
Read more >
A Complete Guide to Line Charts | Tutorial by Chartio
Line charts are a fundamental chart type generally used to show change in values across time. Learn how to best use this chart...
Read more >
Basic Line Chart With Customizable line style - Tutorialspoint
Following is an example of a basic line chart with customized line style. We've already seen the configuration used to draw this chart...
Read more >
Line charts in Python - Plotly
Over 16 examples of Line Charts including changing color, size, log axes, ... Examples on creating and styling line charts in Python with...
Read more >
Line Chart - Google Developers
Material Line Charts have many small improvements over Classic Line Charts, including an improved color palette, rounded corners, clearer label formatting, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found