小编Mac*_*acD的帖子

更改Highcharts系列颜色

编辑:所以现在我有一个图表,我的所有数据被推到右边,但我有不同颜色的标签,我想要显示的集,但没有数据?更新了我的代码

原帖:我在这里有一个工作高图http://opensourcesurf.com/chart.html.问题是,当我尝试更改单个数据集的颜色时,它们都会发生变化.如何根据我的代码更改这些设置?提前致谢!

码:

    var options1 = {
    chart: {
        renderTo: 'container1',
        type: 'area'

        },
    xAxis: {
                type: 'datetime'

    },

    series: [{
        name: 'Swell Period',
        color: '#0066FF',
        data: 'newSeriesData',
    },
    {   name: ' Maximum Breaking Wave Height',
        color: '#ffffff',
        data: 'newSeriesData',
    },
    {   name: 'Swell Height',
        color: '#123456',
        data: 'newSeriesData',
    }],
};

var drawChart = function(data, name, color) {



 var newSeriesData = {
    name: name,
    data: data
 };

    // Add the new data to the series array
    options1.series.push(newSeriesData);

    // …
Run Code Online (Sandbox Code Playgroud)

javascript highcharts

4
推荐指数
2
解决办法
2万
查看次数

为标记搜索归一化Firebase数据

我有以下数据结构,并希望返回与标记关联的"产品".是否有可能通过当前的数据结构实现这一目标?如果没有,我应该如何构建数据,以及返回所有具有"标签2"的"产品"的查询是什么样的?

{
  "accounts" : {
    "-KRPU3FyKT4oPWHYjDrr" : {
      "userId" : "1"
    },
    "-kjnsvakljsndfme;lnmv" : {
      "userId" : "2"
    }
},

  "products" : {
    "-KXcnfob3Vo3s8bL9WSI" : {
      "name" : "Product 1",
      "description" : "Description of product 1",
      "tags" : [ "Tag 1", "Tag 2", "Tag 3", "etc." ],
      "url" : "websiteURL1.com",

    },
    "-KXcnfob3Vo3s8bL9WSI" : {
      "name" : "Product 2",
      "description" : "Description of product 2",
      "tags" : [ "Tag 1", "Tag 2", "Tag 3", "etc." ],
      "url" : "websiteURL2.com",

    }
  } …
Run Code Online (Sandbox Code Playgroud)

javascript angularjs firebase ionic-framework firebase-realtime-database

4
推荐指数
1
解决办法
1398
查看次数

带有ngFor的Ionic 4水平滚动

我很茫然。我可以使水平滚动仅与html和css一起正常工作,但是当我介绍ngFor时,它拒绝产生相同的效果。是否有人对此有经验,或者知道如何解决此问题?

这是我不起作用的简单代码:

这个例子产生一个垂直列表:

<div class="container" *ngFor="let item of items | async">
        <div class="scroll" scrollX="true">
         <span>{{item.ProjectEvent}}</span>
        </div>
    </div>
Run Code Online (Sandbox Code Playgroud)

这产生了一个可以水平滚动的宽容器

 <div class="container" >
        <div class="scroll" scrollX="true">
            <span>item1</span>
            <span>item2</span>
            <span>item3</span>
            <span>item4</span>
            <span>item5</span>
            <span>item6</span>
            <span>item7</span>
            <span>item8</span>
            <span>item9</span>
        </div>
    </div>
Run Code Online (Sandbox Code Playgroud)

两者的CSS相同:

.container {
  width: 100px;
  background-color: green;
  overflow: hidden; 
  white-space: nowrap;
  ::-webkit-scrollbar {
    display: none;
  }
  .scroll {
    overflow: auto;
  }
}
Run Code Online (Sandbox Code Playgroud)

向我解释一下史波克先生!

我在这里先向您的帮助表示感谢!

良好措施的依赖性:

"dependencies": {
    "@angular/common": "^7.1.4",
    "@angular/core": "^7.1.4",
    "@angular/fire": "^5.1.1",
    "@angular/forms": "^7.1.4",
    "@angular/http": "^7.1.4",
    "@angular/platform-browser": "^7.1.4",
    "@angular/platform-browser-dynamic": "^7.1.4",
    "@angular/router": "^7.1.4",
    "@ionic-native/core": "5.0.0-beta.21", …
Run Code Online (Sandbox Code Playgroud)

css ionic-framework ngfor angular ionic4

3
推荐指数
2
解决办法
7141
查看次数

出错后重新启动python文件

我有一个程序可以流式传输价格,但在运行缓慢的时段出现 badstatusline 错误。这会导致需要与流交互的其他文件出现问题。我在简单地捕获异常时遇到了很多麻烦,导致了由于某种原因我无法捕获的其他异常BadStatusLine导致CannotSendRequest导致ResponseNotReady。当execution.py 引发异常时,如何简单地重新启动(在本例中)trading.py BadStatusLine

这是我现在的处理方式..

while True:
    try:
        response = self.conn.getresponse().read()
        print response
    except Exception:
        pass 
    else:
        break
Run Code Online (Sandbox Code Playgroud)

如果这很重要的话,它是使用 Httplib 的流

谢谢您的帮助

这也是错误:

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/Users/mattduhon/trading4.py", line 30, in trade
    execution.execute_order(event)
  File "/Users/mattduhon/execution.py", line 34, in execute_order
    response = self.conn.getresponse().read()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1073, in getresponse
    response.begin()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", …
Run Code Online (Sandbox Code Playgroud)

python

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

如何在 UID 下存储 Firebase 用户

我一直使用 push() 方法将所有用户存储在我的 firebase 数据库中。此方法为每个用户生成一个唯一的 id 并将它们存储在此 id 下。我正在尝试更改此设置,以便我的用户存储在使用 set() 方法时自动生成的 user.uid 下,但是,我无法将它们存储在此用户 uid 下。

我正在使用以下内容将用户添加到数据库中,我在这里缺少什么?

firebase.database().ref().child('accounts').set({
                email: user.email,
                userId: firebase.auth().currentUser.uid

              })
Run Code Online (Sandbox Code Playgroud)

这使用 set() 并像这样存储数据:

{
  "accounts" : {
      "email" : "",
      "userId" : ""
    },
{
      "email" : "",
      "userId" : ""
    }
}
Run Code Online (Sandbox Code Playgroud)

使用 push() 的结构如下所示:用户根据 firebase 生成的推送 ID 进行存储。

{
  "accounts" : {
    "-KRPSyO4B48IpBnHBTYg" : {
      "email" : "",
      "userId" : ""
    },
    "-KR4f4s5yvdr67g687nrth" : {
      "email" : "",
      "userId" : ""
    }
  }
Run Code Online (Sandbox Code Playgroud)

我正在寻找的是这种结构:用户由 firebase 生成的 …

javascript firebase firebase-authentication firebase-realtime-database

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