我真的在努力颠倒我的y轴。我知道我可以在最后减去我的svgContainer的高度以获得准确的读数,但我真的需要实际翻转svg轴以保留'rect'标签中的坐标(x和y)属性。
我认为翻译和规模会起作用,但它并没有改变任何东西。
WITH matches as
(
select 5 as id, '{"Id":1,"Teams":[{"Name":"TeamA","Players":[{"Name":"AAA"},{"Name":"BBB"}]},{"Name":"TeamB","Players":[{"Name":"CCC"},{"Name":"DDD"}]}],"TeamRank":[1,2]}'::json as match
union all
select 6 as id, '{"Id":2,"Teams":[{"Name":"TeamA","Players":[{"Name":"CCC"},{"Name":"BBB"}]},{"Name":"TeamB","Players":[{"Name":"AAA"},{"Name":"DDD"}]}],"TeamRank":[1,2]}' as match
)
SELECT json_agg(u.team) FROM (
SELECT DISTINCT ON (t.team->>'Name') t.team
FROM matches m, json_array_elements(m.match->'Teams') t(team)
ORDER BY t.team->>'Name', m.id DESC) AS u;
答案 0 :(得分:1)
.yAxisWrapper {
float: left;
white-space: nowrap;
}
.yAxisLabel {
width: 20px;
height: 20px;
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg); -ms-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
position: relative;
top: 100px;
}