Skip to content

Commit 3b11b0b

Browse files
no javascript links in python
1 parent e634a16 commit 3b11b0b

File tree

3 files changed

+98
-98
lines changed

3 files changed

+98
-98
lines changed

python/bullet-charts.md

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,17 @@ jupyter:
3838
---
3939

4040
#### Basic Bullet Charts
41-
Stephen Few's Bullet Chart was invented to replace dashboard [gauges](https://plot.ly/javascript/gauge-charts/) and meters, combining both types of charts into simple bar charts with qualitative bars (steps), quantitative bar (bar) and performance line (threshold); all into one simple layout.
42-
Steps typically are broken into several values, which are defined with an array. The bar represent the actual value that a particular variable reached, and the threshold usually indicate a goal point relative to the value achieved by the bar. See [indicator page](https://plot.ly/javascript/gauge-charts/) for more detail.
41+
Stephen Few's Bullet Chart was invented to replace dashboard [gauges](https://plot.ly/python/gauge-charts/) and meters, combining both types of charts into simple bar charts with qualitative bars (steps), quantitative bar (bar) and performance line (threshold); all into one simple layout.
42+
Steps typically are broken into several values, which are defined with an array. The bar represent the actual value that a particular variable reached, and the threshold usually indicate a goal point relative to the value achieved by the bar. See [indicator page](https://plot.ly/python/gauge-charts/) for more detail.
4343

4444
```python
4545
import plotly.graph_objects as go
4646

4747
fig = go.Figure(go.Indicator(
48-
mode = "number+gauge+delta",
49-
gauge = {'shape': "bullet"},
48+
mode = "number+gauge+delta",
49+
gauge = {'shape': "bullet"},
5050
value = 220,
51-
delta = {'reference': 300},
51+
delta = {'reference': 300},
5252
domain = {'x': [0, 1], 'y': [0, 1]},
5353
title = {'text': "Profit"}))
5454
fig.update_layout(height = 250)
@@ -64,41 +64,41 @@ import plotly.graph_objects as go
6464

6565
fig = go.Figure(go.Indicator(
6666
mode = "number+gauge+delta", value = 220,
67-
domain = {'x': [0.1, 1], 'y': [0, 1]},
67+
domain = {'x': [0.1, 1], 'y': [0, 1]},
6868
title = {'text' :"<b>Profit</b>"},
69-
delta = {'reference': 200},
69+
delta = {'reference': 200},
7070
gauge = {
71-
'shape': "bullet",
72-
'axis': {'range': [None, 300]},
71+
'shape': "bullet",
72+
'axis': {'range': [None, 300]},
7373
'threshold': {
74-
'line': {'color': "red", 'width': 2},
75-
'thickness': 0.75,
74+
'line': {'color': "red", 'width': 2},
75+
'thickness': 0.75,
7676
'value': 280},
7777
'steps': [
78-
{'range': [0, 150], 'color': "lightgray"},
78+
{'range': [0, 150], 'color': "lightgray"},
7979
{'range': [150, 250], 'color': "gray"}]}))
8080
fig.update_layout(height = 250)
8181
fig.show()
8282
```
8383

8484
#### Custom Bullet
85-
The following example shows how to customize your charts. For more information about all possible options check our [reference page](https://plot.ly/javascript/reference/#indicator).
85+
The following example shows how to customize your charts. For more information about all possible options check our [reference page](https://plot.ly/python/reference/#indicator).
8686

8787
```python
8888
import plotly.graph_objects as go
8989

9090
fig = go.Figure(go.Indicator(
91-
mode = "number+gauge+delta", value = 220,
92-
domain = {'x': [0, 1], 'y': [0, 1]},
93-
delta = {'reference': 280, 'position': "top"},
94-
title = {'text':"<b>Profit</b><br><span style='color: gray; font-size:0.8em'>U.S. $</span>", 'font': {"size": 14}},
91+
mode = "number+gauge+delta", value = 220,
92+
domain = {'x': [0, 1], 'y': [0, 1]},
93+
delta = {'reference': 280, 'position': "top"},
94+
title = {'text':"<b>Profit</b><br><span style='color: gray; font-size:0.8em'>U.S. $</span>", 'font': {"size": 14}},
9595
gauge = {
96-
'shape': "bullet",
97-
'axis': {'range': [None, 300]},
96+
'shape': "bullet",
97+
'axis': {'range': [None, 300]},
9898
'threshold': {
99-
'line': {'color': "red", 'width': 2},
99+
'line': {'color': "red", 'width': 2},
100100
'thickness': 0.75, 'value': 270},
101-
'bgcolor': "white",
101+
'bgcolor': "white",
102102
'steps': [
103103
{'range': [0, 150], 'color': "cyan"},
104104
{'range': [150, 250], 'color': "royalblue"}],
@@ -116,50 +116,50 @@ import plotly.graph_objects as go
116116
fig = go.Figure()
117117

118118
fig.add_trace(go.Indicator(
119-
mode = "number+gauge+delta", value = 180,
120-
delta = {'reference': 200},
121-
domain = {'x': [0.25, 1], 'y': [0.08, 0.25]},
122-
title = {'text': "Revenue"},
119+
mode = "number+gauge+delta", value = 180,
120+
delta = {'reference': 200},
121+
domain = {'x': [0.25, 1], 'y': [0.08, 0.25]},
122+
title = {'text': "Revenue"},
123123
gauge = {
124-
'shape': "bullet",
125-
'axis': {'range': [None, 300]},
124+
'shape': "bullet",
125+
'axis': {'range': [None, 300]},
126126
'threshold': {
127-
'line': {'color': "black", 'width': 2},
128-
'thickness': 0.75,
129-
'value': 170},
127+
'line': {'color': "black", 'width': 2},
128+
'thickness': 0.75,
129+
'value': 170},
130130
'steps': [
131-
{'range': [0, 150], 'color': "gray"},
132-
{'range': [150, 250], 'color': "lightgray"}],
131+
{'range': [0, 150], 'color': "gray"},
132+
{'range': [150, 250], 'color': "lightgray"}],
133133
'bar': {'color': "black"}}))
134134

135135
fig.add_trace(go.Indicator(
136136
mode = "number+gauge+delta", value = 35,
137-
delta = {'reference': 200},
137+
delta = {'reference': 200},
138138
domain = {'x': [0.25, 1], 'y': [0.4, 0.6]},
139-
title = {'text': "Profit"},
139+
title = {'text': "Profit"},
140140
gauge = {
141-
'shape': "bullet",
141+
'shape': "bullet",
142142
'axis': {'range': [None, 100]},
143143
'threshold': {
144-
'line': {'color': "black", 'width': 2},
145-
'thickness': 0.75,
144+
'line': {'color': "black", 'width': 2},
145+
'thickness': 0.75,
146146
'value': 50},
147147
'steps': [
148-
{'range': [0, 25], 'color': "gray"},
148+
{'range': [0, 25], 'color': "gray"},
149149
{'range': [25, 75], 'color': "lightgray"}],
150150
'bar': {'color': "black"}}))
151151

152152
fig.add_trace(go.Indicator(
153153
mode = "number+gauge+delta", value = 220,
154-
delta = {'reference': 200},
154+
delta = {'reference': 200},
155155
domain = {'x': [0.25, 1], 'y': [0.7, 0.9]},
156-
title = {'text' :"Satisfaction"},
156+
title = {'text' :"Satisfaction"},
157157
gauge = {
158-
'shape': "bullet",
158+
'shape': "bullet",
159159
'axis': {'range': [None, 300]},
160160
'threshold': {
161-
'line': {'color': "black", 'width': 2},
162-
'thickness': 0.75,
161+
'line': {'color': "black", 'width': 2},
162+
'thickness': 0.75,
163163
'value': 210},
164164
'steps': [
165165
{'range': [0, 150], 'color': "gray"},

python/gauge-charts.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ A radial gauge chart has a circular arc, which displays a single value to estima
4545
The bar shows the target value, and the shading represents the progress toward that goal. Gauge charts, known as
4646
speedometer charts as well. This chart type is usually used to illustrate key business indicators.
4747

48-
The example below displays a basic gauge chart with default attributes. For more information about different added attributes check [indicator](https://plot.ly/javascript/indicator/) tutorial.
48+
The example below displays a basic gauge chart with default attributes. For more information about different added attributes check [indicator](https://plot.ly/python/indicator/) tutorial.
4949

5050
```python
5151
import plotly.graph_objects as go
5252

5353
fig = go.Figure(go.Indicator(
54-
mode = "gauge+number",
55-
value = 270,
56-
domain = {'x': [0, 1], 'y': [0, 1]},
54+
mode = "gauge+number",
55+
value = 270,
56+
domain = {'x': [0, 1], 'y': [0, 1]},
5757
title = {'text': "Speed"}))
5858

5959
fig.show()
@@ -67,44 +67,44 @@ The following examples include "steps" attribute shown as shading inside the rad
6767
import plotly.graph_objects as go
6868

6969
fig = go.Figure(go.Indicator(
70-
domain = {'x': [0, 1], 'y': [0, 1]},
71-
value = 450,
70+
domain = {'x': [0, 1], 'y': [0, 1]},
71+
value = 450,
7272
mode = "gauge+number+delta",
7373
title = {'text': "Speed"},
74-
delta = {'reference': 380},
75-
gauge = {'axis': {'range': [None, 500]},
74+
delta = {'reference': 380},
75+
gauge = {'axis': {'range': [None, 500]},
7676
'steps' : [
77-
{'range': [0, 250], 'color': "lightgray"},
78-
{'range': [250, 400], 'color': "gray"}],
77+
{'range': [0, 250], 'color': "lightgray"},
78+
{'range': [250, 400], 'color': "gray"}],
7979
'threshold' : {'line': {'color': "red", 'width': 4}, 'thickness': 0.75, 'value': 490}}))
8080

8181
fig.show()
8282
```
8383

8484
#### Custom Gauge Chart
85-
The following example shows how to style your gauge charts. For more information about all possible options check our [reference page](https://plot.ly/javascript/reference/#indicator).
85+
The following example shows how to style your gauge charts. For more information about all possible options check our [reference page](https://plot.ly/python/reference/#indicator).
8686

8787
```python
8888
import plotly.graph_objects as go
8989

9090
fig = go.Figure(go.Indicator(
91-
mode = "gauge+number+delta",
92-
value = 420,
93-
domain = {'x': [0, 1], 'y': [0, 1]},
94-
title = {'text': "Speed", 'font': {'size': 24}},
91+
mode = "gauge+number+delta",
92+
value = 420,
93+
domain = {'x': [0, 1], 'y': [0, 1]},
94+
title = {'text': "Speed", 'font': {'size': 24}},
9595
delta = {'reference': 400, 'increasing': {'color': "RebeccaPurple"}},
9696
gauge = {
9797
'axis': {'range': [None, 500], 'tickwidth': 1, 'tickcolor': "darkblue"},
98-
'bar': {'color': "darkblue"},
99-
'bgcolor': "white",
100-
'borderwidth': 2,
101-
'bordercolor': "gray",
98+
'bar': {'color': "darkblue"},
99+
'bgcolor': "white",
100+
'borderwidth': 2,
101+
'bordercolor': "gray",
102102
'steps': [
103-
{'range': [0, 250], 'color': 'cyan'},
103+
{'range': [0, 250], 'color': 'cyan'},
104104
{'range': [250, 400], 'color': 'royalblue'}],
105105
'threshold': {
106-
'line': {'color': "red", 'width': 4},
107-
'thickness': 0.75,
106+
'line': {'color': "red", 'width': 4},
107+
'thickness': 0.75,
108108
'value': 490}}))
109109

110110
fig.update_layout(paper_bgcolor = "lavender", font = {'color': "darkblue", 'family': "Arial"})

python/indicator.md

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -67,41 +67,41 @@ In this tutorial we introduce a new trace named "Indicator". The purpose of "ind
6767
<li> position: position relative to `number` (either top, left, bottom, right)</li>
6868
</ol>
6969
Finally, we can have a simple title for the indicator via `title` with 'text' attribute which is a string, and 'align' which can be set to left, center, and right.
70-
There are two gauge types: [angular](https://plot.ly/javascript/gauge-charts/) and [bullet](https://plot.ly/javascript/bullet-charts/). Here is a combination of both shapes (angular, bullet), and different modes (guage, delta, and value):
70+
There are two gauge types: [angular](https://plot.ly/python/gauge-charts/) and [bullet](https://plot.ly/python/bullet-charts/). Here is a combination of both shapes (angular, bullet), and different modes (guage, delta, and value):
7171

7272
```python
7373
import plotly.graph_objects as go
7474

7575
fig = go.Figure()
7676

7777
fig.add_trace(go.Indicator(
78-
value = 200,
78+
value = 200,
7979
delta = {'reference': 160},
8080
gauge = {
81-
'axis': {'visible': False}},
81+
'axis': {'visible': False}},
8282
domain = {'row': 0, 'column': 0}))
83-
83+
8484
fig.add_trace(go.Indicator(
85-
value = 120,
85+
value = 120,
8686
gauge = {
87-
'shape': "bullet",
88-
'axis' : {'visible': False}},
87+
'shape': "bullet",
88+
'axis' : {'visible': False}},
8989
domain = {'x': [0.05, 0.5], 'y': [0.15, 0.35]}))
9090

9191
fig.add_trace(go.Indicator(
92-
mode = "number+delta",
93-
value = 300,
92+
mode = "number+delta",
93+
value = 300,
9494
domain = {'row': 0, 'column': 1}))
9595

9696
fig.add_trace(go.Indicator(
97-
mode = "delta",
98-
value = 40,
97+
mode = "delta",
98+
value = 40,
9999
domain = {'row': 1, 'column': 1}))
100100

101101
fig.update_layout(
102-
grid = {'rows': 2, 'columns': 2, 'pattern': "independent"},
102+
grid = {'rows': 2, 'columns': 2, 'pattern': "independent"},
103103
template = {'data' : {'indicator': [{
104-
'title': {'text': "Speed"},
104+
'title': {'text': "Speed"},
105105
'mode' : "number+delta+gauge",
106106
'delta' : {'reference': 90}}]
107107
}})
@@ -113,9 +113,9 @@ fig.update_layout(
113113
import plotly.graph_objects as go
114114

115115
fig = go.Figure(go.Indicator(
116-
mode = "gauge+number",
116+
mode = "gauge+number",
117117
value = 450,
118-
title = {'text': "Speed"},
118+
title = {'text': "Speed"},
119119
domain = {'x': [0, 1], 'y': [0, 1]}
120120
))
121121

@@ -126,14 +126,14 @@ fig.show()
126126
The equivalent of above "angular gauge":
127127

128128
```python
129-
import plotly.graph_objects as go
129+
import plotly.graph_objects as go
130130

131131
fig = go.Figure(go.Indicator(
132-
mode = "number+gauge+delta",
133-
gauge = {'shape': "bullet"},
132+
mode = "number+gauge+delta",
133+
gauge = {'shape': "bullet"},
134134
delta = {'reference': 300},
135-
value = 220,
136-
domain = {'x': [0.1, 1], 'y': [0.2, 0.9]},
135+
value = 220,
136+
domain = {'x': [0.1, 1], 'y': [0.2, 0.9]},
137137
title = {'text': "Avg order size"}))
138138

139139
fig.show()
@@ -143,10 +143,10 @@ fig.show()
143143
Another interesting feature is that indicator trace sits above the other traces (even the 3d ones). This way, it can be easily used as an overlay as demonstrated below
144144

145145
```python
146-
import plotly.graph_objects as go
146+
import plotly.graph_objects as go
147147

148148
fig = go.Figure(go.Indicator(
149-
mode = "number+delta",
149+
mode = "number+delta",
150150
value = 492,
151151
delta = {"reference": 512, "valueformat": ".0f"},
152152
title = {"text": "Users online"},
@@ -166,9 +166,9 @@ import plotly.graph_objects as go
166166

167167
fig = go.Figure(go.Indicator(
168168
mode = "number+delta",
169-
value = 400,
169+
value = 400,
170170
number = {'prefix': "$"},
171-
delta = {'position': "top", 'reference': 320},
171+
delta = {'position': "top", 'reference': 320},
172172
domain = {'x': [0, 1], 'y': [0, 1]}))
173173

174174
fig.update_layout(paper_bgcolor = "lightgray")
@@ -184,22 +184,22 @@ import plotly.graph_objects as go
184184
fig = go.Figure()
185185

186186
fig.add_trace(go.Indicator(
187-
mode = "number+delta",
188-
value = 200,
189-
domain = {'x': [0, 0.5], 'y': [0, 0.5]},
187+
mode = "number+delta",
188+
value = 200,
189+
domain = {'x': [0, 0.5], 'y': [0, 0.5]},
190190
delta = {'reference': 400, 'relative': True, 'position' : "top"}))
191191

192192
fig.add_trace(go.Indicator(
193-
mode = "number+delta",
194-
value = 350,
195-
delta = {'reference': 400, 'relative': True},
193+
mode = "number+delta",
194+
value = 350,
195+
delta = {'reference': 400, 'relative': True},
196196
domain = {'x': [0, 0.5], 'y': [0.5, 1]}))
197197

198198
fig.add_trace(go.Indicator(
199-
mode = "number+delta",
200-
value = 450,
199+
mode = "number+delta",
200+
value = 450,
201201
title = {"text": "Accounts<br><span style='font-size:0.8em;color:gray'>Subtitle</span><br><span style='font-size:0.8em;color:gray'>Subsubtitle</span>"},
202-
delta = {'reference': 400, 'relative': True},
202+
delta = {'reference': 400, 'relative': True},
203203
domain = {'x': [0.6, 1], 'y': [0, 1]}))
204204

205205
fig.show()

0 commit comments

Comments
 (0)