在 TDBChart 的ProcessRecord事件中写如下代码: if varisnull(dataset.fieldvalues['field1']) then raise Exception.create('Abort'); 这样就可以不添加这个点了,不过需要额外在处理一下这个异常 但是,根据帮助中写的: You can raise an Abort silent exception in this event to notify TDBChart to stop retrieving records and to NOT add the current record point.这个silent exception如何做到,目前还没试出来
找到了,这么写即可: if varisnull(dataset.fieldvalues['field1']) then Abort;
if varisnull(dataset.fieldvalues['field1']) then
raise Exception.create('Abort');
这样就可以不添加这个点了,不过需要额外在处理一下这个异常
但是,根据帮助中写的:
You can raise an Abort silent exception in this event to notify TDBChart to stop retrieving records and to NOT add the current record point.这个silent exception如何做到,目前还没试出来
if varisnull(dataset.fieldvalues['field1']) then
Abort;
abort
是停止添加点,如果空值出现在记录中间(非最后一条),那么他将停止添加空值以后的记录到Chart上,而不是忽略空值的记录,继续添加以后的记录到chart上