Update/Add Curve Documentation
See original GitHub issueI’m submitting a … (check one with “x”)
[ ] bug report => search github for a similar issue or PR before submitting
[x] feature request
[ ] support request => Please do not submit support request here
Current behavior In the documentation for line-chart (and probably all other charts that support changing curves), it says that you can change the curve with the curve by providing it with other d3 curves. It links to a list of these curves, but nowhere does it actually list the curves that you can input or how you would input them. After a lot of searching, I found the list of supported curves, but this doesn’t help either as inputting the label’s name’s doesn’t seem to work.
Expected behavior I expect to be told how to actually use the curve directive so that I can use it if I would like.
Reproduction of the problem
- Check the documentation
- Pretend you had no previous knowledge of how ngx-charts works
- Attempt to change the curve type.
What is the motivation / use case for changing the behavior? New users will be able to use the library to its fullest by knowing how to use it’s features.
Please tell us about your environment: N/A
-
ngx-charts version: Probably 7.something?
-
Angular version: 4.x.x
-
Browser: [all]
-
Language: [all]
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:7 (1 by maintainers)
Top GitHub Comments
That is great to know, however, I think it would be helpful to give more instruction on how to do this by either linking to a plunker or to another md file explaining how to use it.
For anyone searching (like I was), here’s what you need to do:
In the terminal run:
npm install @types/d3-shape
(typings is now depreciated)In the component, import:
import * as shape from 'd3-shape';
Then declare a variable like:
curve = shape.curveCardinal.tension(0);
And finally in the ngx-chart component inputs, use this:
There are more curve functions here if you don’t want
.curveCardinal.tension(0)
.