How to add a 3rd variable color to a bar chart

Can anyone tell me whats wrong with my code im uploading a zip file of the code. Thanks in advance

I Initially trying to set the color for the 3rd variable I created for the chart

The 3rd bar is displaying but the the color is coming from the backend which i need to set.

It tells me stroke is undefined and invalid property value

jswork.zip (12.5 KB)

This isn’t initialized?

pod.data.summaryData[k].fScore3_color

What must I do to initialized it

I don’t know. Where do the other colors get initialized? fscore_color and fscore2_color? There must be more code there than this…

Im gona upload and zip the full code

I did upload all the code

OK, so where does pod come from? That’s where the colors are defined…

The pods create the charts

The variable gets initialized like this - var color3 = pod.data.summaryData[l].fScore3_color;

im just curious to know why its not working because I dont see a error in my code but it says stroke is undefined invalid property value I dont really know what it means

You’re missing my point - it’s not color3 that’s not getting initialized, it’s pod.data.summaryData[i].fScore3_color

My guess is the generated code ends up looking something like this (guessing what the value of i and the grahpcolors[k] is):

/*contentStyle += "#Chart_Pie_3_" + i + " .ct-series-" + grahpcolors[k] + " .ct-slice-donut { stroke: #" + colors[2][k] + " } "; */
#Chart_Pie_3_1 .ct-series-x .ct-slice-donut { stroke: # } 

I got it working thanks my try catch was not in the for loop

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.