vasturiano / timelines-chart

Timelines Chart
http://vasturiano.github.io/timelines-chart/example/categorical/
MIT License
556 stars 121 forks source link

Set the language to french #81

Open feliciaeponou opened 4 years ago

feliciaeponou commented 4 years ago

Hello, I am using this Js librairie to build my gantt chart. I want to know if I can change the language from english to french. If so, how can I do it? I want also to know if I can change the date format to d/m/Y

vasturiano commented 4 years ago

@feliciaeponou regarding the time axis, you can use .xTickFormat(date => /* your code */) to specify whichever format you would like to show for time.

nicolas-bonnel commented 3 years ago

I did not manage to set a custom formatter, but managed to change langage.

import { timeFormatDefaultLocale } from 'd3-time-format'
import locale from 'd3-time-format/locale/fr-FR.json'
timeFormatDefaultLocale(locale)
const TimelinesChart = require('timelines-chart').default
const chart = TimelinesChart()

You must import timelines-chart after changing default locale

reynaldmorel commented 2 years ago

I did not manage to set a custom formatter, but managed to change langage.

import { timeFormatDefaultLocale } from 'd3-time-format'
import locale from 'd3-time-format/locale/fr-FR.json'
timeFormatDefaultLocale(locale)
const TimelinesChart = require('timelines-chart').default
const chart = TimelinesChart()

You must import timelines-chart after changing default locale

When I try to do that, I have an error : failed to load module script: expected a javascript module script but the server responded with a mime type of "application/json". strict mime type checking is enforced for module scripts per html spec.

an idea ?