pyecharts / pyecharts-gallery

Just use pyecharts to imitate Echarts official example.
https://gallery.pyecharts.org
MIT License
1.19k stars 585 forks source link

table组件 #47

Closed Liubingzhe-888 closed 2 years ago

Liubingzhe-888 commented 3 years ago

table为啥没有dump_options_with_quotes()方法

emperinter commented 2 years ago

相同的问题,Table组件如何实现前后端分离呢?目前貌似只找到render()方法生成网页文件。

emperinter commented 2 years ago

自己开发用的是Django框架,本来想靠这个来渲染的。后续还是选择了用Django自带的方法来实现的,具体可以参考:https://github.com/emperinter/DateListThingsAnalyse/blob/master/background/templates/admin.html

<table class="table">
    <thead>
        <tr>
            <th>
                Date
            </th>
            <th>
                Process
            </th>
            <th>
                Emotion
            </th>
            <th>
                Energy
            </th>
            <th>
                KeyWords
            </th>
        </tr>
    </thead>
    {% for get_things in things %}
        <tr class="">
            <td>{{ get_things.date }}</td>
            <td>{{ get_things.process }}</td>
            <td>{{ get_things.emotion }}</td>
            <td>{{ get_things.energy }}</td>
            <td>{{ get_things.key }}</td>
        </tr>
    {% endfor %}
</table>