最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to set a locale for Chart.js date labels? - Stack Overflow

programmeradmin3浏览0评论

I have a Vue ponent, which renderes different charts using Chart.js. And everything is ok, but I can't set a locale for date labels on X axe.

I've tried to define moment locale at the top of script section of my vue-ponent, but it brought no results.

<script>
    import * as moment from 'moment';
    import 'moment/locale/ru';
    moment.locale('ru');

    console.log(moment.locale()); // it shows needle language: 'ru'!

    import Chart from 'chart.js';

    export default { ... this.chart = new Chart(this.context, config); ... };
</script>

^ but... after this try I see on X axe: 'Jul 2013', 'Aug 2013', but not 'Июл 2013', 'Авг 2013'.

Who have faced with such problem and how you have solved it? Somebody, help, please

发布评论

评论列表(0)

  1. 暂无评论