From 4a085e7ea4943ea871a64a858ee28343a56f01a9 Mon Sep 17 00:00:00 2001 From: michaelbabyn Date: Mon, 22 Oct 2018 12:18:40 -0400 Subject: [PATCH 1/2] Add "change default locale" tutorial to JS configuration options --- .../2015-09-24-config-locale.html | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 _posts/plotly_js/fundamentals/config-options/2015-09-24-config-locale.html 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..f396859826a8 --- /dev/null +++ b/_posts/plotly_js/fundamentals/config-options/2015-09-24-config-locale.html @@ -0,0 +1,39 @@ +--- +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 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); + From ef0cb8123083d9edc57f448831a44657fff1f614 Mon Sep 17 00:00:00 2001 From: michaelbabyn Date: Mon, 29 Oct 2018 11:18:11 -0400 Subject: [PATCH 2/2] generalize locale example CDN. --- .../config-options/2015-09-24-config-locale.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 index f396859826a8..7526cc29a84b 100644 --- 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 @@ -7,8 +7,9 @@ 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 more information and a list of available Locales, see + 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 = {