Project: Birt
Bug 176299 Can't open chart xml files saved by examples view using Standalone builder
Reported: 2007-03-03 19:03:22 | Status: resolved fixed

Open the chart examples view Pick a chart Save the model to a .chart fie Run the example chartwizardstandalonelauncher opening that .chart file An exception is thrown: Exception in thread "main" java.lang.NullPointerException at org.eclipse.birt.chart.ui.util.ChartUIUtil.checkDataDefinition(ChartUIUtil.java:381) at org.eclipse.birt.chart.ui.util.ChartUIUtil.checkDataBinding(ChartUIUtil.java:361) at org.eclipse.birt.chart.ui.swt.wizard.TaskSelectType.doLivePreview(TaskSelectType.java:1315) at org.eclipse.birt.chart.ui.swt.wizard.TaskSelectType.refreshChart(TaskSelectType.java:1152) at org.eclipse.birt.chart.ui.swt.wizard.TaskSelectType.placeComponents(TaskSelectType.java:201) at org.eclipse.birt.chart.ui.swt.wizard.TaskSelectType.createControl(TaskSelectType.java:176) at org.eclipse.birt.core.ui.frameworks.taskwizard.WizardBase$WizardBaseDialog.switchTask(WizardBase.java:817) at org.eclipse.birt.core.ui.frameworks.taskwizard.WizardBase.switchTo(WizardBase.java:231) at org.eclipse.birt.chart.ui.swt.wizard.ChartWizard.switchTo(ChartWizard.java:259) at org.eclipse.birt.core.ui.frameworks.taskwizard.WizardBase$WizardBaseDialog.initializeBounds(WizardBase.java:659) at org.eclipse.jface.window.Window.create(Window.java:430) at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1111) at org.eclipse.birt.core.ui.frameworks.taskwizard.WizardBase$WizardBaseDialog.create(WizardBase.java:669) at org.eclipse.jface.window.Window.open(Window.java:785) at org.eclipse.birt.core.ui.frameworks.taskwizard.WizardBase.open(WizardBase.java:104) at org.eclipse.birt.chart.ui.swt.wizard.ChartWizard.open(ChartWizard.java:212) at org.eclipse.birt.core.ui.frameworks.taskwizard.WizardBase.open(WizardBase.java:117) at ChartWizardLauncher.launch(ChartWizardLauncher.java:97) at ChartWizardLauncher.main(ChartWizardLauncher.java:170) Here is how to fix it: Saving the chart clears the runtime series. But if there is only one series in the seriesdefinition, that leaves nothing, making an invalid model. In that case (one single series), it should clear the dataset of the series. The chart builder should be enhanced to open those charts without series, or at least open and show an error asking to add a series. right now it doesn't even open.

Files changed in fix:
chart/org.eclipse.birt.chart.engine/src/org/eclipse/birt/chart/model/impl/ChartWithAxesImpl.java chart/org.eclipse.birt.chart.engine/src/org/eclipse/birt/chart/model/impl/ChartWithoutAxesImpl.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/Area.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/AxisLabelFormat.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/AxisLabelScript.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/AxisTitleFormat.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/AxisTitleScript.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/Bar.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/BarAndLine.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/BarStickStock.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/BlockScript.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/CandleStickStock.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/ColoredByCategorySeries.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/ColoredByValueSeries.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/CurveFittingArea.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/CurveFittingBar.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/CurveFittingLine.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/CurveFittingScript.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/CurveFittingStock.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/DataPointLabelScript.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/LegendFormat.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/LegendScript.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/Line.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/MDialSRegionMeter.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/MarkerLine.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/MarkerLineScript.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/MarkerRange.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/MarkerRangeScript.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/MinSlice.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/MultiplePie.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/MultipleYAxes.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/MultipleYSeries.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/OverlayArea.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/OverlayLine.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/PercentStackedArea.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/PercentStackedBar.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/PercentStackedLine.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/PercentageValueFormat.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/Pie.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/PlotFormat.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/SDialSRegionMeter.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/Scatter.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/SeriesScript.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/SeriesTitleScript.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/SeriesValueFormat.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/SideBySideBar.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/StackedArea.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/StackedBar.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/StackedLine.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/StandardMeter.java chart/org.eclipse.birt.chart.examples/src/org/eclipse/birt/chart/examples/view/models/SuperImposedMeter.java