SMART datagrid v.1 > Examples

Back  Forward

Single Chart  Example
no-lite

通过调整几种样式,并在网格GridBase.headerItems中指定图表模型,可以使用网格为图表视图。 另外,下列例题中,没有在网格上连接数据组,而是在图表系列上直接指定了系列项。 

Grid - 1

可以使一个列填满网格的整体宽度,并且可以调整边框等而取消显示重叠的线。 

Code -1
    grid.setOptions({
        display: {
            // 使列单元格填满整体宽度。
            fitStyle: null
        });
        headerItems: {
            // 使图表填满整体高度。
            fillHeight: 1,
            // 清除图表边框。
            styles: {
                borderRight: null,
                borderBottom: null,
            },
            ...
        }
    });
    
    // 清除显示图表的单元格的右侧边框。
    grid.loadStyles({
        body: {
            borderRight: null
        },
        header: {
            borderRight: null
        }
    });

我们也可以直接设置系列项。 

Code -2
    var chart = {
        ...
        series: [{
            ...
            items: [{
                    year: '2000',
                    value: 53
                }, {
                    year: '2001',
                    value: 73
                },
                ...
            ]
        }]
    };

查看源代码 JSP 

Examples
Hello Chart