Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用pinch 直接报错TypeError: Cannot read property 'get' of undefined #15

Open
ghost opened this issue Aug 31, 2019 · 1 comment
Open

Comments

@ghost
Copy link

ghost commented Aug 31, 2019

拷贝的是官方代码,请帮忙看一下问题。
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() {}
});

@zingx-zhn
Copy link

请问这个问题解决了吗 我也遇到了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant