What format is required by the extenddata property with candlestick plots?

I’m trying to plot a candlestick from a live stream of data by extending it updon receiving new data and its not working. Currently by inspecting chrome’s DevTool console it displays the following error

Error: attribute type must be an array of length equal to indices array length

I think this suggest that my update_graph’s data dictionary format is incorrect, but i cannot find information regarding the format and how to fix it.

below is my code.

import json
import dash_html_components as html
import dash_core_components as dcc
import plotly.graph_objects as go
from gevent import sleep
from dash import Dash
from dash.dependencies import Input, Output, State
from dash_extensions import WebSocket
from dash_extensions.websockets import SocketPool, run_server

import threading, queue, time
from datetime import datetime
from pytz import timezone
x = 0
def genData(q):
    global x
    while True:
        values = {}
        values['high'] = 10
        values['low'] = 5 
        values['open'] = 6
        values['close'] = 9
        values['CHANGE'] = 0
        values['MARKET_STATE'] = 'edit'
        values['UPDATE_TIME'] = datetime.now(timezone('Europe/London')).time().strftime('%H:%M:%S')
        item = {}
        item['values'] = values
        x += 0.1

# This block runs asynchronously.
def ws_handler(ws, q):
    # for data in data_feed():
    #     ws.send(json.dumps(data))  # send data
    while True:
        while len(list(q.queue)) != 0:
            data = q.get()
            sleep(0.1)  # delay between data events

q = queue.Queue()
# Create example app.
app = Dash(prevent_initial_callbacks=True)
socket_pool = SocketPool(app, handler=lambda x: ws_handler(x, q))
app.layout = html.Div([
    dcc.Graph(id="graph", figure=go.Figure(go.Candlestick(x=[],open=[],close=[],high=[],low=[]))),#go.Scatter(x=[], y=[]))),

@app.callback(Output("graph", "extendData"), [Input("ws", "message")], [State("graph", "figure")])
def update_graph(msg, figure):    
    data = json.loads(msg['data'])['values']
    return (
            x = [[ datetime.strptime(data['UPDATE_TIME'],'%H:%M:%S') ]],
            open  = [[ data['open'] ]],
            close = [[ data['close']]],
            high  = [[ data['high']]],
            low   = [[ data['low']]],

if __name__ == '__main__':
    threading.Thread(target=genData, daemon=True, args=(q,)).start()