How to draw a shape on the chart
Posted: Fri Feb 22, 2013 4:11 pm
Hello
I want to draw shape orto fill rectangle on the chart.
It is used as limits.
like this :
I am using the android version.
I was able to draw a line :
I was able to draw a rectangle (only the border, I a not able to fill it with a color)
How I can draw a Shape ?
Thank you
I want to draw shape orto fill rectangle on the chart.
It is used as limits.
like this :
I am using the android version.
I was able to draw a line :
Code: Select all
IGraphics3D g = tchart.getGraphics3D();
if (serie!= null)
{
Point pfrom = new Point(serie.calcXPos(0), serie.calcYPosValue(seuilValue));
Point pto = new Point(serie.calcXPos(serie.getCount() - 1), serie.calcYPosValue(seuilValue));
g.getPen().setDashCap(DashCap.SQUARE);
g.getPen().setEndCap(LineCap.MITER);
g.getPen().setStyle(DashStyle.DASH);
g.getPen().setTransparency(70);
g.getPen().setWidth(3);
g.getPen().setColor(Color.red);
g.moveTo(pfrom);
g.lineTo(pto);
Code: Select all
Point pfrom = new Point(serie2.calcXPos(0), serie2.calcYPosValue(0));
Point pto = new Point(serie2.calcXPos(serie2.getCount() - 1), serie2.calcYPosValue(serie2.get(values).min));
Dimension d = new Dimension(serie2.calcXPos(serie2.getCount() - 1) - serie2.calcXPos(0), serie2.calcYPosValue(values.get(serie2).min) - serie2.calcYPosValue(0));
com.steema.teechart.Rectangle r = new com.steema.teechart.Rectangle(pfrom, d);
g.getPen().setColor(Color.YELLOW);
g.getPen().setTransparency(70);
g.getBrush().setColor(Color.blue);
g.rectangle(r);
Thank you