cube.js playground 没有正确绘制数据

cube.js playground not plotting data correctly

我正在使用 cube.js 通过将数据绘制成折线图来比较数据随时间的变化。

第 1 步: 成功生成 cube.js 模式后,数据如下所示:

第 2 步:

现在,当我尝试检查折线图时,它显示如下线。没有行被格式化。不幸的是,它也不适用于条形图。

此外,在 SQL 中,值的数据类型是:float(10,10) 和 timestamp

除此之外,cube.js 控制台没有错误跟踪,而是工作正常:

Performing query: scheduler-0070c129-f83a-45db-ae09-aac6f9858200
Executing SQL: scheduler-0070c129-f83a-45db-ae09-aac6f9858200
--
  SELECT FLOOR((UNIX_TIMESTAMP()) / 10) as refresh_key

此外,我尝试如下:[所有时间,w/o 根据需要进行分组和数据透视设置],但没有运气,

但是,如果我添加度量计数,计数绘制的是谎言,而不是我在数据透视设置中配置的预期 y 轴数据。

我的问题是:出了什么问题?

我的目标是生成一个数值随时间变化的折线图:

x 轴:date/time。 y轴:我的数值。

Cube.js 为我的数据生成了以下架构。 此模式的问题是 String 类型 被分配给年龄维度(显然应该是一个数字)。此外,没有 measures for filed age ,我正在尝试绘制。

cube(`ConceptDrifts`, {
  sql: `SELECT * FROM cube.concept_drifts`,
  preAggregations: {
  },
  joins: {
    
  },
  measures: {
    count: {
      type: `count`,
      drillMembers: [date]
    },
    testCount: {
      sql: `test_count`,
      type: `sum`
    }
  },
  dimensions: {
    age: {
      sql: `age`,
      type: `string`
    },
    maxAge: {
      sql: `max_age`,
      type: `string`
    },
    sex: {
      sql: `sex`,
      type: `string`
    },
    sexSd: {
      sql: `sex_sd`,
      type: `string`
    },
    date: {
      sql: `date`,
      type: `time`
    }
  },
  dataSource: `default`
});

因此,我在 /cube/conf/schema# 手动更改了架构

添加了新措施a:

   ag :{
     type : `number`,
     sql : `age`,       
     drillMembers : [age]           
    }   

并且,更改了维度中的类型(如 number):

 dimensions: {
    age: {
      sql: `age`,
      type: `number`
    },
    
    maxAge: {
      sql: `max_age`,
      type: `number`
    },
    
    sex: {
      sql: `sex`,
      type: `number`
    },
    
    sexSd: {
      sql: `sex_sd`,
      type: `number`
    },
    
    date: {
      sql: `date`,
      type: `time`
    }
  },
  
  dataSource: `default`
});

因此,图表如下所示:

更多参考:

Data Schema Concepts
Drilldowns