Coder Social home page Coder Social logo

Comments (13)

simaQ avatar simaQ commented on September 28, 2024

恩,这个报错信息是 F2 抛出的,你能否把能复现这个错误信息的代码(包括数据)贴给偶? 我定位下~~~

from wx-f2.

LeeeMooo avatar LeeeMooo commented on September 28, 2024

demo.zip
代码打包了, 数据里面有一部分

from wx-f2.

simaQ avatar simaQ commented on September 28, 2024

奇怪咧,你的demo 我都没有报错。。。 你看下你的 F2 版本号是多少?

另外,如果是时间类型的数据的话,我建议使用时间戳或者完整的格式 'YYYY-MM-DD HH:mm:ss',然后在使用 chart.source() 那里声明下 type: 'timeCat'

from wx-f2.

LeeeMooo avatar LeeeMooo commented on September 28, 2024

我直接pull了一遍,F2应该是最新的

情况是这样的, 这个表需要的数据是数据库当天的所有数据, 原来的操作是描点连线就完事了类似于这种 连续曲线图

但现在需求是没有数据的地方不连线,就是断层图, 但数据库里面的数据不是连续的(比如说上一个数据时间是2018-06-01 11:55:00, 下一个可能是2018-06-01 15:55:00),这两个点就不能连线

我想到的办法是前端手动填充数据,2018-06-01 11:55:00 + 1min ---> 2018-06-01 15:55:00(数据都设置为整点, 如果以秒级为单位的话, 数据填充量太大了) 这中间的value = null 这样就绘出断层图了
(这样描述应该很清晰了吧)

但是为什么报错了呢... 应该和前面的曲线图是一样的啊 就是多了一些空数据

你是模拟器点击预览也没报错吗?(小声)

或者有没有什么好的办法 不填充空数据绘制断层图的_(:з」∠)_

from wx-f2.

simaQ avatar simaQ commented on September 28, 2024

我真机以及预览都看了,么有报错。你的思路是没有问题的。

你把你处理后的数据给我吧,就是能够产生这个报错的问题的代码和数据,如果有啥不方便的,你把数据字段啥的改改,这样偶才好定位~~~~

from wx-f2.

LeeeMooo avatar LeeeMooo commented on September 28, 2024

demo.zip

from wx-f2.

simaQ avatar simaQ commented on September 28, 2024

找到原因了,如果传进来的数据 value 字段全部是 null 就会导致这个问题。比如:

var data = [
   { type: "湿度/%", value: null, date: "2018-06-01 11:09:00" },
   { type: "温度/℃", value: null, date: "2018-06-01 11:09:00" }
];

是 F2 内部在数据处理模块没有处理好,我马上修复一下,感谢反馈!!!!

from wx-f2.

LeeeMooo avatar LeeeMooo commented on September 28, 2024

找到问题就好!!!!

from wx-f2.

simaQ avatar simaQ commented on September 28, 2024

在 @antv/[email protected] 这个版本里面修复了,你可以 download 更新一下 f2-canvas/lib 下的 f2.js

from wx-f2.

simaQ avatar simaQ commented on September 28, 2024

from wx-f2.

simaQ avatar simaQ commented on September 28, 2024

from wx-f2.

LeeeMooo avatar LeeeMooo commented on September 28, 2024

不是啊 数据是正常中间穿插着null,这样才能画出断层图呀,全是null就没有绘图的必要了

from wx-f2.

simaQ avatar simaQ commented on September 28, 2024

当你的 Y 轴数据全是 null 的时候就会出现你截图的情况,所以我在想是不是传给 chart 对象的源数据的问题,你调试下看看调用到 chart.source(data) 的时候,data 是什么样的吧。

from wx-f2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.