mpcalias Posted January 21, 2019 Share Posted January 21, 2019 I am drafting a report which I have in excel and have a question regarding a bar chart and the "axis crosses".In the database I have a result and a min and a max (this goes from -20 to 30). When I plot the chart I want the chart to start at the min value rather than 0 - so basically filling the chart from the left hand side. I've looked at the chart options but can not see anything which gives anything similar in Jasper.Is this possible? Link to comment Share on other sites More sharing options...
akovach Posted January 21, 2019 Share Posted January 21, 2019 Hello, the Axis values are set according to data in category and measures. However, you can set a point start on Axis with plotOptions.series.pointStart property in chart:https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/series-pointstart-linear/ Link to comment Share on other sites More sharing options...
mpcalias Posted January 22, 2019 Author Share Posted January 22, 2019 Thanks for your reply - but I am having a problem working out where to put this!( I am new to Jasper :) ) I have created a simple chart (see below) - any help would be appreicated :) In this case the result is -10 and so the result should go from -20 to -10<?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.6.0.final using JasperReports Library version 6.6.0 --><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="88" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="470229fb-8e0e-41bd-b611-7340eb6a0416"> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="ExcelSheet"/> <queryString><![CDATA[]]</queryString> <field name="Name" class="java.lang.String"/> <field name="Result" class="java.math.BigDecimal"/> <field name="High" class="java.math.BigDecimal"/> <field name="Low" class="java.math.BigDecimal"/> <background><band splitType="Stretch"/></background> <detail> <band height="318" splitType="Stretch"> <textField> <reportElement x="140" y="20" width="100" height="30" uuid="e4530796-6112-46a3-8794-cee148dc7663"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="5d178f2a-78fc-4d0a-b8f9-6e852005e7c0"/> </reportElement> <textFieldExpression><![CDATA[$F{Result}]]></textFieldExpression> </textField> <textField> <reportElement x="43" y="20" width="100" height="30" uuid="6db7a9ec-c700-4e04-bb7e-6a08dd457046"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="3a32933a-e24e-4ea4-ad1f-9aac07178e22"/> </reportElement> <textFieldExpression><![CDATA[$F{Name}]]></textFieldExpression> </textField> <textField> <reportElement x="240" y="20" width="100" height="30" uuid="e36361d0-b428-4725-99fb-3be9ea735ecc"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="1a25ea91-6b53-4727-bb70-80e3509ecbe7"/> </reportElement> <textFieldExpression><![CDATA[$F{High}]]></textFieldExpression> </textField> <textField> <reportElement x="340" y="20" width="100" height="30" uuid="11d4a03f-1a06-46ad-ba06-ee8af1b4a31a"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="35997dfe-6e05-4cc0-a138-e73e69ade330"/> </reportElement> <textFieldExpression><![CDATA[$F{Low}]]></textFieldExpression> </textField> <barChart> <chart evaluationTime="Report"> <reportElement x="110" y="80" width="350" height="120" uuid="efa8a585-6b16-4625-8110-74669c4de20c"/> <chartTitle/> <chartSubtitle/> <chartLegend/> </chart> <categoryDataset> <categorySeries> <seriesExpression><![CDATA["SERIES 1"]]></seriesExpression> <categoryExpression><![CDATA[$F{Name}]]></categoryExpression> <valueExpression><![CDATA[$F{Result}]]></valueExpression> </categorySeries> </categoryDataset> <barPlot> <plot orientation="Horizontal"/> <itemLabel/> <categoryAxisFormat> <axisFormat labelColor="#000000" tickLabelColor="#000000" axisLineColor="#000000"/> </categoryAxisFormat> <valueAxisFormat> <axisFormat labelColor="#000000" tickLabelColor="#000000" axisLineColor="#000000"/> </valueAxisFormat> <rangeAxisMinValueExpression> <![CDATA[$F{Low}]]> </rangeAxisMinValueExpression> <rangeAxisMaxValueExpression> <![CDATA[$F{High}]]> </rangeAxisMaxValueExpression> </barPlot> </barChart> </band> </detail></jasperReport> 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