fix: 折线图纵轴优化——默认约80%头空间、取整到nice刻度,支持手动设置纵轴上限

- 纵轴自动刻度改为精细步进(1/1.5/2/2.5/3/4/5/6/8/10),数据最大值落在约80%处
- ChartInput 新增 yMax 字段(JSON 存储、可拓展),图表弹窗新增「纵轴上限」输入
- 新增 yMax 往返测试
This commit is contained in:
MobKBK
2026-09-04 15:07:10 +08:00
parent 8340d1dbbd
commit ff10e7f065
4 changed files with 28 additions and 6 deletions

View File

@@ -29,6 +29,14 @@ def test_chart_crud_and_conflict(tmp_path):
assert repo.delete_chart(chart["chartId"])["deleted"] is True
def test_chart_yMax_roundtrip(tmp_path):
repo = JsonRepository(tmp_path)
bounded = repo.create_chart(ChartInput(title="带上限", yMax=10))
assert repo.get_chart(bounded["chartId"])["yMax"] == 10
auto = repo.create_chart(ChartInput(title="自动"))
assert repo.get_chart(auto["chartId"])["yMax"] is None
def test_chart_data_modes_and_continuous_points(tmp_path):
repo = JsonRepository(tmp_path)
task = _task(repo)