Prevent path going below axis minimum with spline/area-spline type
See original GitHub issue- What version of C3?
0.4.10
- What browsers have you confirmed it in? All browsers.
- Can you isolate the issue by providing a jsFiddle demonstrating it in a minimalist capacity? https://jsfiddle.net/alanhamlett/qvgf8omq/
Notice how the line goes below the chart’s y-min. There should be an option to prevent this.
var chart = c3.generate({
data: {
type: 'spline',
columns: [
['data1', 0, 0, 200],
['data2', 0, 0, 0]
],
axis: {
y: {
min: 0
}
}
}
});
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Change the scale of the horizontal (category) axis in a chart
To change the axis type to a text or date axis, expand Axis Options, and then under Axis Type, select Text axis or...
Read more >How to move chart X axis below negative values/zero/bottom ...
Right click the X axis in the chart, and select the Format Axis from the right-clicking menu. 2. Go ahead based on your...
Read more >GGPlot Axis Limits and Scales - Datanovia
This article describes R functions for changing ggplot axis limits (or scales). We'll describe how to specify the minimum and the maximum values...
Read more >Change the Vertical Y Axis Start or End Point in Excel - YouTube
VBA/Macros Course (40% Discount): https://www.teachexcel.com/vba-course-update.php?src=youtube_v_description_r5RwETjFZNIExcel Quickie 36: ...
Read more >Make Excel charts primary and secondary axis the same scale
So below we are showing the revenue (bill) and profit. ... The manual way to fix this is to go into the Axis...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It’s a bit of a hack, since this doesn’t seem to be configurable on an invidiual chart basis, but you can override
c3.chart.internal.fn.getInterpolate
before initializing your chart to another interpolation method.https://jsfiddle.net/qvgf8omq/3/
Edit: Even that doesn’t work in all cases https://jsfiddle.net/qvgf8omq/4/ . It seems to be a limitation of d3’s built-in interpolation methods, I’m sure there is a way to write your own interpolation method, but I don’t know d3 well enough to know how to do that.
In latest version of c3js you can pass:
Default values is
cardinal
, the possible values are:I’m aware that this option is not yet documented 😕