cancel
Showing results for 
Search instead for 
Did you mean: 

Y Axis label color inherits Pen color and not the default Label color.

Former Member
0 Kudos

Hi,

How do I enforce my Y Axis Label to taken the default color specified in the iChart Y-Axis Label Color property instead of picking it from the Pen color selected from the legend? I have a Y-Axis Label called "Total Stock", I can very well change the Label text using method

document.TestChart.getChartObject().setYAxisLabel("Label from code");

But when I use a similar

document.TestChart.getChartObject().setYAxisLabelColor(Color);

property, I dont see the color change on the screen. But when I get the color using a getYAxisLabelColor() method , the specified input Color is set. My Label in the Y-Axis, always inherits the Pen color of the selected Legend Item, by default the first Item color on Page Load.

Settings done in the iChart:

Use Selected Pen for label : Unchecked

Y Axis Label Color: #000000

Y Axis Label : Total Stock

Show Y Axis Label: Checked.

I appreciate your help,

Ajitha

Accepted Solutions (0)

Answers (1)

Answers (1)

jcgood25
Active Contributor
0 Kudos

Make sure you are passing a color object into the method, and not an HTML color code string. The applets have a createColor method that will take a #XXXXXX code and create the color object necessary for methods expecting a color. There are some methods for assigning color that end with ...AsString(XXXXX) which do not require a color object, but direct assigments to display template color properties will need the object, not the color string.

Former Member
0 Kudos

Jeremy,

I tried the method you mentioned...

document.TestChart.getChartObject().setYAxisLabelColor(document.TestChart.createColor("#000000"));

But I still dont see a change in the Label color.

Another finding is, when I try to alert the Label color on load of the page or during the creation of the applet, I see the label color on the alert is not the pen1color but the default Label color that is set in the display template. I assume that the legend's default selection, overwrites the Label color with the first pen color, but I could not get it with the getYAxisLabelColor() method, even though I see it on the screen.

Thanks!

Ajitha

jcgood25
Active Contributor
0 Kudos

The settings you are using appear to be working correctly, but it looks like the new Y-Axis label text does not follow the same behavior as the Y-Axis scale. So the Y-Axis numbers will follow the selected pen color, or stay fixed on a common color, but the Y-Axis label text does not mirror this behavior.

My suggestion would be to raise a support ticket.