JustinasT
JustinasT

Reputation: 633

Chart.js label value

I have a question, anyone have an idea, how to change Chart.js label value format?

Screenshot: enter image description here

How to change it, so it would show not "ACW (sec): 10" but "ACW: 10sec"

Code looks like:

var doughnutDataAcw = [
                {
                    value: <?php echo gmdate("s", $singleacw); ?>,
                    color: "#35df6b",
                    highlight: "#06cc45",
                    label: "ACW (sec)"
                }

Upvotes: 0

Views: 548

Answers (1)

Pointy
Pointy

Reputation: 413702

You can use the tooltipTemplate option:

    tooltipTemplate: "ACW: <%=value%>sec"

If you need the ACW part to come from the label:

    tooltipTemplate: "<%=label%>: <%=value%>sec"

Upvotes: 1

Related Questions