detlef.brendle Posted November 11, 2017 Share Posted November 11, 2017 Hi,I would like to render a highcharts pie chart without dataLabels.By checking the highcharts docu, there is a parameter called "plotOptions.pie.dataLabels.enabled". But set this value to false does not hide the dataLabels.My jrxml file looks like this:<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="pie-test" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="f8eee606-dcf6-402d-a6c7-0a3af300e599"> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="local proanalytics"/> <property name="com.jaspersoft.studio.data.sql.tables" value=""/> <queryString> <![CDATA[select sum(anzahl) as views, medium_id as mediumid from materializedviews.ccpush_overall_views where h3_id=1000858 GROUP BY medium_id order by medium_id desc]]> </queryString> <field name="views" class="java.math.BigDecimal"/> <field name="mediumid" class="java.lang.Long"/> <background> <band splitType="Stretch"/> </background> <pageHeader> <band height="433"> <componentElement> <reportElement x="70" y="50" width="400" height="284" uuid="d1403cc6-6670-4422-b32c-03c1079022a8"/> <hc:chart xmlns:hc="http://jaspersoft.com/highcharts" xsi:schemaLocation="http://jaspersoft.com/highcharts http://jaspersoft.com/schema/highcharts.xsd" type="Pie"> <hc:chartSetting name="default"> <hc:chartProperty name="plotOptions.pie.dataLabels.enabled" value="false"/> </hc:chartSetting> <multiAxisData> <multiAxisDataset/> <dataAxis axis="Rows"> <axisLevel name="Level1"> <labelExpression><![CDATA["Level Label expression"]]></labelExpression> <axisLevelBucket order="None" class="java.lang.Comparable"> <bucketExpression><![CDATA[$F{mediumid}]]></bucketExpression> </axisLevelBucket> </axisLevel> </dataAxis> <dataAxis axis="Columns"/> <multiAxisMeasure name="Measure1" class="java.lang.Number" calculation="Nothing"> <labelExpression><![CDATA["!MEASURE LABEL!"]]></labelExpression> <valueExpression><![CDATA[$F{views}]]></valueExpression> </multiAxisMeasure> </multiAxisData> <hc:series name="Measure1"/> </hc:chart> </componentElement> </band> </pageHeader></jasperReport>[/code]Has somebody found a way of doing this ? Thanks,Detlef Link to comment Share on other sites More sharing options...
Solution lucianc Posted November 13, 2017 Solution Share Posted November 13, 2017 Boolean chart property values should be provided as expressions. Values set using the static attribute are passed as strings (and probably converted to booleans using JavaScript rules). <hc:chartProperty name="plotOptions.pie.dataLabels.enabled"> <hc:propertyExpression>false</hc:propertyExpression> </hc:chartProperty>[/code]Regards,Lucian Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now