Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Stacked Bar Chart in 2.5.2 -- need to set series visibility based on other data column value(Data has columns for each available series, need to suppress display based on another column value)
Stacked Bar Chart in 2.5.2 -- need to set series visibility based on other data column value [message #876655] Thu, 24 May 2012 23:30 Go to next message
Tom Yamada is currently offline Tom Yamada
Messages: 12
Registered: July 2009
Junior Member
BIRT 2.5.2
Stacked Bar Chart

I am working off a flat dataset where the chart will only display selected columns as series as specified by a field on the row. The displayed columns also need to have their series titles changed to values held in other columns corresponding to each series.

Data is of this nature:
CAT    DISPTO  COL_01  COL_02  COL_03  COL_04  LAB_01  LAB_02  LAB_03  LAB_04
AA        3      40      30      50       0     S_01    S_02    S_03    S_04
BB        3      25      65       5       0     S_01    S_02    S_03    S_04
CC        3       9      19      29       0     S_01    S_02    S_03    S_04


I have set up a stacked bar chart with series for each of the four columns and dummy titles. When the design is run the chart needs to show only the first DISPTO number of columns, so with the example data the chart would show series for COL_01, COL_02, and COL_03 while the series corresponding to COL_04 would need to be suppressed in both the plot area as well as the legend. The series that are displayed will need to use their corresponding LAB_0x column values in the legend.

This has had me going a bit in circles so I would appreciate if some kind soul could help me get headed in the correct direction. Thanks!
Re: Stacked Bar Chart in 2.5.2 -- need to set series visibility based on other data column value [message #876910 is a reply to message #876655] Fri, 25 May 2012 10:07 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Tom,

You do this with a hidden table above the chart that loads data into
persistent global variables that are then used in chart script. Look at
the attached example. Make sure to update the file path and look at the
table detail row's oncreate method and then look at the script on the chart.

Jason

On 5/24/2012 11:30 PM, Tom Yamada wrote:
> CAT DISPTO COL_01 COL_02 COL_03 COL_04 LAB_01 LAB_02 LAB_03
> LAB_04
> AA 3 40 30 50 0 S_01 S_02 S_03
> S_04
> BB 3 25 65 5 0 S_01 S_02 S_03
> S_04
> CC 3 9 19 29 0 S_01 S_02 S_03
> S_04
Re: Stacked Bar Chart in 2.5.2 -- need to set series visibility based on other data column value [message #876912 is a reply to message #876655] Fri, 25 May 2012 10:07 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Tom,

You do this with a hidden table above the chart that loads data into
persistent global variables that are then used in chart script. Look at
the attached example. Make sure to update the file path and look at the
table detail row's oncreate method and then look at the script on the chart.

Jason

On 5/24/2012 11:30 PM, Tom Yamada wrote:
> CAT DISPTO COL_01 COL_02 COL_03 COL_04 LAB_01 LAB_02 LAB_03
> LAB_04
> AA 3 40 30 50 0 S_01 S_02 S_03
> S_04
> BB 3 25 65 5 0 S_01 S_02 S_03
> S_04
> CC 3 9 19 29 0 S_01 S_02 S_03
> S_04
Re: Stacked Bar Chart in 2.5.2 -- need to set series visibility based on other data column value [message #876915 is a reply to message #876655] Fri, 25 May 2012 10:07 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Tom,

You do this with a hidden table above the chart that loads data into
persistent global variables that are then used in chart script. Look at
the attached example. Make sure to update the file path and look at the
table detail row's oncreate method and then look at the script on the chart.

Jason

On 5/24/2012 11:30 PM, Tom Yamada wrote:
> CAT DISPTO COL_01 COL_02 COL_03 COL_04 LAB_01 LAB_02 LAB_03
> LAB_04
> AA 3 40 30 50 0 S_01 S_02 S_03
> S_04
> BB 3 25 65 5 0 S_01 S_02 S_03
> S_04
> CC 3 9 19 29 0 S_01 S_02 S_03
> S_04
Re: Stacked Bar Chart in 2.5.2 -- need to set series visibility based on other data column value [message #876919 is a reply to message #876655] Fri, 25 May 2012 10:07 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Tom,

You do this with a hidden table above the chart that loads data into
persistent global variables that are then used in chart script. Look at
the attached example. Make sure to update the file path and look at the
table detail row's oncreate method and then look at the script on the chart.

Jason

On 5/24/2012 11:30 PM, Tom Yamada wrote:
> CAT DISPTO COL_01 COL_02 COL_03 COL_04 LAB_01 LAB_02 LAB_03
> LAB_04
> AA 3 40 30 50 0 S_01 S_02 S_03
> S_04
> BB 3 25 65 5 0 S_01 S_02 S_03
> S_04
> CC 3 9 19 29 0 S_01 S_02 S_03
> S_04
Re: Stacked Bar Chart in 2.5.2 -- need to set series visibility based on other data column value [message #876923 is a reply to message #876655] Fri, 25 May 2012 10:07 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Tom,

You do this with a hidden table above the chart that loads data into
persistent global variables that are then used in chart script. Look at
the attached example. Make sure to update the file path and look at the
table detail row's oncreate method and then look at the script on the chart.

Jason

On 5/24/2012 11:30 PM, Tom Yamada wrote:
> CAT DISPTO COL_01 COL_02 COL_03 COL_04 LAB_01 LAB_02 LAB_03
> LAB_04
> AA 3 40 30 50 0 S_01 S_02 S_03
> S_04
> BB 3 25 65 5 0 S_01 S_02 S_03
> S_04
> CC 3 9 19 29 0 S_01 S_02 S_03
> S_04
Re: Stacked Bar Chart in 2.5.2 -- need to set series visibility based on other data column value [message #876928 is a reply to message #876655] Fri, 25 May 2012 10:07 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Tom,

You do this with a hidden table above the chart that loads data into
persistent global variables that are then used in chart script. Look at
the attached example. Make sure to update the file path and look at the
table detail row's oncreate method and then look at the script on the chart.

Jason

On 5/24/2012 11:30 PM, Tom Yamada wrote:
> CAT DISPTO COL_01 COL_02 COL_03 COL_04 LAB_01 LAB_02 LAB_03
> LAB_04
> AA 3 40 30 50 0 S_01 S_02 S_03
> S_04
> BB 3 25 65 5 0 S_01 S_02 S_03
> S_04
> CC 3 9 19 29 0 S_01 S_02 S_03
> S_04
Re: Stacked Bar Chart in 2.5.2 -- need to set series visibility based on other data column value [message #876953 is a reply to message #876910] Fri, 25 May 2012 11:29 Go to previous messageGo to next message
Tom Yamada is currently offline Tom Yamada
Messages: 12
Registered: July 2009
Junior Member
Thanks Jason, this is exactly what I needed. Very clear and concise.
Re: Stacked Bar Chart in 2.5.2 -- need to set series visibility based on other data column value [message #877039 is a reply to message #876928] Fri, 25 May 2012 15:08 Go to previous messageGo to next message
Tom Yamada is currently offline Tom Yamada
Messages: 12
Registered: July 2009
Junior Member
The actual design where I wish to apply this is more complex than the example that I gave and though the example provided worked perfectly for my initial example I have run into another issue that may or may not have an elegant solution.

My real design may show this chart multiple times. I have implemented this by putting the chart in a table group header cell and using table bindings. The grouping is on a CHTNUM column. So I moved the setting of PGVs into the header row onCreate() -- so far all appears fine.

What happens is that the hiding of series is being done on the actual chart model rather than the particular instance of the chart. Subsequent charts will fail when the code tries to address series which were suppressed in an earlier one -- they may need to show more series than the earlier chart.

Is there a means of always resetting to the original chart with the series as designed each time before the series visibilities are applied, or saving suppressed series off and re-adding those to be shown?

I am attaching modified copies of your design and flat-file to reflect the multiple chart aspect. Thanks.
Re: Stacked Bar Chart in 2.5.2 -- need to set series visibility based on other data column value [message #878274 is a reply to message #876910] Mon, 28 May 2012 20:52 Go to previous messageGo to next message
Tom Yamada is currently offline Tom Yamada
Messages: 12
Registered: July 2009
Junior Member
Because I have no life Razz , I was able to try out some things on this design over the weekend.

Unfortunately, not with much success. I am attaching a copy of the design with the epitome of my efforts. What I am doing in this version is using copyInstance() to make a copy of the first series and updating the data definition and series identifier before adding it to the series list in beforeGeneration().

It appears that the timing is incorrect for this to be effective as this does not restore the series in output. As a test I used some assignments on the first series and discovered that the changed data column and series identifier were only effective for the next chart not the one where I made the change. These lines are commented-out in the script of the attached design.

I don't know if there is someplace earlier to restore the necessary series, both before and after-DataSetFilled only work on individual series.

If it is not possible then I would be satisfied with just manipulating the legend as that is the only place that the excess series show up -- they are not messing-up the chart plot but the legend should only show the first DISPTO series labels and swatches. Is there a way to only suppress the legend entries in a way that can be restored in subsequent iterations?

Thanks.
Re: Stacked Bar Chart in 2.5.2 -- need to set series visibility based on other data column value [message #878588 is a reply to message #878274] Tue, 29 May 2012 11:12 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

If you are not use using optional grouping on the chart use the runtime
series that are generated. Take a look at the modified example. Note
that the data set should be setting the series values to some number not
a string. I did not change this because the chart still ran.

I also moved the script on the table group header to onrender as charts
are generated at render time. This is the only report item that does this.

Jason

On 5/28/2012 8:52 PM, Tom Yamada wrote:
> Because I have no life :p , I was able to try out some things on this design over the weekend.
>
> Unfortunately, not with much success. I am attaching a copy of the design with the epitome of my efforts. What I am doing in this version is using copyInstance() to make a copy of the first series and updating the data definition and series identifier before adding it to the series list in beforeGeneration().
>
> It appears that the timing is incorrect for this to be effective as this does not restore the series in output. As a test I used some assignments on the first series and discovered that the changed data column and series identifier were only effective for the next chart not the one where I made the change. These lines are commented-out in the script of the attached design.
>
> I don't know if there is someplace earlier to restore the necessary series, both before and after-DataSetFilled only work on individual series.
>
> If it is not possible then I would be satisfied with just manipulating the legend as that is the only place that the excess series show up -- they are not messing-up the chart plot but the legend should only show the first DISPTO series labels and swatches. Is there a way to only suppress the legend entries in a way that can be restored in subsequent iterations?
>
> Thanks.
Re: Stacked Bar Chart in 2.5.2 -- need to set series visibility based on other data column value [message #878593 is a reply to message #878274] Tue, 29 May 2012 11:12 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

If you are not use using optional grouping on the chart use the runtime
series that are generated. Take a look at the modified example. Note
that the data set should be setting the series values to some number not
a string. I did not change this because the chart still ran.

I also moved the script on the table group header to onrender as charts
are generated at render time. This is the only report item that does this.

Jason

On 5/28/2012 8:52 PM, Tom Yamada wrote:
> Because I have no life :p , I was able to try out some things on this design over the weekend.
>
> Unfortunately, not with much success. I am attaching a copy of the design with the epitome of my efforts. What I am doing in this version is using copyInstance() to make a copy of the first series and updating the data definition and series identifier before adding it to the series list in beforeGeneration().
>
> It appears that the timing is incorrect for this to be effective as this does not restore the series in output. As a test I used some assignments on the first series and discovered that the changed data column and series identifier were only effective for the next chart not the one where I made the change. These lines are commented-out in the script of the attached design.
>
> I don't know if there is someplace earlier to restore the necessary series, both before and after-DataSetFilled only work on individual series.
>
> If it is not possible then I would be satisfied with just manipulating the legend as that is the only place that the excess series show up -- they are not messing-up the chart plot but the legend should only show the first DISPTO series labels and swatches. Is there a way to only suppress the legend entries in a way that can be restored in subsequent iterations?
>
> Thanks.
Re: Stacked Bar Chart in 2.5.2 -- need to set series visibility based on other data column value [message #878596 is a reply to message #878274] Tue, 29 May 2012 11:12 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

If you are not use using optional grouping on the chart use the runtime
series that are generated. Take a look at the modified example. Note
that the data set should be setting the series values to some number not
a string. I did not change this because the chart still ran.

I also moved the script on the table group header to onrender as charts
are generated at render time. This is the only report item that does this.

Jason

On 5/28/2012 8:52 PM, Tom Yamada wrote:
> Because I have no life :p , I was able to try out some things on this design over the weekend.
>
> Unfortunately, not with much success. I am attaching a copy of the design with the epitome of my efforts. What I am doing in this version is using copyInstance() to make a copy of the first series and updating the data definition and series identifier before adding it to the series list in beforeGeneration().
>
> It appears that the timing is incorrect for this to be effective as this does not restore the series in output. As a test I used some assignments on the first series and discovered that the changed data column and series identifier were only effective for the next chart not the one where I made the change. These lines are commented-out in the script of the attached design.
>
> I don't know if there is someplace earlier to restore the necessary series, both before and after-DataSetFilled only work on individual series.
>
> If it is not possible then I would be satisfied with just manipulating the legend as that is the only place that the excess series show up -- they are not messing-up the chart plot but the legend should only show the first DISPTO series labels and swatches. Is there a way to only suppress the legend entries in a way that can be restored in subsequent iterations?
>
> Thanks.
Re: Stacked Bar Chart in 2.5.2 -- need to set series visibility based on other data column value [message #878598 is a reply to message #878274] Tue, 29 May 2012 11:12 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

If you are not use using optional grouping on the chart use the runtime
series that are generated. Take a look at the modified example. Note
that the data set should be setting the series values to some number not
a string. I did not change this because the chart still ran.

I also moved the script on the table group header to onrender as charts
are generated at render time. This is the only report item that does this.

Jason

On 5/28/2012 8:52 PM, Tom Yamada wrote:
> Because I have no life :p , I was able to try out some things on this design over the weekend.
>
> Unfortunately, not with much success. I am attaching a copy of the design with the epitome of my efforts. What I am doing in this version is using copyInstance() to make a copy of the first series and updating the data definition and series identifier before adding it to the series list in beforeGeneration().
>
> It appears that the timing is incorrect for this to be effective as this does not restore the series in output. As a test I used some assignments on the first series and discovered that the changed data column and series identifier were only effective for the next chart not the one where I made the change. These lines are commented-out in the script of the attached design.
>
> I don't know if there is someplace earlier to restore the necessary series, both before and after-DataSetFilled only work on individual series.
>
> If it is not possible then I would be satisfied with just manipulating the legend as that is the only place that the excess series show up -- they are not messing-up the chart plot but the legend should only show the first DISPTO series labels and swatches. Is there a way to only suppress the legend entries in a way that can be restored in subsequent iterations?
>
> Thanks.
Re: Stacked Bar Chart in 2.5.2 -- need to set series visibility based on other data column value [message #878601 is a reply to message #878274] Tue, 29 May 2012 11:12 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

If you are not use using optional grouping on the chart use the runtime
series that are generated. Take a look at the modified example. Note
that the data set should be setting the series values to some number not
a string. I did not change this because the chart still ran.

I also moved the script on the table group header to onrender as charts
are generated at render time. This is the only report item that does this.

Jason

On 5/28/2012 8:52 PM, Tom Yamada wrote:
> Because I have no life :p , I was able to try out some things on this design over the weekend.
>
> Unfortunately, not with much success. I am attaching a copy of the design with the epitome of my efforts. What I am doing in this version is using copyInstance() to make a copy of the first series and updating the data definition and series identifier before adding it to the series list in beforeGeneration().
>
> It appears that the timing is incorrect for this to be effective as this does not restore the series in output. As a test I used some assignments on the first series and discovered that the changed data column and series identifier were only effective for the next chart not the one where I made the change. These lines are commented-out in the script of the attached design.
>
> I don't know if there is someplace earlier to restore the necessary series, both before and after-DataSetFilled only work on individual series.
>
> If it is not possible then I would be satisfied with just manipulating the legend as that is the only place that the excess series show up -- they are not messing-up the chart plot but the legend should only show the first DISPTO series labels and swatches. Is there a way to only suppress the legend entries in a way that can be restored in subsequent iterations?
>
> Thanks.
Re: Stacked Bar Chart in 2.5.2 -- need to set series visibility based on other data column value [message #878603 is a reply to message #878274] Tue, 29 May 2012 11:12 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

If you are not use using optional grouping on the chart use the runtime
series that are generated. Take a look at the modified example. Note
that the data set should be setting the series values to some number not
a string. I did not change this because the chart still ran.

I also moved the script on the table group header to onrender as charts
are generated at render time. This is the only report item that does this.

Jason

On 5/28/2012 8:52 PM, Tom Yamada wrote:
> Because I have no life :p , I was able to try out some things on this design over the weekend.
>
> Unfortunately, not with much success. I am attaching a copy of the design with the epitome of my efforts. What I am doing in this version is using copyInstance() to make a copy of the first series and updating the data definition and series identifier before adding it to the series list in beforeGeneration().
>
> It appears that the timing is incorrect for this to be effective as this does not restore the series in output. As a test I used some assignments on the first series and discovered that the changed data column and series identifier were only effective for the next chart not the one where I made the change. These lines are commented-out in the script of the attached design.
>
> I don't know if there is someplace earlier to restore the necessary series, both before and after-DataSetFilled only work on individual series.
>
> If it is not possible then I would be satisfied with just manipulating the legend as that is the only place that the excess series show up -- they are not messing-up the chart plot but the legend should only show the first DISPTO series labels and swatches. Is there a way to only suppress the legend entries in a way that can be restored in subsequent iterations?
>
> Thanks.
Re: Stacked Bar Chart in 2.5.2 -- need to set series visibility based on other data column value [message #878607 is a reply to message #878274] Tue, 29 May 2012 11:12 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

If you are not use using optional grouping on the chart use the runtime
series that are generated. Take a look at the modified example. Note
that the data set should be setting the series values to some number not
a string. I did not change this because the chart still ran.

I also moved the script on the table group header to onrender as charts
are generated at render time. This is the only report item that does this.

Jason

On 5/28/2012 8:52 PM, Tom Yamada wrote:
> Because I have no life :p , I was able to try out some things on this design over the weekend.
>
> Unfortunately, not with much success. I am attaching a copy of the design with the epitome of my efforts. What I am doing in this version is using copyInstance() to make a copy of the first series and updating the data definition and series identifier before adding it to the series list in beforeGeneration().
>
> It appears that the timing is incorrect for this to be effective as this does not restore the series in output. As a test I used some assignments on the first series and discovered that the changed data column and series identifier were only effective for the next chart not the one where I made the change. These lines are commented-out in the script of the attached design.
>
> I don't know if there is someplace earlier to restore the necessary series, both before and after-DataSetFilled only work on individual series.
>
> If it is not possible then I would be satisfied with just manipulating the legend as that is the only place that the excess series show up -- they are not messing-up the chart plot but the legend should only show the first DISPTO series labels and swatches. Is there a way to only suppress the legend entries in a way that can be restored in subsequent iterations?
>
> Thanks.
Re: Stacked Bar Chart in 2.5.2 -- need to set series visibility based on other data column value [message #878611 is a reply to message #878274] Tue, 29 May 2012 11:12 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

If you are not use using optional grouping on the chart use the runtime
series that are generated. Take a look at the modified example. Note
that the data set should be setting the series values to some number not
a string. I did not change this because the chart still ran.

I also moved the script on the table group header to onrender as charts
are generated at render time. This is the only report item that does this.

Jason

On 5/28/2012 8:52 PM, Tom Yamada wrote:
> Because I have no life :p , I was able to try out some things on this design over the weekend.
>
> Unfortunately, not with much success. I am attaching a copy of the design with the epitome of my efforts. What I am doing in this version is using copyInstance() to make a copy of the first series and updating the data definition and series identifier before adding it to the series list in beforeGeneration().
>
> It appears that the timing is incorrect for this to be effective as this does not restore the series in output. As a test I used some assignments on the first series and discovered that the changed data column and series identifier were only effective for the next chart not the one where I made the change. These lines are commented-out in the script of the attached design.
>
> I don't know if there is someplace earlier to restore the necessary series, both before and after-DataSetFilled only work on individual series.
>
> If it is not possible then I would be satisfied with just manipulating the legend as that is the only place that the excess series show up -- they are not messing-up the chart plot but the legend should only show the first DISPTO series labels and swatches. Is there a way to only suppress the legend entries in a way that can be restored in subsequent iterations?
>
> Thanks.
Re: Stacked Bar Chart in 2.5.2 -- need to set series visibility based on other data column value [message #878614 is a reply to message #878274] Tue, 29 May 2012 11:12 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

If you are not use using optional grouping on the chart use the runtime
series that are generated. Take a look at the modified example. Note
that the data set should be setting the series values to some number not
a string. I did not change this because the chart still ran.

I also moved the script on the table group header to onrender as charts
are generated at render time. This is the only report item that does this.

Jason

On 5/28/2012 8:52 PM, Tom Yamada wrote:
> Because I have no life :p , I was able to try out some things on this design over the weekend.
>
> Unfortunately, not with much success. I am attaching a copy of the design with the epitome of my efforts. What I am doing in this version is using copyInstance() to make a copy of the first series and updating the data definition and series identifier before adding it to the series list in beforeGeneration().
>
> It appears that the timing is incorrect for this to be effective as this does not restore the series in output. As a test I used some assignments on the first series and discovered that the changed data column and series identifier were only effective for the next chart not the one where I made the change. These lines are commented-out in the script of the attached design.
>
> I don't know if there is someplace earlier to restore the necessary series, both before and after-DataSetFilled only work on individual series.
>
> If it is not possible then I would be satisfied with just manipulating the legend as that is the only place that the excess series show up -- they are not messing-up the chart plot but the legend should only show the first DISPTO series labels and swatches. Is there a way to only suppress the legend entries in a way that can be restored in subsequent iterations?
>
> Thanks.
Re: Stacked Bar Chart in 2.5.2 -- need to set series visibility based on other data column value [message #878618 is a reply to message #878274] Tue, 29 May 2012 11:12 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

If you are not use using optional grouping on the chart use the runtime
series that are generated. Take a look at the modified example. Note
that the data set should be setting the series values to some number not
a string. I did not change this because the chart still ran.

I also moved the script on the table group header to onrender as charts
are generated at render time. This is the only report item that does this.

Jason

On 5/28/2012 8:52 PM, Tom Yamada wrote:
> Because I have no life :p , I was able to try out some things on this design over the weekend.
>
> Unfortunately, not with much success. I am attaching a copy of the design with the epitome of my efforts. What I am doing in this version is using copyInstance() to make a copy of the first series and updating the data definition and series identifier before adding it to the series list in beforeGeneration().
>
> It appears that the timing is incorrect for this to be effective as this does not restore the series in output. As a test I used some assignments on the first series and discovered that the changed data column and series identifier were only effective for the next chart not the one where I made the change. These lines are commented-out in the script of the attached design.
>
> I don't know if there is someplace earlier to restore the necessary series, both before and after-DataSetFilled only work on individual series.
>
> If it is not possible then I would be satisfied with just manipulating the legend as that is the only place that the excess series show up -- they are not messing-up the chart plot but the legend should only show the first DISPTO series labels and swatches. Is there a way to only suppress the legend entries in a way that can be restored in subsequent iterations?
>
> Thanks.
Re: Stacked Bar Chart in 2.5.2 -- need to set series visibility based on other data column value [message #878622 is a reply to message #878274] Tue, 29 May 2012 11:12 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

If you are not use using optional grouping on the chart use the runtime
series that are generated. Take a look at the modified example. Note
that the data set should be setting the series values to some number not
a string. I did not change this because the chart still ran.

I also moved the script on the table group header to onrender as charts
are generated at render time. This is the only report item that does this.

Jason

On 5/28/2012 8:52 PM, Tom Yamada wrote:
> Because I have no life :p , I was able to try out some things on this design over the weekend.
>
> Unfortunately, not with much success. I am attaching a copy of the design with the epitome of my efforts. What I am doing in this version is using copyInstance() to make a copy of the first series and updating the data definition and series identifier before adding it to the series list in beforeGeneration().
>
> It appears that the timing is incorrect for this to be effective as this does not restore the series in output. As a test I used some assignments on the first series and discovered that the changed data column and series identifier were only effective for the next chart not the one where I made the change. These lines are commented-out in the script of the attached design.
>
> I don't know if there is someplace earlier to restore the necessary series, both before and after-DataSetFilled only work on individual series.
>
> If it is not possible then I would be satisfied with just manipulating the legend as that is the only place that the excess series show up -- they are not messing-up the chart plot but the legend should only show the first DISPTO series labels and swatches. Is there a way to only suppress the legend entries in a way that can be restored in subsequent iterations?
>
> Thanks.
Re: Stacked Bar Chart in 2.5.2 -- need to set series visibility based on other data column value [message #878624 is a reply to message #878274] Tue, 29 May 2012 11:12 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

If you are not use using optional grouping on the chart use the runtime
series that are generated. Take a look at the modified example. Note
that the data set should be setting the series values to some number not
a string. I did not change this because the chart still ran.

I also moved the script on the table group header to onrender as charts
are generated at render time. This is the only report item that does this.

Jason

On 5/28/2012 8:52 PM, Tom Yamada wrote:
> Because I have no life :p , I was able to try out some things on this design over the weekend.
>
> Unfortunately, not with much success. I am attaching a copy of the design with the epitome of my efforts. What I am doing in this version is using copyInstance() to make a copy of the first series and updating the data definition and series identifier before adding it to the series list in beforeGeneration().
>
> It appears that the timing is incorrect for this to be effective as this does not restore the series in output. As a test I used some assignments on the first series and discovered that the changed data column and series identifier were only effective for the next chart not the one where I made the change. These lines are commented-out in the script of the attached design.
>
> I don't know if there is someplace earlier to restore the necessary series, both before and after-DataSetFilled only work on individual series.
>
> If it is not possible then I would be satisfied with just manipulating the legend as that is the only place that the excess series show up -- they are not messing-up the chart plot but the legend should only show the first DISPTO series labels and swatches. Is there a way to only suppress the legend entries in a way that can be restored in subsequent iterations?
>
> Thanks.
Re: Stacked Bar Chart in 2.5.2 -- need to set series visibility based on other data column value [message #878629 is a reply to message #878274] Tue, 29 May 2012 11:12 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

If you are not use using optional grouping on the chart use the runtime
series that are generated. Take a look at the modified example. Note
that the data set should be setting the series values to some number not
a string. I did not change this because the chart still ran.

I also moved the script on the table group header to onrender as charts
are generated at render time. This is the only report item that does this.

Jason

On 5/28/2012 8:52 PM, Tom Yamada wrote:
> Because I have no life :p , I was able to try out some things on this design over the weekend.
>
> Unfortunately, not with much success. I am attaching a copy of the design with the epitome of my efforts. What I am doing in this version is using copyInstance() to make a copy of the first series and updating the data definition and series identifier before adding it to the series list in beforeGeneration().
>
> It appears that the timing is incorrect for this to be effective as this does not restore the series in output. As a test I used some assignments on the first series and discovered that the changed data column and series identifier were only effective for the next chart not the one where I made the change. These lines are commented-out in the script of the attached design.
>
> I don't know if there is someplace earlier to restore the necessary series, both before and after-DataSetFilled only work on individual series.
>
> If it is not possible then I would be satisfied with just manipulating the legend as that is the only place that the excess series show up -- they are not messing-up the chart plot but the legend should only show the first DISPTO series labels and swatches. Is there a way to only suppress the legend entries in a way that can be restored in subsequent iterations?
>
> Thanks.
Re: Stacked Bar Chart in 2.5.2 -- need to set series visibility based on other data column value [message #878680 is a reply to message #878588] Tue, 29 May 2012 14:09 Go to previous messageGo to next message
Tom Yamada is currently offline Tom Yamada
Messages: 12
Registered: July 2009
Junior Member
Thanks Jason, that's awesome. I've applied this technique to my actual design and it is working just as desired. It's nice to understand this important distinction in when to use the series vs. the run-time series!

My data set is returning the series values as numbers so that is not a problem.

One thing that I noticed when playing around with your example, but that does not affect my current requirements, is that if I switch the chart from a stacked bar to a percent stacked bar in the designer it looks correct but at run time it shows as a regular stacked bar still. The axis scale is 0 to 100 so that part is correct but the bars themselves are not percentage.
Re: Stacked Bar Chart in 2.5.2 -- need to set series visibility based on other data column value [message #878799 is a reply to message #878680] Tue, 29 May 2012 20:31 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Do you mean on the labels? You will have to remove the valueData from
the labels and put in Percentile Value Data. This is done on the Series
labels under values. You will see a drop down box and an add, remove
and format button.

Jason

On 5/29/2012 2:09 PM, Tom Yamada wrote:
> Thanks Jason, that's awesome. I've applied this technique to my actual
> design and it is working just as desired. It's nice to understand this
> important distinction in when to use the series vs. the run-time series!
>
> My data set is returning the series values as numbers so that is not a
> problem.
> One thing that I noticed when playing around with your example, but that
> does not affect my current requirements, is that if I switch the chart
> from a stacked bar to a percent stacked bar in the designer it looks
> correct but at run time it shows as a regular stacked bar still. The
> axis scale is 0 to 100 so that part is correct but the bars themselves
> are not percentage.
Re: Stacked Bar Chart in 2.5.2 -- need to set series visibility based on other data column value [message #878871 is a reply to message #878799] Wed, 30 May 2012 01:28 Go to previous messageGo to next message
Tom Yamada is currently offline Tom Yamada
Messages: 12
Registered: July 2009
Junior Member
Jason, what I am seeing is that when I just change the chart type in your example to a percent stacked bar it looks good in the designer but when run in preview or the web viewer the bars are not percent (they appear to remain regular stacked bar proportion) while the scale does change to a percentage range.

This is not a problem with my current development but I thought that you should know that this might be an issue. I am attaching a couple of screenshots to illustrate the apparent discrepancy.
Re: Stacked Bar Chart in 2.5.2 -- need to set series visibility based on other data column value [message #879163 is a reply to message #878871] Wed, 30 May 2012 12:25 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Tom,

Thanks for the images. I am still a bit confused as I do not see the
issue. It looks like a percent stacked to me.

Jason

On 5/30/2012 1:28 AM, Tom Yamada wrote:
> Jason, what I am seeing is that when I just change the chart type in your example to a percent stacked bar it looks good in the designer but when run in preview or the web viewer the bars are not percent (they appear to remain regular stacked bar proportion) while the scale does change to a percentage range.
>
> This is not a problem with my current development but I thought that you should know that this might be an issue. I am attaching a couple of screenshots to illustrate the apparent discrepancy.
>
Re: Stacked Bar Chart in 2.5.2 -- need to set series visibility based on other data column value [message #879166 is a reply to message #879163] Wed, 30 May 2012 12:36 Go to previous messageGo to next message
Tom Yamada is currently offline Tom Yamada
Messages: 12
Registered: July 2009
Junior Member
But in a percent stacked chart shouldn't the stacked bars always extend for the full height of the chart, adding up to 100%?
Re: Stacked Bar Chart in 2.5.2 -- need to set series visibility based on other data column value [message #879235 is a reply to message #879166] Wed, 30 May 2012 16:09 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

yes but not in this case because the data still contains the data for
the hidden series.

Jason

On 5/30/2012 12:36 PM, Tom Yamada wrote:
> But in a percent stacked chart shouldn't the stacked bars always extend
> for the full height of the chart, adding up to 100%?
Re: Stacked Bar Chart in 2.5.2 -- need to set series visibility based on other data column value [message #879237 is a reply to message #879235] Wed, 30 May 2012 16:14 Go to previous message
Tom Yamada is currently offline Tom Yamada
Messages: 12
Registered: July 2009
Junior Member
Ah, that makes sense. Thanks.
Previous Topic:Customising BIRT Sample Viewer
Next Topic:BIRT Webservice ODA integration with JIRA
Goto Forum:
  


Current Time: Fri Aug 22 17:53:35 EDT 2014

Powered by FUDForum. Page generated in 0.11644 seconds