Jump to content

How to use colorAxis.DataClasses property of Highcharts in JRXML


Recommended Posts

Currently I am doing like this
<hc:chartProperty name="colorAxis.dataClasses">
<hc:propertyExpression><![CDATA[java.util.Arrays.asList (

And then I am setting this property

<hc:chartProperty name="colors">
                                             "#FFFFFF", "#4A90E2","#6FA7E8","#93BDEE",
and then 
<hc:chartProperty name="colorAxis.dataClassColor">
So that it takes the color which I have defined. The error I am getting is that,
  1. The legend does not displays like >0, 0-20 and so on as shown in the following fiddle  http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/maps/demo/data-class-ranges/
  2. I am justting getting colors followed by <
  3. The heat map picks up only the last color no matter what data is there in the cell.

I have already used color stops but we have specific requirement of dataclasses.

Please let me know how to use them in JRXML

I am using Jaspersoft Studio version 6


Link to comment
Share on other sites

  • 2 weeks later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Use the Function Return to send multiple parameters into an expected JSON for highcharts. The list array is fine with only a single parameter with multiple values, but here you need multiple parameters answered:


<hc:chartProperty name="colorAxis.dataClasses">
<hc:propertyExpression><![CDATA["function(){return [{to: 0, color: '#FFFFFF', name: 'Missing Data'},{from: 0, to: 20, color: '#4A90E2', name: 'From 0 to 20%'},{from: 20, to: 40, color: '#6FA7E8', name: 'From 20% to 40%'},{from: 40, to: 60, color: '#93BDEE', name: 'From 40% to 60%'},{from: 60, to: 90, color: '#B7D3F4', name: 'From 60% to 90%'},{from: 90, color: '#DBE9FA', name: 'From 90% to 100%'}]}()"]]></hc:propertyExpression>
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...