-
-
Notifications
You must be signed in to change notification settings - Fork 67
/
Copy path2015-04-09-axes-labels.html
executable file
·75 lines (66 loc) · 1.37 KB
/
2015-04-09-axes-labels.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
---
name: Set and Style Axes Title Labels and Ticks
language: plotly_js
suite: axes
order: 0
sitemap: false
arrangement: horizontal
---
d3.csv("https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv", function(err, rows){
function unpack(rows, key) {
return rows.map(function(row) { return row[key]; });
}
var x = unpack(rows, 'Date')
var y = unpack(rows, 'AAPL.Volume')
var trace = {
type: "scatter",
mode: "lines",
name: 'AAPL Volume',
x: x,
y: y,
line: {color: 'grey'}
}
var data = [trace];
var layout = {
title: {text: 'Volume of Apple Shares Traded'},
xaxis: {
title: {
text: 'AXIS TITLE',
font: {
family: 'Arial, sans-serif',
size: 18,
color: 'lightgrey'
}
},
showticklabels: true,
tickangle: 'auto',
tickfont: {
family: 'Old Standard TT, serif',
size: 14,
color: 'black'
},
exponentformat: 'e',
showexponent: 'all'
},
yaxis: {
title: {
text: 'AXIS TITLE',
font: {
family: 'Arial, sans-serif',
size: 18,
color: 'lightgrey'
}
},
showticklabels: true,
tickangle: 45,
tickfont: {
family: 'Old Standard TT, serif',
size: 14,
color: 'black'
},
exponentformat: 'e',
showexponent: 'all'
}
};
Plotly.newPlot('myDiv', data, layout);
})