Problem with colorized chart by parameter

0

Hi everyone,

I am using jaspersoft Studio 6.1.0. I have a report with a chart and chart has hyperlinks which calls report itself with some parameters.

I need to change the clicked part's data label color and non-clicked part's saturation in the report according to parameter.

 

I try to make it with changing data labels color by parameter but it didn't work.

plotOptions.pie.dataLabels.format:

"<span style=\"color:" + $P{param1}=={point.name} ? red : {point.color} + "\"><b>{point.name} </b></span></br><span style=\"color:{point.color}\">{percentage:.2f}%</span>"

My condition gives false all the time because I guess jasperserver replace the tagged part when svg renders the report html.

Is there a way to make this?

Thanks,

zh3ntil's picture
531
Joined: Nov 19 2014 - 11:02pm
Last seen: 3 years 3 months ago

3 Answers:

0

Not sure what you're doing with the <span> tags but creating a chart customizer class will change the color of the label to red. Try googling "jasperreports chart customizer". JasperReports is just using JFreeChart so you'll be able to get more information from that forum too.

hozawa's picture
51118
Joined: Apr 24 2010 - 4:31pm
Last seen: 4 months 1 week ago
0

Thanks for reply hozowa. I am using HTML5 charts (highcharts) in studio. Actually I am trying to make the chart looks like a filter. Selected part color remains (maybe change label color also) and make the other parts colors little pale. With this span tags I manage to make same colors with data labels and point colors. So I try to add a condition but it didn't work. Actually, I don't want to use JFreeCharts instead of highcharts. Any suggestion?

zh3ntil's picture
531
Joined: Nov 19 2014 - 11:02pm
Last seen: 3 years 3 months ago
0

had you look  server configuration to accept javascript function configuration???

Because, you must enable funtion in server side.

http://community.jaspersoft.com/wiki/functions-can-be-used-format-html5-...

and then try follow this:

http://community.jaspersoft.com/blog/customizing-tooltips-jasperreports-...

Regards.

 

 

davidiazcasta's picture
Joined: Mar 18 2015 - 3:18am
Last seen: 3 years 5 months ago
Feedback
randomness