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

200
Views
Plot Plotly chart with german date values

I recently started working with xslt to generate html from a given xml document. I am trying to display history values using plotly, which is already working well.

Nevertheless, I am currently facing a problem: The x-axis with the date values should be displayed in German. I have already tried to set locale to 'de_DE', but unfortunately this does not work. Does anyone have any idea of how it might work?

var myPlot = node.children[0];
trace1 = {
  x: values.map(a => a.xvalue),
  y: values.map(a => a.yvalue),
  type:'scatter',
  name:'Messung',
  locale:'de_DE',
  hovertemplate: '<b>Wert:</b> %{y}<br><b>Datum:</b> %{x}<br>'
};
data = [ trace1 ];
layout = {
  title: 'Verlaufswert: ' + vitSigTitle,
  hovermode:'closest',
  xaxis: {
    autorange: true,
    range: [beginDate, endDate],
    rangeselector: {
      buttons: [
        {
          count: 1,
          label: 'Monat',
          step: 'month',
          stepmode: 'backward'
        },
        {
          count: 6,
          label: '6 Monate',
          step: 'month',
          stepmode: 'backward'
        },
        {
          count: 1,
          label: 'Jahr',
          step: 'year',
          stepmode: 'backward'
        },
        {
          count: 1,
          label: 'Day',
          step: 'day',
          stepmode: 'backward'
        },
        { step: 'all' },
      ]
    },
    rangeslider: {range: [beginDate, endDate]},
    type: 'date'
  },
  yaxis: {
    title: vitSigUnit,
    autorange: false,
    range: [minValue-10, maxValue+10],
    type: 'linear',
    locale:'de_DE'
  }
};

Plotly.newPlot(node.children[0], data, layout, {locale: 'de-DE'});
console.log(Plotly.BUILD);
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Just setting the locale is not enough, you also have to include the corresponding js file, see https://github.com/plotly/plotly.js/blob/master/dist/README.md#to-include-localization

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!