Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

201
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda