Datasets:
Download tasks/chartjs__Chart.js-3192/problem_statement.txt from CosmosMind/SWE-PolyVision: direct link, hf CLI and curl.
- Browser
- Download file 2.49 kB
-
https://huggingface.co/datasets/CosmosMind/SWE-PolyVision/resolve/main/tasks/chartjs__Chart.js-3192/problem_statement.txt
- Command line
-
hf download hf://datasets/CosmosMind/SWE-PolyVision/tasks/chartjs__Chart.js-3192/problem_statement.txt
-
curl -L -o problem_statement.txt https://huggingface.co/datasets/CosmosMind/SWE-PolyVision/resolve/main/tasks/chartjs__Chart.js-3192/problem_statement.txt
2.49 kB
| 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 | |
| ``` | |
|  | |
| Without e.g. | |
| ``` | |
| xAxes: [{ | |
| display: false | |
| ``` | |
|  | |
| Only seems to happen when both x and y axis display is equal to false. |