Page 1 of 1

Vertical constant lines

Posted: Thu Aug 28, 2014 8:58 am
by jrvdboom
I would like to have a vertical ConstantLine, with a property like Band.Binding to determine if it should be a horizontal or vertical line.

(I know I could misuse a Cursor to get a vertical constant line, but I like to keep it simple!)

Thanks,
Joost

Re: Vertical constant lines

Posted: Tue May 31, 2016 2:15 pm
by 0uss
Hi,

I'm interested in the same thing. Did you find a solution to your problem?
I would like to use a simple ConstantLine with some text and no need for all the cursors features in my application.

Thank you.

Re: Vertical constant lines

Posted: Wed Jun 01, 2016 7:28 am
by jrvdboom
No, still using a LineSeriesCursor as a workaround.

Re: Vertical constant lines

Posted: Fri Aug 03, 2018 3:05 pm
by ArctionNitin
Hi,

You can create a LineCollection with 1 SegmentLine in it.

Vertical line at x= 1 from y= 1 to y = 5
LineCollection lineCollection = new LineCollection();
SegmentLine[] segmentLines = new SegmentLine[1];
SegmentLine segmentLine = new SegmentLine();
segmentLine.AX = 1;
segmentLine.BX = 1;
segmentLine.AY = 1;
segmentLine.BY = 5;
segmentLines[0] = segmentLine;
lineCollection.Lines = segmentLines;
chart.ViewXY.LineCollections.Add(lineCollection);

To add more lines, just add more SegmentLine's in the LineCollection.

Let me know if the requirement was different.


Thanks,
Nitin Shrivastava