Saturday, February 26, 2011

APEX 4 (bug) - Add marker to your chart

It seems to me that in APEX 4.0.2.00.07 (and probably entire 4.0, but can't check at the moment) there's a bug with adding markers to your (bar/column) chart. For a Pie chart it works fine.

If you edit your Chart Attributes you can define a Marker in the Display Settings.



However when you run the page and look at the chart there is no Marker to see.

If you need Markers, there are two workarounds at the moment:

- customise the XML (my preferred option): you set Custom XML in the Chart Attributes to Yes and you change the marker section to the marker you want. You will see marker type="None", but you can easily change that. Below I changed it to Cross, to have a cross marker.

- add another Series in the chart of type Marker, but this is not my preferred option because you lose performance as it will need to run the query twice.

When you run the page after you changed the XML, the chart with the marker looks like this (see the cross on top of the bar):


I'm sure the APEX development team will fix it soon, but for now you know a workaround.

2 comments:

Hilary Farrell said...

Hi Dimitri,

The behaviour you have reported, with Markers on Bar/Columns chart series in APEX 4.0 is expected behaviour. The use of markers on charts would be more commonly used with Line and Marker series, so a decision was made to apply marker setting to Line and Marker series chart, and Pie charts, but not to Bar/Column chart series. This is certainly something that we can address in a future release, if the inclusion of markers on Bar/Columns series is something that customers would like to be able to do.

Regards,
Hilary

Dimitri Gielis said...

Hi Hilary,

Thanks for your note. I think it would be nice to add, but you are right that in most cases you probably want to use it with a line or pie chart, but in this case I wanted to use the Marker.
If you decide to not include it in the next version of APEX I would prefer to not be able to select the Marker from the drop-down list for chart types that don't support them.

Thanks,
Dimitri