0

Could someone help me truncating the labels on the Highcharts in Jaspersoft Studio?

So following the instructions from this link (How do I format x-axis label in highcharts) I have come up with the below:

<hc:chartProperty name="xAxis.labels.formatter">
    <hc:propertyExpression><![CDATA[function(){return this.value.toString().substring(0, 3)}]]></hc:propertyExpression>
</hc:chartProperty>

However this is causing the report to fail.

Has anyone truncated the labels on a highchart through Studio before? Could you provide an example on how to do this? I'm doing this on a stacked column chart. Any help would be much appreciated.

Community
  • 1
  • 1
lampbob
  • 761
  • 1
  • 7
  • 16

1 Answers1

0

Solved this,

So: 1. In Tools->Options->JasperReports properties add

com.jaspersoft.jasperreports.highcharts.function.properties.allowed

  1. Add quotes to expression

<hc:chartProperty name="xAxis.labels.formatter"> <hc:propertyExpression><![CDATA["function(){return this.value.toString().substring(0,3)}"]]></hc:propertyExpression> </hc:chartProperty>

lampbob
  • 761
  • 1
  • 7
  • 16