文件首頁
MySQL Shell for VS Code


MySQL Shell for VS Code  /  TypeScript  /  資料庫筆記本:以視覺圖表格式顯示資料

正式發行前:2024-07-17

9.4 資料庫筆記本:以視覺圖表格式顯示資料

資料庫筆記本:使用 LIMIT 和 ORDER BY 在長條圖中顯示人口

runSql("SELECT Name, Population FROM world.country LIMIT 10;", function (result) {
    var options: IGraphOptions = {
        series: [
            {
                id: "myFirstGraph",
                type: "bar",
                yLabel: "Country Population",
                data: result as IJsonGraphData,
                marginLeft: 60,
                marginBottom: 30,
                yDomain: [0, 50000000]
            },
        ],
    };
    Graph.render(options);
});