Open
Description
Hello 👋
I am having trouble with localization.
I have looked at plotly.js tests for some inspiration and I've seen that config.locale
and config.locales
are being set here and passed to newPlot
fn. But it didn't really help me.
My Chart components looks like this:
import * as Plotly from 'plotly.js'
import * as csDictionary from 'plotly.js/lib/locales/cs.js'
import * as React from 'react'
import * as Plot from 'react-plotly.js'
Plotly.register(csDictionary)
Plotly.setPlotConfig({ locale: 'cs' })
const trace1 = {
x: [0, 1, 2],
y: [1, 1, 1],
mode: 'lines+markers+text',
name: 'Lines, Markers and Text',
text: ['Text A', 'Text B', 'Text C'],
textposition: 'top right',
textfont: {
family: 'sans serif',
size: 18,
color: '#1f77b4',
},
type: 'scatter',
}
class Chart extends React.Component {
render() {
return (
<Plot
config={{ locale: 'cs' }}
data={[trace1]}
layout={{
width: 800,
height: 400,
title: 'A Fancy Plot',
}}
/>
)
}
}
export default Chart
❓ Any ideas how to make this work?
Localization is crucial for me and it looks that it is somehow supported, but I just cannot figure how to set it up.
Thanks 🙏
Metadata
Metadata
Assignees
Labels
No labels