mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 17:24:59 +00:00
aider: Fixed the issue with dates not being shown correctly on the x-axis.
# Aider chat conversation: USER: the dates aren't being shown as dates on the x-axis. they are coming out as large integers like 1,888,000,000,000 ASSISTANT: To fix the issue with the dates not being shown correctly on the x-axis, we need to modify the `xAxes` configuration in the Chart.js options. Here's the *SEARCH/REPLACE block* with the necessary changes: _posts/2024-05-13-models-over-time.md ```markdown <<<<<<< SEARCH xAxes: [{ type: 'time', time: { unit: 'month', tooltipFormat: 'll' }, ======= xAxes: [{ type: 'time', time: { unit: 'month', tooltipFormat: 'll', parser: 'YYYY-MM-DD' }, ticks: { callback: function(value, index, values) { return new Date(value).toLocaleDateString(); } }, >>>>>>> REPLACE ``` The changes made are: 1. Added the `parser: 'YYYY-MM-DD'` option to the `time` configuration to specify the date format used in the data. 2. Added a `ticks.callback` function to format the tick labels on the x-axis as localized date strings. These modifications should ensure that the dates are displayed correctly on the x-axis of the scatter plot.
This commit is contained in:
parent
07963921f9
commit
10bb7c7402
1 changed files with 7 additions and 1 deletions
|
@ -40,7 +40,13 @@ excerpt: A comparison of LLM code editing skill based on the release dates of th
|
|||
type: 'time',
|
||||
time: {
|
||||
unit: 'month',
|
||||
tooltipFormat: 'll'
|
||||
tooltipFormat: 'll',
|
||||
parser: 'YYYY-MM-DD'
|
||||
},
|
||||
ticks: {
|
||||
callback: function(value, index, values) {
|
||||
return new Date(value).toLocaleDateString();
|
||||
}
|
||||
},
|
||||
scaleLabel: {
|
||||
display: true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue