-
-
Couldn't load subscription status.
- Fork 543
bullet charts #1444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
bullet charts #1444
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
_posts/plotly_js/financial/bullet/2015-12-20-bullet-charts_plotly_js_index.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| --- | ||
| title: JavaScript Graphing Library D3.js-based Bullet Charts| Examples | Plotly | ||
| name: Bullet Charts | ||
| permalink: javascript/bullet-charts/ | ||
| description: How to make a D3.js-based bullet chart in javascript. | ||
| layout: user-guide | ||
| thumbnail: thumbnail/bullet.png | ||
| language: plotly_js | ||
| page_type: example_index | ||
| has_thumbnail: true | ||
| display_as: financial | ||
| order: 8 | ||
| redirect_from: javascript-graphing-library/bullet-charts | ||
| --- | ||
| {% assign examples = site.posts | where:"language","plotly_js" | where:"suite","bullet-charts" | sort: "order" %} | ||
| {% include auto_examples.html examples=examples %} | ||
|
|
||
24 changes: 24 additions & 0 deletions
24
_posts/plotly_js/financial/bullet/2019-07-30-advance-bullet.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| --- | ||
| name: Add Steps, and Threshold | ||
| plot_url: https://codepen.io/plotly/embed/gVvazV/?height=600&theme-id=15263&default-tab=result | ||
| language: plotly_js | ||
| suite: bullet-charts | ||
| order: 2 | ||
| sitemap: false | ||
| arrangement: horizontal | ||
| markdown_content: | | ||
|
|
||
| Below is the same example using "steps" attribute, which is shown as shading, and "threshold" to determine boundaries that visually alert you if the value cross a defined threshold. | ||
| --- | ||
| var data = [{ | ||
| type: "indicator", mode: "number+gauge+delta", value: 220, | ||
| domain: {x: [0, 1], y: [0, 1]}, title: {text :"<b>Profit</b>"}, | ||
| delta: {reference: 200}, gauge: {shape: "bullet", axis: {range: [null, 300]}, | ||
| threshold: {line: {color: "red", width: 2}, thickness: 0.75, value: 280}, | ||
| steps: [{range: [0, 150], color: "lightgray"}, {range: [150, 250], color: "gray"}]} | ||
| }]; | ||
|
|
||
| var layout = {width: 600, height: 250}; | ||
| var config = {responsive: true}; | ||
|
|
||
| Plotly.newPlot(gd,data,layout,config); |
20 changes: 20 additions & 0 deletions
20
_posts/plotly_js/financial/bullet/2019-07-30-basic-bullet.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,20 @@ | ||||||
| --- | ||||||
| name: Basic Bullet Charts | ||||||
| plot_url: https://codepen.io/plotly/embed/EqZBWg/?height=600&theme-id=15263&default-tab=result | ||||||
| language: plotly_js | ||||||
| suite: bullet-charts | ||||||
| order: 1 | ||||||
| sitemap: false | ||||||
| arrangement: horizontal | ||||||
| markdown_content: | | ||||||
|
|
||||||
| 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. | ||||||
| Steps typically are broken into several values, which is 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. | ||||||
|
||||||
| Steps typically are broken into several values, which is 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. | |
| Steps typically are broken into several values, which are defined with an array. The bar represents the actual value that a particular variable reached, and the threshold usually indicates a goal point relative to the value achieved by the bar. See [indicator page](https://plot.ly/javascript/gauge-charts/) for more detail. |
25 changes: 25 additions & 0 deletions
25
_posts/plotly_js/financial/bullet/2019-07-30-custom-bullet.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| --- | ||
| name: Custom Bullet Chart | ||
| plot_url: https://codepen.io/plotly/embed/OKQVjE/?height=600&theme-id=15263&default-tab=result | ||
| language: plotly_js | ||
| suite: bullet-charts | ||
| order: 3 | ||
| sitemap: false | ||
| arrangement: horizontal | ||
| markdown_content: | | ||
|
|
||
| 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). | ||
| --- | ||
| var data = [{ | ||
| type: "indicator", mode: "number+gauge+delta", value: 220, | ||
| domain: {x: [0, 1], y: [0, 1]}, delta: {reference: 280, position: "top"}, | ||
| title: {text :"<b>Profit</b><br><span style='color: gray; font-size:0.8em'>U.S. $</span>", | ||
| font: {"size": 14}}, gauge: {shape: "bullet", axis: {range: [null, 300]}, | ||
| threshold: {line: {color: "red", width: 2}, thickness: 0.75, value: 270}, bgcolor: "white", | ||
| steps: [{range: [0, 150], color: "cyan"}, {range: [150, 250], color: "royalblue"}], | ||
| bar: {color: "darkblue"}}}]; | ||
|
|
||
| var layout = {width: 600, height: 230}; | ||
| var config = {responsive: true}; | ||
|
|
||
| Plotly.newPlot(gd,data,layout,config); |
38 changes: 38 additions & 0 deletions
38
_posts/plotly_js/financial/bullet/2019-07-30-multi-bullet.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| --- | ||
| name: Multi Bullet | ||
| plot_url: https://codepen.io/plotly/embed/xvYGyq/?height=600&theme-id=15263&default-tab=result | ||
| language: plotly_js | ||
| suite: bullet-charts | ||
| order: 4 | ||
| sitemap: false | ||
| arrangement: horizontal | ||
| markdown_content: | | ||
|
|
||
| Bullet charts can be stacked for comparing several values at once as illustrated below: | ||
| --- | ||
| var data = [{ | ||
| type: "indicator", mode: "number+gauge+delta", value: 180, | ||
| delta: {reference: 200}, domain: {x: [0.25, 1], y: [0.08, 0.25]}, | ||
| title: {text: "Revenue"}, gauge: {shape: "bullet", axis: {range: [null, 300]}, | ||
| threshold: {line: {color: "black", width: 2}, thickness: 0.75, value: 170}, | ||
| steps: [{range: [0, 150], color: "gray"}, {range: [150, 250], | ||
| color: "lightgray"}], bar: {color: "black"}} | ||
| },{ | ||
| type: "indicator", mode: "number+gauge+delta", value: 35, | ||
| delta: {reference: 200}, domain: {x: [0.25, 1], y: [0.4, 0.6]}, | ||
| title: {text: "Profit"}, gauge: {shape: "bullet", axis: {range: [null, 100]}, | ||
| threshold: {line: {color: "black", width: 2}, thickness: 0.75, value: 50}, | ||
| steps: [{range: [0, 25], color: "gray"}, {range: [25, 75], color: "lightgray"}], | ||
| bar: {color: "black"}} | ||
| }, { | ||
| type: "indicator", mode: "number+gauge+delta", value: 220, | ||
| delta: {reference: 200}, domain: {x: [0.25, 1], y: [0.7, 0.9]}, | ||
| title: {text :"Satisfaction"}, gauge: {shape: "bullet", axis: {range: [null, 300]}, | ||
| threshold: {line: {color: "black", width: 2}, thickness: 0.75, value: 210}, | ||
| steps: [{range: [0, 150], color: "gray"}, {range: [150, 250], color: "lightgray"}], | ||
| bar: {color: "black"}} | ||
| }]; | ||
|
|
||
| var layout = {width: 600, height: 250, margin: {t: 10, "r": 25, "l": 25, "b": 10}}; | ||
| Plotly.newPlot(gd,data,layout); | ||
|
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mentioned this in the waterfall docs but I think this doc should be an example_index on the front page since the financial docs are getting quite crowded. We should make an index page for them in one of these PRs