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

TimeSeries Chart display 24 Hour format along X axis


sandeeppant

Recommended Posts

Hi,

We have a requirement where in TimeSeries graph we need to show Time Series (X -Axis) in AM/PM format. By default it shows time in 24 hour format.

Is there a way we can customize the X-axis to AM/PM?

Code:
<?xml version="1.0" encoding="UTF-8"?><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="report2" pageWidth="800" pageHeight="400" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">	<property name="ireport.zoom" value="1.0"/>	<property name="ireport.x" value="0"/>	<property name="ireport.y" value="0"/>	<queryString>		<![CDATA[select * from salestimeseries]]>	</queryString>	<field name="the_month" class="java.sql.Timestamp"/>	<field name="units_sold" class="java.lang.Long"/>	<field name="the_month1" class="java.sql.Timestamp"/>	<field name="units_sold1" class="java.lang.Long"/>	<background>		<band splitType="Stretch"/>	</background>	<title>		<band height="200" splitType="Stretch">			<timeSeriesChart>				<chart isShowLegend="false" evaluationTime="Report">					<reportElement isPrintRepeatedValues="false" x="81" y="38" width="659" height="100">						<property name="net.sf.jasperreports.chart.domain.axis.tick.count" value="24"/>					</reportElement>					<chartTitle/>					<chartSubtitle/>					<chartLegend/>				</chart>				<timeSeriesDataset timePeriod="Hour">					<timeSeries>						<seriesExpression><![CDATA["InterConnect"]]></seriesExpression>						<timePeriodExpression><![CDATA[$F{the_month}]]></timePeriodExpression>						<valueExpression><![CDATA[$F{units_sold}]]></valueExpression>					</timeSeries>					<timeSeries>						<seriesExpression><![CDATA["Local"]]></seriesExpression>						<timePeriodExpression><![CDATA[$F{the_month1}]]></timePeriodExpression>						<valueExpression><![CDATA[$F{units_sold1}]]></valueExpression>					</timeSeries>				</timeSeriesDataset>				<timeSeriesPlot isShowLines="true" isShowShapes="false">					<plot/>				</timeSeriesPlot>			</timeSeriesChart>		</band>	</title></jasperReport>
Link to comment
Share on other sites

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

Top Posters In This Topic

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