ankane / chartkick

Create beautiful JavaScript charts with one line of Ruby

Home Page:https://chartkick.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Weird thousands separator

efmiglioranza opened this issue · comments

image

When using the thousands separator option, the first digit is replaced by the separator, both in the axis and in the tooltip label (used '@' to explicit it), for ex. @034 should be 1@034. Code:

line_chart data_path(format: :json),
    id: "payments-chart",
    label: "Valor",
    height: "350px",
    prefix: "R$ ",
    decimal: ",",
    thousands: "@"

Data:
[{"name":"Previsto","data":[["2021-08-01",0],["2021-08-02",0],["2021-08-03",0],["2021-08-04",0],["2021-08-05",1034.0],["2021-08-06",0],["2021-08-07",0],["2021-08-08",0],["2021-08-09",6856.47],["2021-08-10",0],["2021-08-11",0],["2021-08-12",0],["2021-08-13",0],["2021-08-14",0],["2021-08-15",0],["2021-08-16",8791.24],["2021-08-17",0],["2021-08-18",6388.61],["2021-08-19",378.0],["2021-08-20",0],["2021-08-21",0],["2021-08-22",0],["2021-08-23",0],["2021-08-24",0],["2021-08-25",0],["2021-08-26",0],["2021-08-27",0],["2021-08-28",0],["2021-08-29",0],["2021-08-30",0],["2021-08-31",0]],"color":"#6e97aa"},{"name":"Recebido","data":[["2021-08-01",0],["2021-08-02",0],["2021-08-03",0],["2021-08-04",0],["2021-08-05",1034.0],["2021-08-06",0],["2021-08-07",0],["2021-08-08",0],["2021-08-09",6856.47],["2021-08-10",0],["2021-08-11",0],["2021-08-12",0],["2021-08-13",0],["2021-08-14",0],["2021-08-15",0],["2021-08-16",8791.24],["2021-08-17",0],["2021-08-18",6259.61],["2021-08-19",378.0],["2021-08-20",0],["2021-08-21",0],["2021-08-22",0],["2021-08-23",0],["2021-08-24",0],["2021-08-25",0],["2021-08-26",0],["2021-08-27",0],["2021-08-28",0],["2021-08-29",0],["2021-08-30",0],["2021-08-31",0]],"color":"#8fae53"}]

Hey @efmiglioranza, unfortunately, I'm not able to reproduce. What version of Chartkick and Chart.js are you on?

Hi! Turns out I forgot a CDN link loading an old version of Chart.js. Seems fine now, thanks!