Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
321 views
in Technique[技术] by (71.8m points)

java - How to get a variable in Thymeleaf when a map is already involved?

In my project I have a SVG-graph (I hope that is the right word), in which I display data from a hash map. To make this more dynamic I need a single variable for my calculation.

In this case I need help to to change the 2020 to a variable year which I set in the Java back end. But how it can get there?

<circle th:each="einnahmenUmsatz : ${plotDatenEinnahmen}" 
        th:cx="${100*einnahmenUmsatz.getKey().getMonthValue() + 1200*(einnahmenUmsatz.getKey().getYear()%2020)}" 
        th:cy="${375-20*einnahmenUmsatz.getValue().getNumber().intValue()/1000}" 
        th:data-value="${einnahmenUmsatz.getValue().getNumber().intValue()}" r="4">
    <title th:text="${einnahmenUmsatz.getValue()}"></title>
</circle>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

Please log in or register to answer this question.

Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...