The following code shows you my current chart. How I can edit the label of the xaxis to show the years "2015", "2016", "2017", "2018" and "2019"? I am really new in this D3.
var data = new Array (1, 2, 3, 4, 5);
var x_scale = d3.scale.linear()
.domain([0,d3.max(data, function(d,i) { return i+1 })])
.range([62,540])
var xAxis = d3.svg.axis()
.scale(x_scale)
.tickSize(0,0)
.ticks(5)
.tickPadding(6)
.orient("bottom");
d3.select("svg").append("g")
.call(xAxis)
.attr("class","xaxis")
.attr("transform","translate(0,364)");
var y_scale = d3.scale.linear()
.domain([d3.max(data, function(d) { return d }),0])
.range([54,364])
var …Run Code Online (Sandbox Code Playgroud) 我需要知道如何找到数组的三个最大数字.目前我只能找到最大数量的数组,但我希望有三个最好的数组:
$avg = array();
$avg[20,10,30,50,80,90,220];
echo max($avg);
Run Code Online (Sandbox Code Playgroud)
也许你可以帮我这个?