Sunday, February 27, 2011

APEX 4 (bug) - Font Grid Label in Charts

For a chart you can define the fonts and colors you want to use for the different components (mostly text) on the chart. This works great except for the Grid Label. It seems that that value never gets stored when you change it.

I thought if I wanted to change the grid lines of the chart I could change the Grid Label settings. I'm not sure why Label is specified after Grid and not Line, as I'm not aware of labels against the grid. It seems that currently there is a hardcoded value of "Black" against the line color of the X axis grid and nothing for the Y axis grid (so default of AnyChart).

Again the workaround is simple if you want to have a different line colors of the grid (X / Y Axis), you can just change it in the XML after you specified Custom XML = Yes.

The chart looks like this after doing the above change:

(Found in APEX


Hilary Farrell said...

Hi Dimitri,

The fact that the "Grid Label" option is visible in APEX 4.0 is the actual bug. In APEX charts there has never been an option exposed via the UI to change the grid line colours. In previous APEX releases, the 'Grid Label' option settings control the font size and colour of the X & Y axis labels, thus the 'Grid Label' name. However, with APEX 4.0, separate "X Axis Labels" and "Y Axis Labels" items were introduced to allow for the setting of their associated item font size and colour. The 'Grid Label' items should actually be removed, and I'll ensure that they are removed for our next release, to avoid any such confusion. In the meantime, if you do wish to apply a specific colour to the lines of a grid, then Custom XML will need to be used.


Dimitri Gielis said...

Verified on APEX 4.1 EA and the Grid Label was removed.

Nivetha said...

Hi Dimitri,

Can we fill the grid with different colors based on the scale?
Iam using APEX 5 scatter chart, with plotted points. Now I need to fill the grid with different colors based on the scales.
Can you please suggest me some ideas?
Iam using APEX 5, Universal Theme.

Thanks & Regards,

Dimitri Gielis said...

Hi Nivetha,

You could use a substitution string which contains the color.
e.g. &P1_GRID_COLOR. (this would be an item on page 1 - which you give the value of Red, Green etc.)

In the XML of the chart instead of Red you put &P1_GRID_COLOR.

Hope that helps,

Anonymous said...

Hi Dimitri,

Thanks for the reply.

No What Iam asking is not the line color , Am asking about the color.
i.e each box in the scatter chart should be colored based on the scales.
This is something like colors on the heat maps and scales and plots like scatter chart.

I used this below code:

in custom xml

Please refer the below URL:

Iam getting the entire data plot boxes color filled with green color. I need each box to be filled with this different colors based on scales.

Thanks & Regards,

Dimitri Gielis said...

Hi Nivetha,

I've not done that yet for that chart type, but you could try different options, but it would be with manual changing the XML of the chart:

I've used before, but not sure it will work with this chart type.

There's also data_plot_background (see xml: charts - chart - chart_settings)

Hope one of those will work for you,

nive tipo said...

Hi Dimitri,

Yeah the second one is what I exactly want.
Thank you so much, I will give a try on that.
As of now I just gave background image on data plot background like each box filled with colors and it works.
But that's not the solution, so I will try by using the XML of Anychart 2D column chart in the link provided by you.

Thanks & Regards,