forked from plotly/documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
mahdis-z
committed
Apr 23, 2019
1 parent
0153473
commit 48fae90
Showing
4 changed files
with
39 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
35 changes: 35 additions & 0 deletions
35
_posts/plotly_js/basic/waterfall/2015-04-09-style-waterfall.html
This file contains 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,35 @@ | ||
--- | ||
name: Style Waterfall Chart | ||
plot_url: https://codepen.io/plotly/embed/GLXVvM/?height=500&theme-id=15263&default-tab=result | ||
language: plotly_js | ||
suite: waterfall | ||
order: 4 | ||
sitemap: false | ||
arrangement: horizontal | ||
--- | ||
var gd = document.getElementById('graphDiv'); | ||
var data = [ | ||
{ | ||
type: "waterfall", | ||
x: [ | ||
["2016", "2017", "2017", "2017", "2017", "2018", "2018", "2018", "2018"], | ||
["initial", "q1", "q2", "q3", "total", "q1", "q2", "q3", "total" ] | ||
], | ||
measure: ["absolute", "relative", "relative", "relative", "total", "relative", "relative", "relative", "total"], | ||
y: [10, 20, 30, -10, null, 10, 20, -40, null], | ||
base: 300, | ||
decreasing: { marker: { color: "Maroon" , line:{color : "red", width :2}}}, | ||
increasing: { marker: { color: "Teal"} }, | ||
totals: { marker: { color: "deep sky blue", line:{color:'blue',width:3}} } | ||
}]; | ||
layout = {title: { | ||
text: "Profit and loss statement" | ||
}, | ||
waterfallgroupgap : {type: 1}, | ||
xaxis: { | ||
title: "", | ||
tickfont: {size: 15}, | ||
ticks: "outside" | ||
} | ||
} | ||
Plotly.newPlot(gd, data, layout); |