Jump to content
We've recently updated our Privacy Statement, available here ×

Display integer values ​​on the y axis


vctlzac

Recommended Posts

Hello everyone,
I'm trying a way to display only integer values ​​on the y axis (value), but I can not. The change should not be to round values ​​(mask value in #.###) but allowing display only integer values in axis value.

Thanks.

Link to comment
Share on other sites

  • Replies 8
  • Created
  • Last Reply

Top Posters In This Topic

Hi,

Another posibility is to use custom properties. There are 2 configuration properties in JR which allow the user to set the desired tick interval on the range (or domain) axis:

net.sf.jasperreports.chart.range.axis.tick.interval  and
net.sf.jasperreports.chart.domain.axis.tick.interval

For your needs, you could combine the tickLabelMask effect with the net.sf.jasperreports.chart.range.axis.tick.interval property, and it should work.

Hope this helps,
sanda

Code:
<barChart><chart ...>  <reportElement ...>    <property name="net.sf.jasperreports.chart.range.axis.tick.interval" value="1"/>  </reportElement>  ...</chart>...<barPlot isShowTickLabels="true">  ...  <valueAxisFormat>    <axisFormat tickLabelMask="#,##0">    ...    </axisFormat>  </valueAxisFormat></barPlot></barChart>
Link to comment
Share on other sites

  • 2 years later...
  • 4 years later...

I had the same issue with Stacked Bar Chart. Mine is Jasper Community Editionn 6.2.1.

Able to fix the issue by using below property in <reportElement>

<property name="net.sf.jasperreports.chart.range.axis.tick.interval" value="1"/>

my source code snippet

<stackedBarChart>
                <chart evaluationTime="Report">
                    <reportElement x="3" y="4" width="547" height="310" uuid="437a72b9-4d07-40de-8497-358e8d904795">
                        <property name="com.jaspersoft.studio.unit.width" value="pixel"/>
                        <property name="com.jaspersoft.studio.unit.height" value="pixel"/>
                        <property name="net.sf.jasperreports.chart.range.axis.tick.interval" value="1"/>
                    </reportElement>

 

Hope this helps

Link to comment
Share on other sites

  • 1 year later...

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...