Jump to content
Changes to the Jaspersoft community edition download ×

Problem with colorized chart by parameter


zh3ntil

Recommended Posts

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.

chart_1.png.6e47a56546d486fbd8eaa5a6d23aef83.png

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

chart_2.png.1851bdc178002feea7135c19912a96fa.png

 

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,

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted Images

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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-datalabels-and-tooltips

and then try follow this:

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

Regards.

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...