cancel
Showing results for 
Search instead for 
Did you mean: 

How to SetSeriesStyle for graph in composite datawindow

Former Member
0 Kudos

Hi All,

Using PB12.5 classic here.

I have composite datawindow which combine datawindows below:

1. a tabular window with graph (a bar chart) - Name: d_graph

2. a tabular window with data - Name: d_data

In the composite window:

d_graph is named dw_1

d_data is named dw_2

I would like to change bar chart's colour on series for graph above. Is it possible?

I know the syntax for something like this as below, but it is just works for single datawindow and not composite window (example: a tabular window with graph)

dw_1.SetSeriesStyle("gr_1", "ABC", Foreground!, 9188608)

Kindly advise.

Thank you.

Regards,

Yow

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Unfortunately some functions like SetSeriesStyle are not valid for a datawindowchild so you can't use it to change a graph in a nested dw. I think the only way is to use a second datawindow object as child with the style you need.

Former Member
0 Kudos

Hi Rene,

Do you mean to have another datawindow object to only have d_graph in and by using syntax dw_1.SetSeriesStyle("gr_1", "ABC", Foreground!, 9188608)? Please correct me if I am wrong.

Fyi, I need a print preview to show all results (d_graph & d_data) and then to save as pdf format.

Kindly advise.

Thank you.

Regards,

Yow

Former Member
0 Kudos

Oh sorry, I was wrong. I thought you can specify the colors at design time. But this is not possible.

I don't know a way to change the graph colors in a nested datawindow.

One chance: Write your own "graph" datawindow. Use a tabular datawindow and put a rectangle as bar in detail band (or a group band). You can use regular expressions to specify the width of the rectangle (the length of the bar) and the color.

Former Member
0 Kudos

Hi Rene,


I got the alternative to shows the colour changed bar chart in composite window.


1. Have a datawindow to only have the graph

2. Use syntax: dw_1.SetSeriesStyle("gr_1", "ABC", Foreground!, 9188608) to make change of bar's colour

3. Save the datawindow as image: dw_1.SaveAs(path+'Graph.wmf',wmf!,TRUE)

4. Add a picture control in the composite datawindow, and point to the image directory above, to insert the image in composite datawindow.


It works....

Thank you for your kind advise.

Begards,

Yow


Former Member
0 Kudos

This is also a workaround.