|
| 1 | +--- |
| 2 | +name: Multi Bullet |
| 3 | +plot_url: https://codepen.io/plotly/embed/xvYGyq/?height=600&theme-id=15263&default-tab=result |
| 4 | +language: plotly_js |
| 5 | +suite: bullet-charts |
| 6 | +order: 4 |
| 7 | +sitemap: false |
| 8 | +arrangement: horizontal |
| 9 | +markdown_content: | |
| 10 | + |
| 11 | + Bullet charts can be stacked for comparing several values at once as illustrated below: |
| 12 | +--- |
| 13 | +var data = [{ |
| 14 | + type: "indicator", mode: "number+gauge+delta", value: 180, |
| 15 | + delta: {reference: 200}, domain: {x: [0.25, 1], y: [0.08, 0.25]}, |
| 16 | + title: {text: "Revenue"}, gauge: {shape: "bullet", axis: {range: [null, 300]}, |
| 17 | + threshold: {line: {color: "black", width: 2}, thickness: 0.75, value: 170}, |
| 18 | + steps: [{range: [0, 150], color: "gray"}, {range: [150, 250], |
| 19 | + color: "lightgray"}], bar: {color: "black"}} |
| 20 | + },{ |
| 21 | + type: "indicator", mode: "number+gauge+delta", value: 35, |
| 22 | + delta: {reference: 200}, domain: {x: [0.25, 1], y: [0.4, 0.6]}, |
| 23 | + title: {text: "Profit"}, gauge: {shape: "bullet", axis: {range: [null, 100]}, |
| 24 | + threshold: {line: {color: "black", width: 2}, thickness: 0.75, value: 50}, |
| 25 | + steps: [{range: [0, 25], color: "gray"}, {range: [25, 75], color: "lightgray"}], |
| 26 | + bar: {color: "black"}} |
| 27 | + }, { |
| 28 | + type: "indicator", mode: "number+gauge+delta", value: 220, |
| 29 | + delta: {reference: 200}, domain: {x: [0.25, 1], y: [0.7, 0.9]}, |
| 30 | + title: {text :"Satisfaction"}, gauge: {shape: "bullet", axis: {range: [null, 300]}, |
| 31 | + threshold: {line: {color: "black", width: 2}, thickness: 0.75, value: 210}, |
| 32 | + steps: [{range: [0, 150], color: "gray"}, {range: [150, 250], color: "lightgray"}], |
| 33 | + bar: {color: "black"}} |
| 34 | + }]; |
| 35 | + |
| 36 | +var layout = {width: 600, height: 250, margin: {t: 10, "r": 25, "l": 25, "b": 10}}; |
| 37 | +Plotly.newPlot(gd,data,layout); |
| 38 | + |
0 commit comments