Highcharts 从SQLAlchemy数据库接收到绘图图表的数据类型

Highcharts 从SQLAlchemy数据库接收到绘图图表的数据类型,highcharts,flask-sqlalchemy,Highcharts,Flask Sqlalchemy,我正试图用烧瓶中的高度图绘制一个图表。当我在代码中给出数据时,我没有问题。但是当我从数据库中检索数据时,它返回一个,,最后像 [(72,),(70.5,),(78.8,),(73,),(76,),(75,),] 所以,这不是将数据传递到图表,我在网页上有一个空白 这是我使用的代码: 视图.py @control.route("/") def index(chartID = 'chart_ID', chart_type = 'line', chart_height = 350): char

我正试图用烧瓶中的高度图绘制一个图表。当我在代码中给出数据时,我没有问题。但是当我从数据库中检索数据时,它返回一个
,最后像

[(72,),(70.5,),(78.8,),(73,),(76,),(75,),]

所以,这不是将数据传递到图表,我在网页上有一个空白

这是我使用的代码:

视图.py

@control.route("/")
def index(chartID = 'chart_ID', chart_type = 'line', chart_height = 350):
    chart = {"renderTo": chartID, "type": chart_type, "height": chart_height,}
    series = [{"data": [tempg()]}]
    title = {"text": 'My Title'}
    xAxis = {"title": {"text": 'xAxis Label'}}
    yAxis = {"title": {"text": 'yAxis Label'}}
    return render_template('control/index.html', uptime=GetUptime(),      chartID=chartID, chart=chart, series=series, title=title, xAxis=xAxis, yAxis=yAxis)

    def tempg():
    tempgrs = [tempg for tempg in         Temperature.query.with_entities(Temperature.tempft).all()]
    return tempgrs
是因为结尾有多余的逗号,我无法得到图表,还是其他编码错误


提前感谢。

您得到的数据是字符串还是JSON?数据不是JSON。您得到的数据是字符串还是JSON?数据不是JSON。