Change Value Marker Label Shape

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
merto
Posts: 2
Joined: Mon Aug 15, 2016 1:40 pm
antibot: No, of course not.

Change Value Marker Label Shape

Post by merto » Mon Aug 15, 2016 1:46 pm

Hi,

I currently use the default value marker labels in my chart and I will like to make them look like the tags in google finance (refrence: https://www.google.com/finance?q=google ... fRU_vDvPAD)
This is my code:

Code: Select all

 Marker target = new ValueMarker(((double) event.getDate()) * 1000);
            target.setStroke(EVENT_STROKE);
            target.setPaint(EVENT_COLOR);
            target.setLabelPaint(TITLE_COLOR);
            target.setLabel(Character.toString((char) i++) + "(" + event.getTotalEvents() + ")");
            target.setLabelFont(font);
            target.setLabelAnchor(RectangleAnchor.BOTTOM_RIGHT);
            target.setLabelTextAnchor(TextAnchor.BOTTOM_LEFT);
            xyPlot.addDomainMarker(target);
Thanks

paradoxoff
Posts: 1634
Joined: Sat Feb 17, 2007 1:51 pm

Re: Change Value Marker Label Shape

Post by paradoxoff » Tue Aug 16, 2016 7:36 pm

Markers do not support the drawing of shapes. A while ago, I have written a set of annotations than can be used as marker replacements. You could use one of those as starting point to add shape support.

merto
Posts: 2
Joined: Mon Aug 15, 2016 1:40 pm
antibot: No, of course not.

Re: Change Value Marker Label Shape

Post by merto » Sun Aug 21, 2016 9:13 am

Awesome, thanks!!!

Locked