You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
拷贝的是官方代码,请帮忙看一下问题。
let chart = null;
var data = [];
var step = Math.PI / 4;
for (var x = -25; x < 25; x += step) {
data.push({
x: x,
y: Math.sin(x)
});
}
拷贝的是官方代码,请帮忙看一下问题。
let chart = null;
var data = [];
var step = Math.PI / 4;
for (var x = -25; x < 25; x += step) {
data.push({
x: x,
y: Math.sin(x)
});
}
function initChart(canvas, width, height, F2) {
chart = new F2.Chart({
el: canvas,
width,
height
});
chart.source(data);
chart.axis('x', {
grid: function grid(text) {
if (text == 0) {
return {
lineDash: null
};
}
}
});
chart.axis('y', {
grid: function grid(text) {
if (text == 0) {
return {
lineDash: null
};
}
}
});
chart.tooltip(false);
chart.interaction('pan', {
limitRange: {
x: {
min: -100,
max: 100
}
}
});
chart.interaction('pinch', {
maxScale: 5,
minScale: 1
});
chart.line().position('x*y').shape('smooth');
chart.render();
return chart;
}
Page({
onShareAppMessage: function(res) {
return {
title: 'F2 微信小程序图表组件,你值得拥有~',
path: '/pages/index/index',
success: function() {},
fail: function() {}
}
},
data: {
opts: {
onInit: initChart
}
},
onReady() {}
});
The text was updated successfully, but these errors were encountered: