小编Joc*_*nze的帖子

Rails 以一长串关于已初始化常量的警告开始

Rails 以一长串关于已初始化常量的警告开始。这是警告列表

/Users/jochen/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/x86_64-darwin17/etc.bundle: warning: already initialized constant Etc::SC_AIO_LISTIO_MAX
/Users/jochen/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/x86_64-darwin17/etc.bundle: warning: already initialized constant Etc::SC_AIO_MAX
/Users/jochen/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/x86_64-darwin17/etc.bundle: warning: already initialized constant Etc::SC_AIO_PRIO_DELTA_MAX
/Users/jochen/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/x86_64-darwin17/etc.bundle: warning: already initialized constant Etc::SC_ARG_MAX
/Users/jochen/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/x86_64-darwin17/etc.bundle: warning: already initialized constant Etc::SC_ATEXIT_MAX
/Users/jochen/.rvm/rubies/ruby-2.5.5/lib/ruby/2.5.0/x86_64-darwin17/etc.bundle: warning: already initialized constant Etc::SC_BC_BASE_MAX
... and many more from the same ruby path
Run Code Online (Sandbox Code Playgroud)

这似乎不会产生问题,但有点烦人。有人知道如何解决这些警告吗?

ruby ruby-on-rails

12
推荐指数
2
解决办法
2250
查看次数

反应图表中的 onDraw 事件

在另一个论坛中,我发现了这个对我有用的代码:

var chart = new Chartist.Bar('.ct-chart', {
  labels: ['Test', 'Long test', 'Very long test'],
  series: [[1, 5, 3]]
});

// Uncomment this line to test rendering without foreign objects
//chart.supportsForeignObject = false;

chart.on('draw', function(event) {
  // If the draw event is for labels on the x-axis
  if(event.type === 'label' && event.axis.units.pos === 'x') {
    // If foreign object is NOT supported, we need to fallback to text-anchor and event.width / 2 offset.
    if(!chart.supportsForeignObject) {
      event.element.attr({
        x: event.x + event.width / …
Run Code Online (Sandbox Code Playgroud)

events reactjs chartist.js

3
推荐指数
1
解决办法
1055
查看次数

标签 统计

chartist.js ×1

events ×1

reactjs ×1

ruby ×1

ruby-on-rails ×1