- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
实例:http://bl.ocks.org/4747134/a702cf79bf10b1438cc665a2438b3f5cf9ab8bf0
代码:
var raw_series = [{"note": "TEXAS LONGHORN", "date": "2013-01-10T00:00:00", "amount": 110.0, "id": 74, "account_id": 1}, {"note": "GOOGLE *FEO Medi", "date": "2013-01-10T00:00:00", "amount": 22.0, "id": 73, "account_id": 1}, {"note": "Pressbyran 5122", "date": "2013-01-10T00:00:00", "amount": 13.0, "id": 77, "account_id": 1}, {"note": "ICA SUPERMARKET", "date": "2013-01-10T00:00:00", "amount": 106.0, "id": 76, "account_id": 1}, {"note": "H\u00c5R 3000", "date": "2013-01-10T00:00:00", "amount": 345.0, "id": 75, "account_id": 1}, {"note": "Pressbyran 5122", "date": "2013-01-11T00:00:00", "amount": 19.0, "id": 72, "account_id": 1}, {"note": "BIRKA PUNKTEN", "date": "2013-01-11T00:00:00", "amount": 79.0, "id": 71, "account_id": 1}, {"note": "DROPBOX", "date": "2013-01-11T00:00:00", "amount": 67.0, "id": 70, "account_id": 1}, {"note": "KAFFESTUGAN", "date": "2013-01-11T00:00:00", "amount": 165.0, "id": 69, "account_id": 1}, {"note": "BIRKA PUNKTEN", "date": "2013-01-12T00:00:00", "amount": 79.0, "id": 67, "account_id": 1}, {"note": "GOOGLE *Chozabu", "date": "2013-01-13T00:00:00", "amount": 15.0, "id": 63, "account_id": 1}, {"note": "VIDEO RULLEN", "date": "2013-01-13T00:00:00", "amount": 171.0, "id": 66, "account_id": 1}, {"note": "\u00c5SGATAN 2 K\u00d6K &", "date": "2013-01-13T00:00:00", "amount": 224.0, "id": 65, "account_id": 1}, {"note": "ICA SUPERMARKET", "date": "2013-01-13T00:00:00", "amount": 209.0, "id": 64, "account_id": 1}, {"note": "GOOGLE *Camel Ga", "date": "2013-01-13T00:00:00", "amount": 7.0, "id": 62, "account_id": 1}, {"note": "THE RACKSPACE CL", "date": "2013-01-16T00:00:00", "amount": 252.0, "id": 59, "account_id": 1}, {"note": "Pressbyran 8535", "date": "2013-01-16T00:00:00", "amount": 33.0, "id": 61, "account_id": 1}, {"note": "BIRKA PUNKTEN", "date": "2013-01-16T00:00:00", "amount": 79.0, "id": 60, "account_id": 1}, {"note": "KAFFESTUGAN", "date": "2013-01-16T00:00:00", "amount": 75.0, "id": 58, "account_id": 1}, {"note": "ICA SUPERMARKET", "date": "2013-01-18T00:00:00", "amount": 80.0, "id": 56, "account_id": 1}, {"note": "STATION", "date": "2013-01-18T00:00:00", "amount": 89.0, "id": 55, "account_id": 1}, {"note": "FREE SOFTWARE FO", "date": "2013-01-19T00:00:00", "amount": 132.0, "id": 52, "account_id": 1}, {"note": "\u00d6verf\u00f6ring 100/m\u00e5n", "date": "2013-01-19T00:00:00", "amount": 100.0, "id": 53, "account_id": 1}, {"note": "ICA SUPERMARKET", "date": "2013-01-19T00:00:00", "amount": 321.0, "id": 51, "account_id": 1}, {"note": "VIDEO RULLEN", "date": "2013-01-21T00:00:00", "amount": 179.0, "id": 46, "account_id": 1}, {"note": "Automatuttag", "date": "2013-01-21T00:00:00", "amount": 300.0, "id": 49, "account_id": 1}, {"note": "\u00c5SGATAN 2 K\u00d6K &", "date": "2013-01-21T00:00:00", "amount": 26.0, "id": 48, "account_id": 1}, {"note": "ICA SUPERMARKET", "date": "2013-01-21T00:00:00", "amount": 174.0, "id": 47, "account_id": 1}, {"note": "MSFT *XBOX LIV", "date": "2013-01-22T00:00:00", "amount": 69.0, "id": 45, "account_id": 1}, {"note": "ICA SUPERMARKET", "date": "2013-01-23T00:00:00", "amount": 293.0, "id": 43, "account_id": 1}, {"note": "PIZZERIA CUOCO P", "date": "2013-01-23T00:00:00", "amount": 140.0, "id": 42, "account_id": 1}, {"note": "ICA SUPERMARKET", "date": "2013-01-24T00:00:00", "amount": 283.0, "id": 41, "account_id": 1}, {"note": "HOTELL NORRTULL", "date": "2013-01-25T00:00:00", "amount": 98.0, "id": 38, "account_id": 1}, {"note": "MAT P\u00c5 JOBB", "date": "2013-01-25T00:00:00", "amount": 80.0, "id": 39, "account_id": 1}, {"note": "\u00d6verf\u00f6ring LOVA/peng", "date": "2013-01-26T00:00:00", "amount": 9000.0, "id": 37, "account_id": 1}, {"note": "Pressbyran 5122", "date": "2013-01-26T00:00:00", "amount": 18.0, "id": 33, "account_id": 1}, {"note": "ICA SUPERMARKET", "date": "2013-01-26T00:00:00", "amount": 373.0, "id": 34, "account_id": 1}, {"note": "J\u00c4RNA W\u00c4RDSHUS", "date": "2013-01-26T00:00:00", "amount": 60.0, "id": 35, "account_id": 1}, {"note": "GETSENTRY LLC", "date": "2013-01-26T00:00:00", "amount": 59.0, "id": 36, "account_id": 1}, {"note": "ICA SUPERMARKET", "date": "2013-01-27T00:00:00", "amount": 556.0, "id": 31, "account_id": 1}, {"note": "WWW.NETFLIX.COM", "date": "2013-01-27T00:00:00", "amount": 79.0, "id": 30, "account_id": 1}, {"note": "DIREKTEN GOTTCEN", "date": "2013-01-27T00:00:00", "amount": 175.0, "id": 32, "account_id": 1}, {"note": "\u00c5SGATAN 2 K\u00d6K &", "date": "2013-01-28T00:00:00", "amount": 154.0, "id": 27, "account_id": 1}, {"note": "HYRESG\u00c4STF\u00d6R", "date": "2013-01-28T00:00:00", "amount": 80.0, "id": 26, "account_id": 1}, {"note": "Automatuttag", "date": "2013-01-28T00:00:00", "amount": 800.0, "id": 25, "account_id": 1}, {"note": "REST KINA MUREN", "date": "2013-01-28T00:00:00", "amount": 428.0, "id": 24, "account_id": 1}, {"note": "KOLINGSBORG", "date": "2013-01-28T00:00:00", "amount": 200.0, "id": 23, "account_id": 1}, {"note": "KOLINGSBORG", "date": "2013-01-28T00:00:00", "amount": 105.0, "id": 22, "account_id": 1}, {"note": "ICA SUPERMARKET", "date": "2013-01-28T00:00:00", "amount": 199.0, "id": 21, "account_id": 1}, {"note": "SPOTIFY PREMIUM", "date": "2013-01-28T00:00:00", "amount": 99.0, "id": 19, "account_id": 1}, {"note": "7-Eleven 16110 G", "date": "2013-01-28T00:00:00", "amount": 136.0, "id": 20, "account_id": 1}, {"note": "\u00d6verf\u00f6ring Spar, 3k", "date": "2013-01-28T00:00:00", "amount": 3000.0, "id": 29, "account_id": 1}, {"note": "\u00c5SGATAN 2 K\u00d6K &", "date": "2013-01-28T00:00:00", "amount": 235.0, "id": 28, "account_id": 1}, {"note": "FREE SOFTWARE FO", "date": "2013-01-30T00:00:00", "amount": 65.0, "id": 17, "account_id": 1}, {"note": "PAYPAL *SQUAD-KS", "date": "2013-01-30T00:00:00", "amount": 154.0, "id": 18, "account_id": 1}, {"note": "SJ REGIONAL STOC", "date": "2013-01-31T00:00:00", "amount": 56.0, "id": 16, "account_id": 1}, {"note": "CIAO CIAO QUATTR", "date": "2013-02-01T00:00:00", "amount": 220.0, "id": 13, "account_id": 1}, {"note": "ICA SUPERMARKET", "date": "2013-02-01T00:00:00", "amount": 50.0, "id": 15, "account_id": 1}, {"note": "APOTEKET DRAKEN", "date": "2013-02-01T00:00:00", "amount": 48.0, "id": 14, "account_id": 1}, {"note": "GRET INDIAN REST", "date": "2013-02-01T00:00:00", "amount": 85.0, "id": 12, "account_id": 1}, {"note": "LINODE.COM", "date": "2013-02-02T00:00:00", "amount": 613.0, "id": 11, "account_id": 1}, {"note": "ICA SUPERMARKET", "date": "2013-02-03T00:00:00", "amount": 110.0, "id": 10, "account_id": 1}, {"note": "ICA SUPERMARKET", "date": "2013-02-04T00:00:00", "amount": 196.0, "id": 9, "account_id": 1}, {"note": "VIDEO RULLEN", "date": "2013-02-04T00:00:00", "amount": 169.0, "id": 8, "account_id": 1}, {"note": "OLEARYS 917", "date": "2013-02-06T00:00:00", "amount": 309.0, "id": 4, "account_id": 1}, {"note": "GRET INDIAN REST", "date": "2013-02-06T00:00:00", "amount": 85.0, "id": 6, "account_id": 1}, {"note": "TAXI STOCKHOLM", "date": "2013-02-06T00:00:00", "amount": 875.0, "id": 5, "account_id": 1}, {"note": "BURGER KING ODEN", "date": "2013-02-06T00:00:00", "amount": 89.0, "id": 3, "account_id": 1}, {"note": "\u00c5SGATAN 2 K\u00d6K &", "date": "2013-02-07T00:00:00", "amount": 226.0, "id": 2, "account_id": 1}, {"note": "Loopia AB", "date": "2013-02-07T00:00:00", "amount": 178.0, "id": 1, "account_id": 1}];
var margin = {top: 20, right: 30, bottom: 30, left: 40},
width = 960 - margin.left - margin.right,
height = 500 - margin.top - margin.bottom;
var format = d3.time.format('%Y-%m-%dT%H:%M:%S')
raw_series.forEach(function (d) { d.date = format.parse(d.date); })
var x = d3.time.scale()
.range([0, width]);
var y = d3.scale.linear()
.range([height, 0]);
var z = d3.scale.category20c();
var xAxis = d3.svg.axis()
.scale(x)
.orient('bottom')
.ticks(d3.time.days)
var yAxis = d3.svg.axis()
.scale(y)
.orient('left');
var stack = d3.layout.stack()
.offset('zero')
.values(function (d) { return d.values; })
.x(function (d) { return d.date; })
.y(function (d) { return d.amount; });
var nest = d3.nest()
.key(function (d) { return d.note })
.key(function (d) { return d.date })
var area = d3.svg.area()
.interpolate('monotone')
.x(function (d) { return x(d.date); })
.y0(function (d) { return y(d.y0); })
.y1(function (d) { return y(d.y0 + d.y); });
var svg = d3.select('#chart').append('svg')
.attr('width', width + margin.left + margin.right)
.attr('height', height + margin.top + margin.bottom)
.append('g')
.attr('transform', 'translate(' + margin.left + ', ' + margin.top + ')');
var layers = stack(nest.entries(raw_series));
x.domain(d3.extent(raw_series, function (d) { return d.date; }));
y.domain([0, d3.max(raw_series, function (d) { d.y0 + d.y; })]);
svg.selectAll(".layer")
.data(layers)
.enter().append("path")
.attr("class", "layer")
.attr("d", function(d) { return area(d.values); })
.style("fill", function(d, i) { return z(i); });
svg.append("g")
.attr("class", "x axis")
.attr("transform", "translate(0," + height + ")")
.call(xAxis);
svg.append("g")
.attr("class", "y axis")
.call(yAxis);
输出:
<g transform="translate(40, 20)">
<path class="layer" d="MNaN,NaNLNaN,450Z" style="fill: #3182bd;"/>
<path class="layer" d="MNaN,NaNLNaN,NaNZ" style="fill: #6baed6;"/>
<path class="layer" d="MNaN,NaNCNaN,NaN,NaN,NaN,NaN,NaNSNaN,NaN,NaN,NaNLNaN,NaNCNaN,NaN,NaN,NaN,NaN,NaNSNaN,NaN,NaN,NaNZ" style="fill: #9ecae1;"/>
<path class="layer" d="MNaN,NaNCNaN,NaN,NaN,NaN,NaN,NaNSNaN,NaN,NaN,NaNSNaN,NaN,NaN,NaNSNaN,NaN,NaN,NaNSNaN,NaN,NaN,NaNSNaN,NaN,NaN,NaNSNaN,NaN,NaN,NaNSNaN,NaN,NaN,NaNSNaN,NaN,NaN,NaNSNaN,NaN,NaN,NaNSNaN,NaN,NaN,NaNSNaN,NaN,NaN,NaNLNaN,NaNCNaN,NaN,NaN,NaN,NaN,NaNSNaN,NaN,NaN,NaNSNaN,NaN,NaN,NaNSNaN,NaN,NaN,NaNSNaN,NaN,NaN,NaNSNaN,NaN,NaN,NaNSNaN,NaN,NaN,NaNSNaN,NaN,NaN,NaNSNaN,NaN,NaN,NaNSNaN,NaN,NaN,NaNSNaN,NaN,NaN,NaNSNaN,NaN,NaN,NaNZ" style="fill: #c6dbef;"/>
<path class="layer" d="MNaN,NaNLNaN,NaNZ" style="fill: #e6550d;"/>
<path class="layer" d="MNaN,NaNCNaN,NaN,NaN,NaN,NaN,NaNSNaN,NaN,NaN,NaNLNaN,NaNCNaN,NaN,NaN,NaN,NaN,NaNSNaN,NaN,NaN,NaNZ" style="fill: #fd8d3c;"/>
<path class="layer" d="MNaN,NaNLNaN,NaNZ" style="fill: #fdae6b;"/>
<path class="layer" d="MNaN,NaNLNaN,NaNLNaN,NaNLNaN,NaNZ" style="fill: #fdd0a2;"/>
<path class="layer" d="MNaN,NaNLNaN,NaNZ" style="fill: #31a354;"/>
<path class="layer" d="MNaN,NaNCNaN,NaN,NaN,NaN,NaN,NaNSNaN,NaN,NaN,NaNLNaN,NaNCNaN,NaN,NaN,NaN,NaN,NaNSNaN,NaN,NaN,NaNZ" style="fill: #74c476;"/>
<path class="layer" d="MNaN,NaNCNaN,NaN,NaN,NaN,NaN,NaNSNaN,NaN,NaN,NaNSNaN,NaN,NaN,NaNLNaN,NaNCNaN,NaN,NaN,NaN,NaN,NaNSNaN,NaN,NaN,NaNSNaN,NaN,NaN,NaNZ" style="fill: #a1d99b;"/>
<path class="layer" d="MNaN,NaNLNaN,NaNZ" style="fill: #c7e9c0;"/>
<path class="layer" d="MNaN,NaNLNaN,NaNZ" style="fill: #756bb1;"/>
<path class="layer" d="MNaN,NaNLNaN,NaNZ" style="fill: #9e9ac8;"/>
<path class="layer" d="MNaN,NaNLNaN,NaNZ" style="fill: #bcbddc;"/>
<path class="layer" d="MNaN,NaNLNaN,NaNLNaN,NaNLNaN,NaNZ" style="fill: #dadaeb;"/>
<path class="layer" d="MNaN,NaNLNaN,NaNZ" style="fill: #636363;"/>
<path class="layer" d="MNaN,NaNLNaN,NaNLNaN,NaNLNaN,NaNZ" style="fill: #969696;"/>
<path class="layer" d="MNaN,NaNLNaN,NaNZ" style="fill: #bdbdbd;"/>
<path class="layer" d="MNaN,NaNLNaN,NaNZ" style="fill: #d9d9d9;"/>
<path class="layer" d="MNaN,NaNLNaN,NaNZ" style="fill: #3182bd;"/>
<path class="layer" d="MNaN,NaNLNaN,NaNZ" style="fill: #6baed6;"/>
<path class="layer" d="MNaN,NaNLNaN,NaNZ" style="fill: #9ecae1;"/>
<path class="layer" d="MNaN,NaNLNaN,NaNZ" style="fill: #c6dbef;"/>
<path class="layer" d="MNaN,NaNLNaN,NaNZ" style="fill: #e6550d;"/>
<path class="layer" d="MNaN,NaNLNaN,NaNZ" style="fill: #fd8d3c;"/>
<path class="layer" d="MNaN,NaNLNaN,NaNZ" style="fill: #fdae6b;"/>
<path class="layer" d="MNaN,NaNLNaN,NaNZ" style="fill: #fdd0a2;"/>
<path class="layer" d="MNaN,NaNLNaN,NaNZ" style="fill: #31a354;"/>
<path class="layer" d="MNaN,NaNLNaN,NaNZ" style="fill: #74c476;"/>
<path class="layer" d="MNaN,NaNLNaN,NaNZ" style="fill: #a1d99b;"/>
<path class="layer" d="MNaN,NaNLNaN,NaNZ" style="fill: #c7e9c0;"/>
<path class="layer" d="MNaN,NaNLNaN,NaNZ" style="fill: #756bb1;"/>
<path class="layer" d="MNaN,NaNLNaN,NaNZ" style="fill: #9e9ac8;"/>
<path class="layer" d="MNaN,NaNLNaN,NaNZ" style="fill: #bcbddc;"/>
<path class="layer" d="MNaN,NaNLNaN,NaNZ" style="fill: #dadaeb;"/>
<path class="layer" d="MNaN,NaNLNaN,NaNZ" style="fill: #636363;"/>
<path class="layer" d="MNaN,NaNLNaN,NaNLNaN,NaNLNaN,NaNZ" style="fill: #969696;"/>
<path class="layer" d="MNaN,NaNLNaN,NaNZ" style="fill: #bdbdbd;"/>
<path class="layer" d="MNaN,NaNLNaN,NaNZ" style="fill: #d9d9d9;"/>
<path class="layer" d="MNaN,NaNLNaN,NaNZ" style="fill: #3182bd;"/>
<path class="layer" d="MNaN,NaNLNaN,NaNZ" style="fill: #6baed6;"/>
<path class="layer" d="MNaN,NaNLNaN,NaNZ" style="fill: #9ecae1;"/>
<g class="x axis" transform="translate(0,450)">
<g class="tick major" style="opacity: 1;" transform="translate(0,0)">
<line x2="0" y2="6"/>
<text dy=".71em" style="text-anchor: middle;" x="0" y="9">
Thu 10
</text>
</g>
<g class="tick major" style="opacity: 1;" transform="translate(31.785714285714285,0)">
<line x2="0" y2="6"/>
<text dy=".71em" style="text-anchor: middle;" x="0" y="9">
Fri 11
</text>
</g>
<g class="tick major" style="opacity: 1;" transform="translate(63.57142857142857,0)">
<line x2="0" y2="6"/>
<text dy=".71em" style="text-anchor: middle;" x="0" y="9">
Sat 12
</text>
</g>
<g class="tick major" style="opacity: 1;" transform="translate(95.35714285714286,0)">
<line x2="0" y2="6"/>
<text dy=".71em" style="text-anchor: middle;" x="0" y="9">
Jan 13
</text>
</g>
<g class="tick major" style="opacity: 1;" transform="translate(127.14285714285714,0)">
<line x2="0" y2="6"/>
<text dy=".71em" style="text-anchor: middle;" x="0" y="9">
Mon 14
</text>
</g>
<g class="tick major" style="opacity: 1;" transform="translate(158.92857142857144,0)">
<line x2="0" y2="6"/>
<text dy=".71em" style="text-anchor: middle;" x="0" y="9">
Tue 15
</text>
</g>
<g class="tick major" style="opacity: 1;" transform="translate(190.71428571428572,0)">
<line x2="0" y2="6"/>
<text dy=".71em" style="text-anchor: middle;" x="0" y="9">
Wed 16
</text>
</g>
<g class="tick major" style="opacity: 1;" transform="translate(222.5,0)">
<line x2="0" y2="6"/>
<text dy=".71em" style="text-anchor: middle;" x="0" y="9">
Thu 17
</text>
</g>
<g class="tick major" style="opacity: 1;" transform="translate(254.28571428571428,0)">
<line x2="0" y2="6"/>
<text dy=".71em" style="text-anchor: middle;" x="0" y="9">
Fri 18
</text>
</g>
<g class="tick major" style="opacity: 1;" transform="translate(286.0714285714286,0)">
<line x2="0" y2="6"/>
<text dy=".71em" style="text-anchor: middle;" x="0" y="9">
Sat 19
</text>
</g>
<g class="tick major" style="opacity: 1;" transform="translate(317.8571428571429,0)">
<line x2="0" y2="6"/>
<text dy=".71em" style="text-anchor: middle;" x="0" y="9">
Jan 20
</text>
</g>
<g class="tick major" style="opacity: 1;" transform="translate(349.6428571428571,0)">
<line x2="0" y2="6"/>
<text dy=".71em" style="text-anchor: middle;" x="0" y="9">
Mon 21
</text>
</g>
<g class="tick major" style="opacity: 1;" transform="translate(381.42857142857144,0)">
<line x2="0" y2="6"/>
<text dy=".71em" style="text-anchor: middle;" x="0" y="9">
Tue 22
</text>
</g>
<g class="tick major" style="opacity: 1;" transform="translate(413.2142857142857,0)">
<line x2="0" y2="6"/>
<text dy=".71em" style="text-anchor: middle;" x="0" y="9">
Wed 23
</text>
</g>
<g class="tick major" style="opacity: 1;" transform="translate(445,0)">
<line x2="0" y2="6"/>
<text dy=".71em" style="text-anchor: middle;" x="0" y="9">
Thu 24
</text>
</g>
<g class="tick major" style="opacity: 1;" transform="translate(476.7857142857143,0)">
<line x2="0" y2="6"/>
<text dy=".71em" style="text-anchor: middle;" x="0" y="9">
Fri 25
</text>
</g>
<g class="tick major" style="opacity: 1;" transform="translate(508.57142857142856,0)">
<line x2="0" y2="6"/>
<text dy=".71em" style="text-anchor: middle;" x="0" y="9">
Sat 26
</text>
</g>
<g class="tick major" style="opacity: 1;" transform="translate(540.3571428571429,0)">
<line x2="0" y2="6"/>
<text dy=".71em" style="text-anchor: middle;" x="0" y="9">
Jan 27
</text>
</g>
<g class="tick major" style="opacity: 1;" transform="translate(572.1428571428572,0)">
<line x2="0" y2="6"/>
<text dy=".71em" style="text-anchor: middle;" x="0" y="9">
Mon 28
</text>
</g>
<g class="tick major" style="opacity: 1;" transform="translate(603.9285714285714,0)">
<line x2="0" y2="6"/>
<text dy=".71em" style="text-anchor: middle;" x="0" y="9">
Tue 29
</text>
</g>
<g class="tick major" style="opacity: 1;" transform="translate(635.7142857142858,0)">
<line x2="0" y2="6"/>
<text dy=".71em" style="text-anchor: middle;" x="0" y="9">
Wed 30
</text>
</g>
<g class="tick major" style="opacity: 1;" transform="translate(667.5,0)">
<line x2="0" y2="6"/>
<text dy=".71em" style="text-anchor: middle;" x="0" y="9">
Thu 31
</text>
</g>
<g class="tick major" style="opacity: 1;" transform="translate(699.2857142857142,0)">
<line x2="0" y2="6"/>
<text dy=".71em" style="text-anchor: middle;" x="0" y="9">
February
</text>
</g>
<g class="tick major" style="opacity: 1;" transform="translate(731.0714285714287,0)">
<line x2="0" y2="6"/>
<text dy=".71em" style="text-anchor: middle;" x="0" y="9">
Sat 02
</text>
</g>
<g class="tick major" style="opacity: 1;" transform="translate(762.8571428571429,0)">
<line x2="0" y2="6"/>
<text dy=".71em" style="text-anchor: middle;" x="0" y="9">
Feb 03
</text>
</g>
<g class="tick major" style="opacity: 1;" transform="translate(794.6428571428572,0)">
<line x2="0" y2="6"/>
<text dy=".71em" style="text-anchor: middle;" x="0" y="9">
Mon 04
</text>
</g>
<g class="tick major" style="opacity: 1;" transform="translate(826.4285714285714,0)">
<line x2="0" y2="6"/>
<text dy=".71em" style="text-anchor: middle;" x="0" y="9">
Tue 05
</text>
</g>
<g class="tick major" style="opacity: 1;" transform="translate(858.2142857142858,0)">
<line x2="0" y2="6"/>
<text dy=".71em" style="text-anchor: middle;" x="0" y="9">
Wed 06
</text>
</g>
<g class="tick major" style="opacity: 1;" transform="translate(890,0)">
<line x2="0" y2="6"/>
<text dy=".71em" style="text-anchor: middle;" x="0" y="9">
Thu 07
</text>
</g>
<path class="domain" d="M0,6V0H890V6"/>
</g>
<g class="y axis">
<path class="domain" d="M-6,0H0V450H-6"/>
</g>
</g>
我研究这个特殊的堆积面积图已有一段时间了。我是 d3 的新手,所以我需要一些关于放置什么的指针,以便 d3 获得正确的信息。
最佳答案
输入数据不正确:
Note that each series must have the same number of values per series, and each value must have the same x-coordinate; if you have missing data or inconsistent x-coordinates per series, you must resample and interpolate your data before computing the stacked layout.
— https://github.com/mbostock/d3/wiki/SVG-Shapes#wiki-area
关于javascript - 堆积面积图 SVG 路径 d=NaNNaNNaN,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14791739/
关闭。这个问题需要debugging details .它目前不接受答案。 编辑问题以包含 desired behavior, a specific problem or error, and th
我试图用这种形式简单地获取数字 28 integer+space+integer+integer+space+integer我试过这个正则表达式 \\s\\d\\d\\s 但我得到了两个数字11 和
最近一直在学习D语言。我一直对运行时感到困惑。 从我能收集到的关于它的信息中,(这不是很多)我知道它是一种有助于 D 的一些特性的运行时。像垃圾收集一样,它与您自己的程序一起运行。但是既然 D 是编译
想问一下这两个正则表达式有区别吗? \d\d\d 与 \d{3} 我已经在我的本地机器上使用 Java 和 Windows 操作系统对此进行了测试,两者都工作正常并且结果相同。但是,当在 linux
我正在学习 Go,而且我坚持使用 Go 之旅(exercise-stringer.go:https://tour.golang.org/methods/7)。 这是一些代码: type IPAddr
我在Java正则表达式中发现了一段令我困惑的代码: Pattern.compile( "J.*\\d[0-35-9]-\\d\\d-\\d\\d" ); 要编译的字符串是: String string
我在 ruby 代码上偶然发现了这个。我知道\d{4})\/(\d\d)\/(\d\d)\/(.*)/是什么意思,但是\1-\2-\3-\4 是什么意思? 最佳答案 \1-\2-\3-\4 是 b
我一直在努力解决这个问题,这让我很恼火。我了解 D 运行时库。它是什么,它做什么。我也明白你可以在没有它的情况下编译 D 应用程序。就像 XoMB 所做的那样。好吧,XoMB 定义了自己的运行时,但是
我有两个列表列表,子列表代表路径。我想找到所有路径。 List> pathList1 List> pathList2 当然是天真的解决方案: List> result = new ArrayList>
我需要使用 Regex 格式化一个字符串,该字符串包含数字、字母 a-z 和 A-Z,同时还包含破折号和空格。 从用户输入我有02-219 8 53 24 输出应该是022 198 53 24 我正在
目标是达到与this C++ example相同的效果: 避免创建临时文件。我曾尝试将 C++ 示例翻译为 D,但没有成功。我也尝试过不同的方法。 import std.datetime : benc
tl;dr:你好吗perfect forwarding在 D? 该链接有一个很好的解释,但例如,假设我有这个方法: void foo(T)(in int a, out int b, ref int c
有什么方法可以在 D 中使用abstract auto 函数吗? 如果我声明一个类如下: class MyClass { abstract auto foo(); } 我收到以下错误: mai
有没有人为内存中重叠的数组切片实现交集?算法在没有重叠时返回 []。 当 pretty-print (使用重叠缩进)内存中重叠的数组切片时,我想要这个。 最佳答案 如果您确定它们是数组,那么只需取 p
我已经开始学习 D,但我在使用 Andrei Alexandrescu 所著的 The D Programming Language 一书中提供的示例时遇到了一些麻烦。由于 int 和 ulong 类
如何创建一个不可变的类? 我的目标是创建一个实例始终不可变的类。现在我只是用不可变的方法和构造函数创建了一个“可变”类。我将其称为 mData,m 表示可变。然后我创建一个别名 alias immut
不久前我买了《The D Programming Language》。好书,很有教育意义。但是,我在尝试编译书中列出的语言功能时遇到了麻烦:扩展函数。 在这本书中,Andrei 写了任何可以像这样调用
我在 D http://www.digitalmars.com/d/2.0/lazy-evaluation.html 中找到了函数参数的惰性求值示例 我想知道如何在 D 中实现可能的无限数据结构,就像
这个问题在这里已经有了答案: 12 年前关闭。 Possible Duplicate: Could anyone explain these undefined behaviors (i = i++
当前是否可以跨模块扫描/查询/迭代具有某些属性的所有函数(或类)? 例如: source/packageA/something.d: @sillyWalk(10) void doSomething()
我是一名优秀的程序员,十分优秀!