-
-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5964 from facebook/fixup/chartjs-warnings
Fix chartjs warnings
- Loading branch information
Showing
8 changed files
with
128 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { enUS } from 'date-fns/locale'; | ||
import { formatISO } from 'date-fns'; | ||
/** | ||
* x axis configuration common between this and {@link ../projectDetail/timeline.js} | ||
* @param unit The base unit for the axis | ||
* @typedef {import('chart.js').ScaleOptionsByType} ScaleOptionsByType | ||
* @returns {ScaleOptionsByType} The options to use for x axis configuration | ||
*/ | ||
function xAxisTimeSeries(unit) { | ||
return { | ||
type: 'timeseries', | ||
adapters: { date: { locale: enUS } }, | ||
time: { | ||
unit: unit, | ||
tooltipFormat: enUS.formatLong.date, | ||
}, | ||
ticks: { | ||
source: 'labels', | ||
callback: (value, index, ticks) => formatISO(ticks[index].value, { representation: 'date' }), | ||
}, | ||
}; | ||
} | ||
|
||
export { xAxisTimeSeries }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters