小编Vee*_*n N的帖子

D3线图显示为面积图

我绘制了一个折线图,该线下面的区域看起来是彩色的,使其看起来像一个区域图.代码如下所示

    <!DOCTYPE html>
    <html>
    <head>
    <style type="text/css">
    body {
    font: 12px Arial;
    }

    path {
    stroke-width: 1;

    stroke : 1;
    }

    .axis path,.axis line {
    fill: none;
    stroke: grey;
    stroke-width: 1;
    shape-rendering: crispEdges;
   } 
   </style>
   <script type="text/javascript" src="d3.min.js"></script>
   <script type="text/javascript" src="jquery-1.8.0.js"></script>
   <meta charset="ISO-8859-1">
   <title>Insert title here</title>
   </head>
   <body>
   <script type="text/javascript">
   var baseSvg = d3.select("body")
                .append("svg")
                .attr("height",800)
                .attr("width",800)
                .append("g")
                .attr("transform","translate(50,50)");


    $.ajax({
    method : 'GET',
    url:"URL", //Called my URL here
    success:function(data){
        var res = data.d.results;
        /* res.forEach(function(d){
            console.log(new Date(parseInt(d.DATE_SQL.substring(6))));
        }) */
        buildTrend(res); …
Run Code Online (Sandbox Code Playgroud)

javascript html5 visualization information-visualization d3.js

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

JVM 线程的概念以及与 OS 线程的关系

这是我对 CPU 和线程的基本理解(天真!)。处理器每个内核可以运行一个线程。
我的笔记本电脑上的系统信息如下所示
处理器 Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz, 2112 Mhz, 4 Core(s), 8 Logical Processor(s) **可以并行运行 8 个线程 * *
为了验证我的理解,我创建了一个 Spring Boot(嵌入式 tomcat)来处理每个请求

@GetMapping("/ping")
public String ping(@RequestParam String id) throws InterruptedException {
System.out.println(MessageFormat.format("The request id is {0}", id));
int i = Integer.parseInt(id);
long now = System.currentTimeMillis();
long period = 5000L;
long later = System.currentTimeMillis();
if (i % 2 == 1) {
  while (later - now <= period) {
    later = System.currentTimeMillis();
  }
}
return PING_SUCCESSFUL;
Run Code Online (Sandbox Code Playgroud)

} …

java multithreading processor

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