Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Gk0Wk committed Oct 23, 2023
1 parent 0411e50 commit d63497f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/echarts/addons/Gk0Wk/Function/Function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ const addon: IScriptAddon<void> = {
// 采样
const points = [];
const step = (maxX - minX) / Math.min(resolution, 1e5);
for (let x = minX; x <= maxX; x += step) {
const y = func(x);
points.push([x, y]);
for (let i = 0, x = minX; i < resolution; i += 1, x += step) {
points.push([x, func(x)]);
}
points.push([maxX, func(maxX)]);

// 画图
myChart.setOption({
animation: false,
grid: {
Expand Down
2 changes: 1 addition & 1 deletion src/echarts/plugin.info
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.2.10",
"version": "0.2.11",
"type": "application/json",
"title": "$:/plugins/Gk0Wk/echarts",
"plugin-type": "plugin",
Expand Down

0 comments on commit d63497f

Please sign in to comment.