diff --git a/_posts/plotly_js/layout/axes/2017-10-03-axes-multi-categories.html b/_posts/plotly_js/layout/axes/2017-10-03-axes-multi-categories.html new file mode 100644 index 000000000000..e1f2217edff6 --- /dev/null +++ b/_posts/plotly_js/layout/axes/2017-10-03-axes-multi-categories.html @@ -0,0 +1,43 @@ +--- +name: Multi-Category Axes +plot_url: https://codepen.io/plotly/embed/bOByWR/?height=456&theme-id=15263&default-tab=result +language: plotly_js +suite: axes +order: 7.4 +sitemap: false +arrangement: horizontal +--- + +var trace1 = { + x: [ + ['SF Zoo','SF Zoo','SF Zoo'], + ['giraffes', 'orangutans', 'monkeys'] + ], + y: [20, 14, 23], + name: 'SF Zoo', + type: 'bar' +}; + +var trace2 = { + x: [ + ['LA Zoo','LA Zoo','LA Zoo'], + ['giraffes', 'orangutans', 'monkeys'] + ], + y: [12, 18, 29], + name: 'LA Zoo', + type: 'bar' +}; + +var data = [trace1, trace2]; +var layout = { + showlegend: false, + xaxis: { + tickson: "boundaries", + ticklen: 15, + showdividers: true, + dividercolor: 'grey', + dividerwidth: 2 + } +}; + +Plotly.newPlot('myDiv', data, layout); diff --git a/_posts/plotly_js/layout/axes/2017-10-03-axes-subcategories.html b/_posts/plotly_js/layout/axes/2017-10-03-axes-subcategories.html deleted file mode 100644 index 45fed858024f..000000000000 --- a/_posts/plotly_js/layout/axes/2017-10-03-axes-subcategories.html +++ /dev/null @@ -1,145 +0,0 @@ ---- -name: Subcategory Axes -plot_url: https://codepen.io/plotly/embed/VMMEmp/?height=456&theme-id=15263&default-tab=result -language: plotly_js -suite: axes -order: 7.5 -sitemap: false -arrangement: horizontal ---- - -var trace0 = { - x: [2,3,1,5], - y: ['A','A','A','A'], - type: 'box', - name: 'A', - orientation: 'h', - line: { - color: 'gray' - } -} - -var trace1 = { - x: [8,3,6,5], - y: ['B','B','B','B'], - type: 'box', - name: 'B', - orientation: 'h', - line: { - color: 'gray' - } -} - -var trace2 = { - x: [2,3,2,5], - y: ['C','C','C','C'], - type: 'box', - name: 'C', - orientation: 'h', - line: { - color: 'gray' - } -} - -var trace3 = { - x: [7.5,3,6,4], - y: ['D','D','D','D'], - type: 'box', - name: 'D', - orientation: 'h', - line: { - color: 'gray' - } -} - -var data = [trace0,trace1,trace2,trace3] - -var layout = { - title: '', - autosize: false, - height: 400, - width: 600, - yaxis: { - autorange: true, - categoryorder: 'category descending', - domain: [0, 1], - range: [-0.5, 4.5], - title: '', - type: 'category', - showline: true - }, - legend: { - x: 0.986145833333, - y: 0.936263886049 - }, - margin: { - r: 10, - t: 25, - b: 40, - l: 100 - }, - annotations: [ - { - x: -0.0951769406393, - y: 1.06972670892, - showarrow: false, - text: "Subgroup", - xref: "paper", - yref: "paper" - }, - { - x: -0.235516552511, - y: 1.07060587474, - showarrow: false, - text: 'Group', - xref: 'paper', - yref: 'paper' - }, - { - x: -0.235516552511, - y: 0.922906017856, - showarrow: false, - text: 'One', - xref: 'paper', - yref: 'paper' - }, - { - x: -0.235516552511, - y: 0.375, - showarrow: false, - text: 'Two', - xref: 'paper', - yref: 'paper' - } - ], - shapes: [ - { - line: { - color: "rgba(68, 68, 68, 0.5)", - width: 1 - }, - type: "line", - x0: -0.3, - x1: 1.2, - xref: "paper", - y0: 0.5, - y1: 0.5, - yref: "paper" - }, - { - line: { - color: "rgba(68, 68, 68, 0.63)", - width: 1 - }, - type: "line", - x0: -0.3, - x1: 1.2, - xref: "paper", - y0: 1, - y1: 1, - yref: "paper" - } - ] -} - -Plotly.newPlot('myDiv',data,layout);