Recent

Author Topic: [SOLVED] LineSeries with breaks  (Read 3405 times)

Vittorio

  • New Member
  • *
  • Posts: 32
[SOLVED] LineSeries with breaks
« on: October 23, 2017, 10:29:26 pm »
I'm looking for solution to draw noncontinuous graphs.
For example, array of {1,7,*,11,13} should look like in Excel (see attachment)
Would be gratefull for idea how to realize it with TChart.
« Last Edit: October 24, 2017, 01:25:28 pm by Vittorio »

wp

  • Hero Member
  • *****
  • Posts: 11916
Re: LineSeries with breaks
« Reply #1 on: October 24, 2017, 12:15:20 am »
You must add NaN ("not a number", defined in unit Math) as X or Y value (http://wiki.lazarus.freepascal.org/TAChart_documentation#Skipping_source_items).

Code: Pascal  [Select][+][-]
  1. uses
  2.   Math;
  3.  
  4. with Chart1LineSeries1 do begin
  5.   Add(1);
  6.   Add(7);
  7.   Add(NaN);
  8.   Add(11);
  9.   Add(13);
  10.  
  11. //or:
  12.   AddXY(1, 1);
  13.   AddXY(2, 7);
  14.   AddXY(3, NaN);  // or: AddXY(NaN, NaN);
  15.   AddXY(4, 11);
  16.   AddXY(5, 13);
  17. end;
« Last Edit: October 24, 2017, 01:42:30 pm by wp »

Vittorio

  • New Member
  • *
  • Posts: 32
Re: LineSeries with breaks
« Reply #2 on: October 24, 2017, 01:24:58 pm »
Perfect! That's it I'm looking for. Thanks!

 

TinyPortal © 2005-2018