Skip to content

Error in Candlestick trace with TypedArrays #3339

Closed
@jonmmease

Description

@jonmmease

There seems to be an error when specifying the open/close/low/high properties of a candlestick trace with typed arrays:

Versions: Confirmed on 1.42.5 and current master (9bbe295)
CodePen: https://codepen.io/jonmmease/pen/ebZVyp
Example:

var trace1 = {
  x: ['2017-01-04', '2017-01-05', '2017-01-06'], 
  type: 'candlestick', 

  // Works fine with standard arrays
  // close: [116.019997, 116.610001, 117.910004],
  // high: [116.510002, 116.860001, 118.160004], 
  // low: [115.75, 115.809998, 116.470001], 
  // open: [115.849998, 115.919998, 116.779999],
	
  // Fails with typed arrays
  close: new Float32Array([116.019997, 116.610001, 117.910004]),
  high: new Float32Array([116.510002, 116.860001, 118.160004]), 
  low: new Float32Array([115.75, 115.809998, 116.470001]), 
  open: new Float32Array([115.849998, 115.919998, 116.779999]),
};

var data = [trace1];

Plotly.plot('plotly-div', data);

Expected Result:
newplot-4

Result:
No plot is displayed and this error occurs in the JS console
screen shot 2018-12-15 at 5 57 25 am

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsomething broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions