Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/62.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 线图不使用concat函数_Ruby On Rails - Fatal编程技术网

Ruby on rails 线图不使用concat函数

Ruby on rails 线图不使用concat函数,ruby-on-rails,Ruby On Rails,我在查询中使用concat函数使用带费的“$”符号。我面临的问题是,线图在没有concat函数的情况下进行渲染,但不使用concat。 我用的是宝石 这是我的问题 与concat: select date_trunc('month', (bookings.created_at)::timestamp)::date as dt, concat('$', avg(bookings.total_fee_usd)) as total_rent from bookings where booking

我在查询中使用concat函数使用带费的“$”符号。我面临的问题是,线图在没有concat函数的情况下进行渲染,但不使用concat。 我用的是宝石

这是我的问题

与concat:

select date_trunc('month', (bookings.created_at)::timestamp)::date as dt, 
concat('$', avg(bookings.total_fee_usd)) as total_rent 
from bookings where 
bookings.state in ('paid_in_full') 
group by dt order by dt desc

不含混凝土

select date_trunc('month', (bookings.created_at)::timestamp)::date as dt,
avg(bookings.total_fee_usd) as total_rent
from bookings
where bookings.state in ('paid_in_full')
group by dt order by dt desc

我的要求是要有折线图和一个美元“$”符号


非常感谢您的帮助。

问题在于Blazer gem使用的第三方插件。Blazer gem依赖于
chartkick.js
chartkick.js
如果数据集中包含特殊符号,则不会绘制折线图。因此,目前,在Blazer gem更新其gem并提供某种实现方法之前,无法使用Blazer gem实现这一点。
但是,如果您在项目中使用独立的
chartkick.js
库,则可以通过如下方式作为参数/参数传递:
new chartkick.LineChart(“chart-1”,data,{prefix:$”})

问题在于Blazer gem使用的第三方插件。Blazer gem依赖于
chartkick.js
chartkick.js
如果数据集中包含特殊符号,则不会绘制折线图。因此,目前,在Blazer gem更新其gem并提供某种实现方法之前,无法使用Blazer gem实现这一点。
但是,如果您在项目中使用独立的
chartkick.js
库,则可以通过如下方式作为参数/参数传递:
new chartkick.LineChart(“chart-1”,data,{prefix:$”})

我也在寻找答案。我认为Blazer只希望数字能够创建一个图形图表,它不能“测量”字符串,在图表生成后,您是否尝试用一些JS将每个标签连接起来?我也在寻找答案。我认为Blazer只希望数字能够创建一个图形图表,它无法“测量”字符串,在生成图表后,您是否尝试用一些JS来连接每个标签?