Last label not showing
See original GitHub issueGood morning, beautiful chartists.
I’m missing the last label on my axisX, and can’t figure out why. Data is there, but there’s no sign of the last label on the front-end (so it’s not just covered by something else, or lacks right-padding).
Here’s the code-snippet I believe is relevant:
new Chartist.Line('.graph-container.' + patient + '-graph', data, {
// fullWidth: true,
chartPadding: {
top: 0,
right: 60,
bottom: 0,
left: 0
},
// lineSmooth: Chartist.Interpolation.none({
// fillHoles: true
// }),
high: limits.high + 2,
low: limits.low - 2,
axisX: {
type: Chartist.FixedScaleAxis,
divisor: divisions,
labelInterpolationFnc: function(value) {
console.log("Moment: " + moment(value).format('D/MM'))
return moment(value).format('D/MM');
}
},
On a somewhat related issue, I found this snippet, with:
var chart = new Chartist.Line('#chart', {
labels: data.map((value, index) => `${index + 1}. Data Point`),
...
… and I wonder, why isn’t it showing? And why does the writer in this example go out of his or hers way, to set a ‘last label’?
I should say, that I’m very new to chartist.js.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:5
Top Results From Across the Web
Last label is not showing in stepped labels of highchart
I have a highchart which shows date label on x-axis, When there are more than 10 ... Because of step value it is...
Read more >Not able to view the last label in xaxis - Highcharts
Hi All, We are creating a line chart for which we are facing some issues. xaxis title is not getting populated for some...
Read more >showLastLabel not showing last x-Axis label #166 - GitHub
Hi, I set xAxis.showLastLabel = true, but in the xAxis the last label is not shown. I am also setting label.step = 2...
Read more >Add or remove data labels in a chart - Microsoft Support
Right-click the data series or data label to display more data for, and then click Format Data Labels. Click Label Options and under...
Read more >Show, Hide, and Format Mark Labels - Tableau Help
If the marks are dense, you may not see labels for all the marks unless you check the option Allow labels to overlap...
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 FreeTop 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
Top GitHub Comments
I created workaround: https://jsbin.com/hanecozamu/edit?js,output Paste it somewhere at the top of your source code. Worked for me
The momentjs example on the documentation website is simplified a lot. We’re still working on a fully functional time scale axis which will arrive with Chartist 1.0. There are two issues with your example. First I believe you’re looking for an option to stretch your x-axis to the full width of the chart. However, this option does currently not exist on the FixedScaleAxis. The second problem is the simplification using divisor for time-based axes within the example provided on the doc site. You’d be better off by providing exact tick values for the axis by calculating them from your data using moment date math functions. Here’s a working example of how to do that: