0

I would like to know how to separate the first and last points of the data so that they are not stuck to the limit lines of the graph. I have tried padding the x axis but nothing. My options code for chart.js is this

let dataobj = {
        labels: graphDataObj['label'],
        datasets: [{
            label: graphDataObj['title'],
            data: graphDataObj['data'],
            pointBackgroundColor: graphDataObj['pointBgColor'],
            borderColor: graphDataObj['pointBgColor'],
            fill: false,
            showLine: false,
            pointRadius: 7
        }]
    }
let optionsobj = {
        responsive: true,
        scales: {
            yAxes: [{
                ticks: {
                    suggestedMin: graphDataObj['suggestedMin'],
                    suggestedMax: graphDataObj['suggestedMax'],
                    stepSize: null
                }, scaleLabel: {
                    display: true,
                    labelString: graphDataObj['yLabel']
                },
            }],
            xAxes: [{
                scaleLabel: {
                    display: true,
                    labelString: graphDataObj['xLabel'],
                }
            }]
        }
    }

Image for the graphic here

example graphic

Thanks!

  • Would you mind posting a jsfiddle or full example? The easiest way may be to add a dummy label, hard to say without seeing your full setup. – ty. Jun 24 '20 at 18:08
  • maybe [this](https://stackoverflow.com/a/42799913/9876136) helps – Martin M. Jun 25 '20 at 09:16

0 Answers0