Skip to content

Commit d2d6845

Browse files
committed
finance: replace attribute 't' -> 'x'
1 parent 966875a commit d2d6845

File tree

3 files changed

+11
-15
lines changed

3 files changed

+11
-15
lines changed

src/traces/candlestick/attributes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ var directionAttrs = {
3131
};
3232

3333
module.exports = {
34-
t: OHLCattrs.t,
34+
x: OHLCattrs.x,
3535
open: OHLCattrs.open,
3636
high: OHLCattrs.high,
3737
low: OHLCattrs.low,

src/traces/ohlc/attributes.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,10 @@ var directionAttrs = {
4444

4545
module.exports = {
4646

47-
// or should this be 'x'
48-
//
49-
//
50-
// should we add the option for ohlc along y-axis ??
51-
t: {
47+
x: {
5248
valType: 'data_array',
5349
description: [
54-
'Sets the time coordinate.',
50+
'Sets the x coordinates.',
5551
'If absent, linear coordinate will be generated.'
5652
].join(' ')
5753
},

src/traces/ohlc/ohlc_defaults.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,23 @@
1212
module.exports = function handleOHLC(traceIn, traceOut, coerce) {
1313
var len;
1414

15-
var t = coerce('t'),
15+
var x = coerce('x'),
1616
open = coerce('open'),
1717
high = coerce('high'),
1818
low = coerce('low'),
1919
close = coerce('close');
2020

2121
len = Math.min(open.length, high.length, low.length, close.length);
2222

23-
if(t) {
24-
len = Math.min(len, t.length);
25-
t.slice(0, len);
23+
if(x) {
24+
len = Math.min(len, x.length);
25+
if(len < x.length) traceOut.x = x.slice(0, len);
2626
}
2727

28-
open = open.slice(0, len);
29-
high = high.slice(0, len);
30-
low = low.slice(0, len);
31-
close = close.slice(0, len);
28+
if(len < open.length) traceOut.open = open.slice(0, len);
29+
if(len < high.length) traceOut.high = high.slice(0, len);
30+
if(len < low.length) traceOut.low = low.slice(0, len);
31+
if(len < close.length) traceOut.close = close.slice(0, len);
3232

3333
return len;
3434
};

0 commit comments

Comments
 (0)