ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  XY line chart with only one point does not draw any point at all
Posted by schwarzenegger on Nov-01-2012 11:11
XY line chart with only one point does not draw any point at all,
when there are next point in data , XY line chart shows.

  Re: XY line chart with only one point does not draw any point at all
Posted by Peter Kwan on Nov-01-2012 14:43
Hi schwarzenegger,

This is normal. It is because you need at least 2 points to draw a line.

If you have only one point, you may consider to add data symbols for the points. See the "Symbol Line Chart" and "Symbol Line Chart (2)" sample code. With data symbols, even if the line is not visible for one data point, the symbol is still visible.

If you do not want to display data symbols, or you want to display data symbols only if there is one point, you can do something like (as I am not sure of your programming language, I just use Java as an example):

//The usual line layer
LineLayer layer = c.addLineLayer(myData, .......).

//Add data symbol if there is only 1 point
if (myData.length < 2)
    layer.getDataSet(0).setDataSymbol(ChartDirector::CircleSymbol, 9);

Hope this can help.

Regards
Peter Kwan

  Re: XY line chart with only one point does not draw any point at all
Posted by schwarzenegger on Nov-03-2012 07:47
thank you,I got it.