Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

83
Views
Displaying Persian/Jalali dates in react apexchart

Could you guide me on how to make a "Datetime X-Axis" chart with react Apexchart.js when my dates are in Persian? at last, I should make a "brushChart" with Datetime X-Axis, if you have a similar project that can help me please send link of them

I had these codes below and I tried "defaultLocale" and "name" with both "Per" and "Fa" but none of them worked and getting a error and the app crashed.

chart: {
  id: 'reactchart-example',
  defaultLocale: 'Fa',
  locales: [
    {
      name: 'per',
      options: {
        months: [
          'دی',
          'بهمن',
          'اسفند',
          'فروردین',
          'اردیبهشت',
          'خرداد',
          'تیر',
          'مرداد',
          'شهریور',
          'مهر',
          'آبان',
          'آذر',
        ],
        shortMonths: ['دی', 'بهم', 'اسف', 'فرو', 'ارد', 'خرد', 'تیر', 'مرد', 'شهر', 'مهر', 'آبا', 'آذر'],
        days: ['یکشنبه', 'دوشنبه', 'سه شنبه', 'چهارشنبه', 'پنج شنبه', 'جمعه', 'شنبه'],
        shortDays: ['یک', 'دو', 'سه', 'چهار', 'پنج', 'جمع', 'شنب'],
        toolbar: {
          download: 'دانلود SVG',
          selection: 'انتخاب',
          selectionZoom: 'انتخاب بزرگنمایی',
          zoomIn: 'بزرگنمایی',
          zoomOut: 'کوچک نمایی',
          pan: 'جابجایی',
          reset: 'بازگرداندن',
        },
      },
    },
  ],
},

thanks for your help

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

you don't need to add the whole config in your chart object, there is a json file for every locale in this address in your node_modules folder: "apexcharts/dist/locales/"

all you need is to import your desired locale json file in your code like below

import fa from "apexcharts/dist/locales/fa.json"

and then simply set "locales" array and "defaultLocale" in the object "chart" like below:

chart: {
  //The following two lines are the key answer
  locales: [fa], //or multi language like [fa, en]
  defaultLocale: 'fa',
  
  //your other configs ...
},
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!