I need help with custom chart drawing. What I have now: Bars show count of sold goods and red triangle shows target count. Code looks like this:
Code: Select all
chart.addChartPaintListener(new ChartPaintAdapter() {
@Override
public void chartPainted(ChartDrawEvent chartDrawEvent) {
final int target = 300;
IGraphics3D graphics = holder.chart.getGraphics3D();
graphics.getPen().setColor(Color.black);
graphics.getBrush().setColor(Color.red);
Point point0 = new Point(target+10, graphics.getYCenter()*2);
Point point1 = new Point(target-10, graphics.getYCenter()*2);
Point point2 = new Point(target, graphics.getYCenter()*2 - 20);
graphics.triangle(point0, point1, point2, 0);
}
});
Also Y coordinate of triangle base is not correct to. How to put it exactly on X axis?
Thank you and best regards.