diff --git a/_posts/plotly_js/fundamentals/config-options/2015-09-24-config-locale.html b/_posts/plotly_js/fundamentals/config-options/2015-09-24-config-locale.html new file mode 100644 index 000000000000..7526cc29a84b --- /dev/null +++ b/_posts/plotly_js/fundamentals/config-options/2015-09-24-config-locale.html @@ -0,0 +1,40 @@ +--- +name: Change the Default Locale +plot_url: https://codepen.io/plotly/embed/rqrgEQ/?height=600&theme-id=15263&default-tab=result +language: plotly_js +suite: configuration +order: 7.5 +sitemap: false +arrangement: horizontal +markdown_content: | + Load and register a non-default locale by adding `` + to your HTML after the plotly.js tag and then reference the locale in the `config`. For Example, the codepen example below has + `` in its HTML. For more information and a list of available locales, see + [https://github.com/plotly/plotly.js/blob/master/dist/README.md#to-include-localization](https://github.com/plotly/plotly.js/blob/master/dist/README.md#to-include-localization) +--- +var trace1 = { + type: "scatter", + mode: "lines", + x: ['2018-01-01', '2018-08-31'], + y: [10, 5], + line: {color: '#17BECF'} +}; + +var trace2 = { + type: "scatter", + mode: "lines", + x: ['2018-01-01', '2018-08-31'], + y: [3,7], + line: {color: '#7F7F7F'} +}; + +var data = [trace1,trace2]; + +var layout = { + title: 'Custom Locale', +}; + +var config = {locale: 'fr'}; + +Plotly.newPlot('myDiv', data, layout, config); +