Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions pages/treemap/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ function initChart(canvas, width, height, dpr) {
devicePixelRatio: dpr // new
});
canvas.setChart(chart);
var data = [];
const data = [];

for (var i = 0; i <= 360; i++) {
var t = i / 180 * Math.PI;
var r = Math.sin(2 * t) * Math.cos(2 * t);
for (const i = 0; i <= 360; i++) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

循环里面怎么会是 const

const t = i / 180 * Math.PI;
const r = Math.sin(2 * t) * Math.cos(2 * t);
data.push([r, i]);
}

var option = {
const option = {
title: {
text: '2014年中国耕地质量',
left: 'center',
Expand Down Expand Up @@ -180,4 +180,4 @@ Page({
},

onReady() { }
});
});