小编use*_*712的帖子

setTimeout不能与node.js一起使用

我正在编写mocha测试用例来测试以下步骤.我打算在调用另一个API之前进行API调用并等待30分钟.我正在使用内部节点API编写调用REST API来编写此测试用例.但由于某种原因,setTimeout不等待给定的ms.有人可以帮帮我吗?

 describe('Checkout - ', function() {
   before(function() {
     lapetus = test.Lapetus;
   });
  it('Get purchase contract after session is expired [C123]',     function(done) {
    this.timeout(180000000);
    lapetus.run(function() {
     // create customer
     ......

     // create new cart and add one item
     ......

    // create new contract with empty cart id
    .......
    var pc_id =....;

    // wait for 30 minutes for the session to expire
    console.log('wait... ' + new Date);
    this.setTimeout(getPC(lapetus,pc_id), 18000000);
    console.log('ok... ' + new Date);
    done();
  });
});

  var getPC …
Run Code Online (Sandbox Code Playgroud)

javascript settimeout node.js

7
推荐指数
1
解决办法
9649
查看次数

Google绘制了将水平条形变为垂直条纹的方法

我已经阅读了与我的问题几乎所有可能相关的文档,但无法得到适当的答案.

我正在使用谷歌可视化API绘制条形图.我正在创建一个数据表并为该数据表添加列和行.最后在图表对象上使用draw api并传递datatable和options数组,如下所示:

    var browser_options = {
                  width: 600,
                  height: 400,
                  legend: { position: 'top', maxLines: 3 },
                    bar: { groupWidth: '75%' },
                           isStacked: true,

                 };
Run Code Online (Sandbox Code Playgroud)

我的问题,我从一些谷歌文档中读到,我可以使用chbh参数对条形图进行分组.有没有办法可以使用draw api设置这些参数?

如何将水平条变为垂直条?这些必须是我需要在图表数据上设置的一些属性吗?

任何帮助表示赞赏.如果有关于数据表的谷歌图表设置属性的任何文档,请指向该文档.

非常感谢.

google-visualization

2
推荐指数
1
解决办法
5015
查看次数