2 Star 12 Fork 4

Gitee 极速下载/Charts-rs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/vicanso/charts-rs
克隆/下载
table_chart.rs 1.12 KB
一键复制 编辑 原始数据 按行查看 历史
vicanso 提交于 2年前 . feat: support multi chart
use charts_rs::TableChart;
use pretty_assertions::assert_eq;
#[test]
fn table_chart() {
let mut table_chart = TableChart::from_json(
r###"{
"theme": "grafana",
"title_text": "NASDAQ",
"data": [
[
"Name",
"Price",
"Change"
],
[
"Datadog Inc",
"97.32",
"-7.49%"
],
[
"Hashicorp Inc",
"28.66",
"-9.25%"
],
[
"Gitlab Inc",
"51.63",
"+4.32%"
]
],
"header_font_weight": "bold",
"text_aligns": ["left", "center", "right"],
"cell_styles": [
{
"font_color": "#fff",
"font_weight": "bold",
"background_color": "#2d7c2b",
"indexes": [1, 2]
}
]
}"###,
)
.unwrap();
assert_eq!(
include_str!("../asset/table_chart/basic_json.svg"),
table_chart.svg().unwrap()
);
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Rust
1
https://gitee.com/mirrors/Charts-rs.git
git@gitee.com:mirrors/Charts-rs.git
mirrors
Charts-rs
Charts-rs
main

搜索帮助