| Summary: | [Chart usability] Ability to warn when a chart is empty | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | erlich <jerlich> |
| Component: | BIRT | Assignee: | Yulin Wang <Lionel.wyl> |
| Status: | VERIFIED DUPLICATE | QA Contact: | Tianli Zhang <tzhang> |
| Severity: | enhancement | ||
| Priority: | P3 | Keywords: | plan |
| Version: | 2.2.0 | ||
| Target Milestone: | 2.5.0 | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
|
Description
erlich
Is there any update to this?? Any update or workaround? Usually, if chart has no data, it won't display in report. Do you have any use case that chart should display error message? I have a chart with a title outside.. The problem is that, if the chart is empty, it's not shown but the title is. I needed to use an external title because the chart title doesn't support dynamic titles. Also it's good to show a message saying: "Chart is not shown because... " maybe just accesing the chart in script and asking something like chart.isRendered() or something like that.. (In reply to comment #4) > I have a chart with a title outside.. > The problem is that, if the chart is empty, it's not shown but the title is. > I needed to use an external title because the chart title doesn't support > dynamic titles. > Also it's good to show a message saying: "Chart is not shown because... " > maybe just accesing the chart in script and asking something like > chart.isRendered() or something like that.. > What do you mean by "the chart title doesn't support dynamic titles"? Chart title supports i18n by properties, or scripting to change model value in runtime. (In reply to comment #5) > (In reply to comment #4) > > I have a chart with a title outside.. > > The problem is that, if the chart is empty, it's not shown but the title is. > > I needed to use an external title because the chart title doesn't support > > dynamic titles. > > Also it's good to show a message saying: "Chart is not shown because... " > > maybe just accesing the chart in script and asking something like > > chart.isRendered() or something like that.. > > > What do you mean by "the chart title doesn't support dynamic titles"? > Chart title supports i18n by properties, or scripting to change model value in > runtime. > But the chart my have some parameter and the title may change according to it.. I didn't find a way to script for the title.. For instance: A chart that shows sales per regions for a product defined by a parameter i could show: "Sales for param["product"]" but on the chart it doesn't let me script.. So I've to use a dynamic text above the chart But the issue is not that.. What i need is to have a way to explain that the chart is not shown for some reason.. The parameters entered are not enough (In reply to comment #6) > > But the chart my have some parameter and the title may change according to it.. > I didn't find a way to script for the title.. > For instance: > A chart that shows sales per regions for a product defined by a parameter i > could show: "Sales for param["product"]" but on the chart it doesn't let me > script.. So I've to use a dynamic text above the chart > > But the issue is not that.. > What i need is to have a way to explain that the chart is not shown for some > reason.. > The parameters entered are not enough > The first question: how to set title according to parameter Please write script like this: function beforeGeneration( chart, icsc ) { var title = chart.getTitle().getLabel().getCaption(); var parameter = icsc.getExternalContext().getScriptable().getParameterValue("parameterName"); title.setValue(parameter); } The second question: how to write text if no data. You could set alt text to chart, so that if chart doesn't display, alt text will replace. But it seems if data set is empty, no item display. If chart doesn't bind data, alt text will work. This is with empty data.. the Alt text is not being shown.. But the dynamic title didnt work :( Any idea of a workaround? (In reply to comment #8) > This is with empty data.. > the Alt text is not being shown.. > But the dynamic title didnt work :( > The script I wrote is a sample, and it should work. Please try it again. Regarding the empty data, if its behavior is the same with the chart without binding, i.e. to show alt text, is it ok? Will add two properties in chart model and UI. The first property is to enable error message when data count is zero. The second property is to customize error message. *** This bug has been marked as a duplicate of bug 204922 *** Verified. |