File size: 2,486 Bytes
45721da
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
Padding inside the canvas with a line chart without scale
Hello,
How can i make the line graph stick to the exact border of the canvas ?
I 've made a line graph without scales and there are always a gap between the left and the bottom borders of the canvas and the beginning of the charts... I try to play with the responsive and the maintainAspectRatio options without success...  here is my configuration .

Thx

```
new Chart(ctx, {
          // responsive: false,
          type: 'line',
          // maintainAspectRatio:false,
          data: {
            labels: labels,
            datasets: [{
              fill:true,
              backgroundColor: "#47afbd",
              data: data
            }]
          },
          options: {
            defaultFontSize:10,
            animation:{
              onProgress:function(){
                if(self.$('#engagement-chart-wrap').hasClass('isLoading')){
                  self.$('#engagement-chart-wrap').removeClass('isLoading');
                }
              }
            },
            legend: {
              display: false
            },
            tooltips:{
              enabled:false
            },
            elements:{
              point:{
                radius:0
              }
            },
            scales: {

              yAxes: [{

                ticks :{
                  display:false,
                  padding:0
                },
                gridLines:{
                  drawTicks:false,
                  drawBorder:false
                },
                scaleLabel:{
                  display:false
                }

              }],
              xAxes: [{
                ticks :{
                  display:false,
                  padding:0

                },
                gridLines:{
                  display:false,
                  drawTicks:false,
                  drawBorder:false
                }

              }]
            }

          }
        });
```

## Relevant pre-fix discussion

### Issue #2872

#### Comment at 2016-06-29T15:19:50Z

I'm also getting padding issues without a scale. But mine are out of range.
How can we add padding to the canvas? (Chart v2)

With scale. e.g.

```
xAxes: [{
            display: true
```

![image](assets/chartjs__Chart.js-3192/001.png)

Without e.g. 

```
xAxes: [{
            display: false
```

![image](assets/chartjs__Chart.js-3192/002.png)

Only seems to happen when both x and y axis display is equal to false.