以下是D3中的线路聊天的代码.目前它显示了该行的所有值,但我想要显示的只是第一个和最后一个点,末尾附加了"B".我该如何解决?
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Unemployment by Ward Bar Chart</title>
<style type="text/css">
.axis text{
font-family: Arial;
font-size: 13px;
color: #333333;
text-anchor: end;
}
path {
stroke: steelblue;
stroke-width: 2;
fill: none;
}
.axis path,
.axis line {
fill: none;
stroke: grey;
stroke-width: 1;
shape-rendering: crispEdges;
}
.textlabel{
font-family: Arial;
font-size:13px;
color: #333333;
text-anchor: middle;
}
}
</style>
<body>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script>
// Set the dimensions of the canvas / graph
var margin = {top: 20, right: 0, bottom: …Run Code Online (Sandbox Code Playgroud) 例如,
(['2', '3', '5'], ['1', '3', '4', '5'])
Run Code Online (Sandbox Code Playgroud)
以上应该产生数字3和5
(['1', '2', '4'], ['1', '2'])
Run Code Online (Sandbox Code Playgroud)
这应该给出1,2
(['2', '3', '5'], ['1', '2', '4'], ['2', '3'])
Run Code Online (Sandbox Code Playgroud)
这个,应该给出2,因为2包含在元组的所有3个列表中.如果没有设置,它应该只返回一个空列表
for i,e in enumerate(tup):
while index < len(tup):
print(tup[index], tup[index + 1])
index = index + 1
Run Code Online (Sandbox Code Playgroud)
现在我有这个,我不知道如何通过tup(元组)并提取每个列表以找到每个2列表的集合并迭代并与元组中的其余列表进行比较