Bar Chart Preview mode error

Hi, i am using bar chart in report… i am getting this error when i change to preview mode

13:05:10.753 [AWT-EventQueue-0] WARN reporting.CategoryChart - Unable to run chart customization function.
org.python.core.PySyntaxError: SyntaxError: ("mismatched input '<EOF>' expecting INDENT", ('<function:configureChart>', 1, 32, 'def configureChart(data, chart):\n'))

	at org.python.core.ParserFacade.fixParseError(ParserFacade.java:95)
	at org.python.core.ParserFacade.parse(ParserFacade.java:205)
	at org.python.core.Py.compile_flags(Py.java:2205)
	at com.inductiveautomation.ignition.common.script.ScriptManager.compileFunction(ScriptManager.java:899)
	at com.inductiveautomation.ignition.common.script.ScriptManager.compileFunction(ScriptManager.java:880)
	at com.inductiveautomation.rm.shape.j2dshapes.CategoryChart.render(CategoryChart.java:389)
	at com.inductiveautomation.rm.shape.j2dshapes.AbstractJ2DShape.getDisplayedFill(AbstractJ2DShape.java:76)
	at com.inductiveautomation.rm.shape.RMShape.paintShape(RMShape.java:3107)
	at com.inductiveautomation.rm.shape.j2dshapes.AbstractJ2DShape.paintShape(AbstractJ2DShape.java:101)
	at com.inductiveautomation.rm.shape.RMShapePainterJ2D.sendPaintShape(RMShapePainterJ2D.java:243)
	at com.inductiveautomation.rm.shape.RMShape.paintShapeAll(RMShape.java:3080)
	at com.inductiveautomation.rm.shape.RMShape.paint(RMShape.java:3059)
	at com.inductiveautomation.rm.shape.RMShape.paintShapeChildren(RMShape.java:3123)
	at com.inductiveautomation.rm.shape.RMShape.paintShapeAll(RMShape.java:3091)
	at com.inductiveautomation.rm.shape.RMShape.paint(RMShape.java:3059)
	at com.inductiveautomation.rm.shape.RMShape.paintShapeChildren(RMShape.java:3123)
	at com.inductiveautomation.rm.shape.RMShape.paintShapeAll(RMShape.java:3091)
	at com.inductiveautomation.rm.shape.RMShape.paint(RMShape.java:3059)
	at com.inductiveautomation.rm.shape.RMShape.paintShapeChildren(RMShape.java:3123)
	at com.inductiveautomation.rm.shape.RMShape.paintShapeAll(RMShape.java:3091)
	at com.inductiveautomation.rm.shape.RMShape.paint(RMShape.java:3059)
	at com.inductiveautomation.rm.viewer.RMViewerShape.paint(RMViewerShape.java:197)
	at com.inductiveautomation.rm.shape.RMShapePainterJ2D.paintShape(RMShapePainterJ2D.java:231)
	at com.inductiveautomation.rm.viewer.RMViewer.paintComponent(RMViewer.java:837)
	at java.desktop/javax.swing.JComponent.paint(Unknown Source)
	at java.desktop/javax.swing.JComponent.paintChildren(Unknown Source)
	at java.desktop/javax.swing.JComponent.paint(Unknown Source)
	at java.desktop/javax.swing.JViewport.paint(Unknown Source)
	at java.desktop/javax.swing.JComponent.paintChildren(Unknown Source)
	at java.desktop/javax.swing.JComponent.paint(Unknown Source)
	at java.desktop/javax.swing.JComponent.paintChildren(Unknown Source)
	at java.desktop/javax.swing.JComponent.paint(Unknown Source)
	at java.desktop/javax.swing.JComponent.paintChildren(Unknown Source)
	at java.desktop/javax.swing.JComponent.paint(Unknown Source)
	at java.desktop/javax.swing.JComponent.paintChildren(Unknown Source)
	at java.desktop/javax.swing.JComponent.paint(Unknown Source)
	at java.desktop/javax.swing.JComponent.paintToOffscreen(Unknown Source)
	at java.desktop/javax.swing.RepaintManager$PaintManager.paintDoubleBufferedImpl(Unknown Source)
	at java.desktop/javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source)
	at java.desktop/javax.swing.RepaintManager$PaintManager.paint(Unknown Source)
	at java.desktop/javax.swing.RepaintManager.paint(Unknown Source)
	at java.desktop/javax.swing.JComponent._paintImmediately(Unknown Source)
	at java.desktop/javax.swing.JComponent.paintImmediately(Unknown Source)
	at java.desktop/javax.swing.RepaintManager$4.run(Unknown Source)
	at java.desktop/javax.swing.RepaintManager$4.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
	at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
	at java.desktop/javax.swing.RepaintManager.prePaintDirtyRegions(Unknown Source)
	at java.desktop/javax.swing.RepaintManager$ProcessingRunnable.run(Unknown Source)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
	at com.inductiveautomation.snap.swing.RibsEventQueue.dispatchEvent(RibsEventQueue.java:99)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)
13:05:10.748 [SwingWorker-pool-1-thread-1] WARN reporting.CategoryChart - Unable to run chart customization function.
org.python.core.PySyntaxError: SyntaxError: ("mismatched input '<EOF>' expecting INDENT", ('<function:configureChart>', 1, 32, 'def configureChart(data, chart):\n'))

	at org.python.core.ParserFacade.fixParseError(ParserFacade.java:95)
	at org.python.core.ParserFacade.parse(ParserFacade.java:205)
	at org.python.core.Py.compile_flags(Py.java:2205)
	at com.inductiveautomation.ignition.common.script.ScriptManager.compileFunction(ScriptManager.java:899)
	at com.inductiveautomation.ignition.common.script.ScriptManager.compileFunction(ScriptManager.java:880)
	at com.inductiveautomation.rm.shape.j2dshapes.CategoryChart.render(CategoryChart.java:389)
	at com.inductiveautomation.rm.shape.j2dshapes.AbstractJ2DShape.getDisplayedFill(AbstractJ2DShape.java:76)
	at com.inductiveautomation.rm.shape.RMShape.paintShape(RMShape.java:3107)
	at com.inductiveautomation.rm.shape.j2dshapes.AbstractJ2DShape.paintShape(AbstractJ2DShape.java:101)
	at com.inductiveautomation.rm.shape.RMShapePainterJ2D.sendPaintShape(RMShapePainterJ2D.java:243)
	at com.inductiveautomation.rm.shape.RMShape.paintShapeAll(RMShape.java:3080)
	at com.inductiveautomation.rm.shape.RMShape.paint(RMShape.java:3059)
	at com.inductiveautomation.rm.shape.RMShape.paintShapeChildren(RMShape.java:3123)
	at com.inductiveautomation.rm.shape.RMShape.paintShapeAll(RMShape.java:3091)
	at com.inductiveautomation.rm.shape.RMShape.paint(RMShape.java:3059)
	at com.inductiveautomation.rm.shape.RMShapePainterJ2D.paintShape(RMShapePainterJ2D.java:231)
	at com.inductiveautomation.rm.shape.RMShapeImager.createImage(RMShapeImager.java:98)
	at com.inductiveautomation.reporting.designer.workspace.design.PreviewPanel$SnapshotGenerator.doInBackground(PreviewPanel.java:165)
	at com.inductiveautomation.reporting.designer.workspace.design.PreviewPanel$SnapshotGenerator.doInBackground(PreviewPanel.java:146)
	at java.desktop/javax.swing.SwingWorker$1.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.desktop/javax.swing.SwingWorker.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

xml code

<?xml version="1.0" ?>
<sample-data>
	<!--This is the raw data used to create the report preview.-->
	<Current Time>2021-11-12 13:05:10.500</Current Time>
	<DataSetBarchart>
		<row-0>
			<Date>2021-11-08</Date>
			<Elec_kWhT>31</Elec_kWhT>
			<Gas_kWhT>595</Gas_kWhT>
			<EPI_kWhT>673</EPI_kWhT>
		</row-0>
		<row-1>
			<Date>2021-11-09</Date>
			<Elec_kWhT>41</Elec_kWhT>
			<Gas_kWhT>661</Gas_kWhT>
			<EPI_kWhT>765</EPI_kWhT>
		</row-1>
	</DataSetBarchart>
	<Datasetparameter>
		<row-0>
			<date>2021-11-08</date>
			<gasnm3>23256</gasnm3>
			<electricitykwh>12881</electricitykwh>
			<gaskwh>244768</gaskwh>
			<productionm2>411</productionm2>
			<eleckwhm2>31</eleckwhm2>
			<gaskwhm2>595</gaskwhm2>
			<epikwhm2>673</epikwhm2>
		</row-0>
		<row-1>
			<date>2021-11-09</date>
			<gasnm3>29555</gasnm3>
			<electricitykwh>19452</electricitykwh>
			<gaskwh>311064</gaskwh>
			<productionm2>470</productionm2>
			<eleckwhm2>41</eleckwhm2>
			<gaskwhm2>661</gaskwhm2>
			<epikwhm2>765</epikwhm2>
		</row-1>
	</Datasetparameter>
	<EndDate>2021-11-10 00:00:00.000</EndDate>
	<Frequency>weekly</Frequency>
	<Header dataset>
		<row-0>
			<Date>Date</Date>
			<Gas Volume>Gas Volume[Nm3]</Gas Volume>
			<Electricity>Electricity[kWh]</Electricity>
			<Gas>Gas[kWh]</Gas>
			<Production>Production[T]</Production>
			<Elec>Elec[kWh/T]</Elec>
			<Gass>Gas[kWh/T]</Gass>
			<EPI>EPI[kWh/T]</EPI>
			<Bar label>kWh/T</Bar label>
		</row-0>
	</Header dataset>
	<Report>
		<Gateway>UKI-001</Gateway>
		<Name>Boardline Performance Report</Name>
		<Path>Boardline Performance Report</Path>
		<Timestamp>2021-11-12 13:05:10.500</Timestamp>
	</Report>
	<ReportName>Boardline Performance Report</ReportName>
	<ReportTitle>EMS REPORTING</ReportTitle>
	<StartDate>2021-11-08 00:00:00.000</StartDate>
	<scope>Line</scope>
</sample-data>

can any one help to fix this error?

WITH XML Validation in Notepad++ is shows this:

I am getting this error in client run time also… Data is fetching correctly in chart… But in console its showing this error… How to remove this error?

From XML Elements at W3Schools:

XML elements must follow these naming rules:

  • Element names are case-sensitive
  • Element names must start with a letter or underscore
  • Element names cannot start with the letters xml (or XML, or Xml, etc)
  • Element names can contain letters, digits, hyphens, underscores, and periods
  • Element names cannot contain spaces
2 Likes

The XML is unrelated to the actual issue you’re having.
Share a screenshot of your code in the configureChart extension function.

This is getting in bar chart in report module.
. I didn’t written anything in script. Or else How to find in report module bar chart whether i have the script or not… Please help me out

I don’t know how to check configure chart function in report module chart

image
Look in the property inspector for your chart(s). If you didn’t deliberately write any script, just make sure ‘Enabled’ is not checked.

Thanks now i have disabled… Its not throwing error now