Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Possible to control color of bar in DW Graph control

847 views
Skip to first unread message

Arnd Schmidt

unread,
Aug 31, 2010, 3:09:23 PM8/31/10
to
Using PB 10.5, an empty string for the seriesname will do it.

dw_graph.setseriesstyle( 'gr_1', '', Foreground!,rgb(255,255,0))

hth

Arnd


On 31 Aug 2010 08:23:05 -0700, "Jim Klocksin" <d...@data-architects.net> wrote:

>The Bar Graph that my client needs has a single bar to represent each value in
>the graph (again, similar to an electric bill in which each bar corresponds to
>one month's electricity usage). Therefore, I don't have any Series defined for
>this bar chart and when I tried to add a series (using the same value as the
>Value axis), the chart got all screwed up. Bottom line, SetSeriesStyle does not
>help my situation at all and I still have a bar chart that my client is not at
>all happy with since the bar color defaults to RED and, again, I can't find any
>place (including the exported DW source) to change this. I can see possible
>reasons why PB controls the colors (since you can easily switch from a bar graph
>to a pie chart, etc. simply by selecting a different chart type). So, I guess
>at this point, my question really is: Does anyone know of any 3rd party
>software that I could use to generate a bar chart and still be able to "include"
>it in my DW bill (report), since it seems evident to me that this is not
>something that can be done in PB alone?
>
>On 30 Aug 2010 13:49:40 -0700,
> in sybase.public.powerbuilder.datawindow
> <Ted Zimmerman [Sybase]> wrote:
>>Take a look at the SetSeriesStyle powerscript function.
>>
>>> This is related to my prior posting in that the same
>>> client (on the same bill format to be sent via email)
>>> wants a simple bar chart (like those displayed on most
>>> electric and gas bills). The problem I have is that he
>>> wants the BARS on this chart to be blue and NOT the
>>> default red color. I've looked everywhere and even
>>> exported the DW source and looked thru all of the text
>>> describing the graph control, but I can't find anyway to
>>> change the color of the bar from that default "red" color
>>> to anything else. Does anyone know of any way to control
>>> the color of the bars in a DW graph control?
>>>
>>> As always, TIA,
>>> Jim Klocksin
>>> ---== Posted via the PFCGuide Web Newsreader ==---
>>> http://www.pfcguide.com/_newsgroups/group_list.asp

John Strano[Sybase]

unread,
Aug 31, 2010, 3:02:27 PM8/31/10
to
Here's a link to a presentation from a couple of TechWave's ago...

http://download.sybase.com/presentation/TW2008/21383.pdf

--
John Strano - Sybase Technology Evangelist


"Jim Klocksin" <d...@data-architects.net> wrote in message
news:4c7d4e4f$1@forums-1-dub...
>I really appreciate all the feedback I've received on this problem. Let me
> reply to everyone in this one posting if I can. Jason: I am using 11.5
> but my
> client is looking for a vertical bar chart, he won't be any happier with a
> horizontal chart than he is with the RED bars, but thanks, your idea was a
> good
> one! Jerry and Ivaylo: I have coded a UE using the pbm_dwngraphcreate
> event
> and have attempted to set up a "series". Problem is that the bars on the
> chart
> get displayed with some type of random spacing (each color shows up in a
> slightly different location relative to my text description along the
> bottom AND
> the "drop-down" lines that I also can't seem to get rid of either...).
> So, I
> really don't see using a series as any type of solution unless I could
> somehow
> "overlay" the third value (which just happens to display in the color my
> client
> is looking for) over the first and second, making it appear as a single
> bar!?
> This just seems like way too much hassle for something that I really
> should have
> control over as CHRIS said in his reply. Chris: I will follow that link
> you
> gave me and submit this as a potential enhancement! Mark: I'm really not
> very
> "conversant" with regards to 3rd party controls since I've only ever used
> one or
> two over the roughly 15 years I've been using PB. Any additional
> information
> you could send me regarding "Fusion Charts" (maybe, some sample code of
> how you
> integrated it with PB...) would be extremely useful. Unfortunately, this
> really
> seems to be my only alternative at this point.
> Again, thanks to everyone, your ideas were really appreciated.
>
>
> On 31 Aug 2010 10:33:27 -0700,
> in sybase.public.powerbuilder.datawindow
> Mark <mli...@yahoo.com> wrote:
>> Hi Jim,
>>
>>I use fusioncharts and fusionwidgets for all my charting and dashboard
>>needs. It is XML based and very configurable. They have a free version
>>too.
>>
>>http://www.fusioncharts.com/
>>
>>hth,
>>Mark

Jim Klocksin

unread,
Aug 31, 2010, 5:05:43 PM8/31/10
to
Jason, I didn't get your attachment. Could you send it to me directly at
d...@data-architects.net ? Thanks...


On 31 Aug 2010 12:19:07 -0700,
in sybase.public.powerbuilder.datawindow
Jason 'Bug' Fenter [TeamSybase] <jason....@teamsybase.com> wrote:
>I put together a sample anyway, just in case someone else out there is
>interested in horizontal graphs. I might try to expand this at some
>point to do multiple series, but for now, it's slick enough. :) Attached...
>
>
>On 8/31/2010 11:04 AM, Jason 'Bug' Fenter [TeamSybase] wrote:
>> Why not use rectangle objects and create your own bar graph? It would
>> have to be a horizontal bar graph, but you can control the size of the
>> rectangle with an expression based on the value. You can add a computed
>> column to the SQL that you can set in script and base your rectangle's
>> color off of that.
>>
>> What version of PB? I could probably whip up a quick example if you're
>> on PB11.5.

Jim Klocksin

unread,
Aug 31, 2010, 11:23:05 AM8/31/10
to

Jim Klocksin

unread,
Aug 31, 2010, 2:47:43 PM8/31/10
to

jimklocksin

unread,
Sep 1, 2010, 11:19:32 AM9/1/10
to
Arnd, I sent you a private email, but I just wanted to post
it on the user forum as well. Your solution worked great
for both a standalone DW graph AND for my DW which contained
a graph control. Again, thanks for you help...this actually
saved my project since my client hadn't signed a formal
agreement with anyone else yet!


> OK, I see the dilemma...
> You have a graph object within a datawindow, yes?
> So with Getchild(), you are lost.
>
> Better try Jason's approach.
> But you will get crazy during designtime, especially using
> PB.NETs Datawindow Painter.
>
> Sorry for misleading.
>
> Arnd
>
> On 31 Aug 2010 14:28:11 -0700, Arnd Schmidt
> <arnd.s...@gmx.de> wrote:
>
> >I send you the DW.
> >You can put this on a window and then try the
> setseriesstyle () >See what PB 12 make out of this one...
> >
> >
> >
> >On 31 Aug 2010 14:03:39 -0700, "Jim Klocksin"
> <d...@data-architects.net> wrote: >
> >>Arnd:
> >>
> >>I tried this with "series" check-box checked off AND
> unchecked and neither one >>worked for me (using PB 12.0).
> Is there something else that I need to do? (I >>don't
> really have a series in this bar graph...) >>
> >>On 31 Aug 2010 12:09:23 -0700,
> >> in sybase.public.powerbuilder.datawindow


> >>Arnd Schmidt <arnd.s...@gmx.de> wrote:
> >>>Using PB 10.5, an empty string for the seriesname will
> do it. >>>
> >>>dw_graph.setseriesstyle( 'gr_1', '', Foreground!
> ,rgb(255,255,0)) >>>
> >>>hth
> >>>
> >>>Arnd
> >>>
> >>>
> >>>On 31 Aug 2010 08:23:05 -0700, "Jim Klocksin"

Mark

unread,
Aug 31, 2010, 1:33:27 PM8/31/10
to
Hi Jim,

I use fusioncharts and fusionwidgets for all my charting and dashboard
needs. It is XML based and very configurable. They have a free version too.

http://www.fusioncharts.com/

hth,
Mark


On 8/31/2010 11:23 AM, Jim Klocksin wrote:

Jason 'Bug' Fenter [TeamSybase]

unread,
Aug 31, 2010, 12:04:22 PM8/31/10
to
Why not use rectangle objects and create your own bar graph? It would
have to be a horizontal bar graph, but you can control the size of the
rectangle with an expression based on the value. You can add a computed
column to the SQL that you can set in script and base your rectangle's
color off of that.

What version of PB? I could probably whip up a quick example if you're
on PB11.5.

Jerry Siegel [TeamSybase]

unread,
Aug 31, 2010, 12:20:29 PM8/31/10
to
I'd try using a constant expression for the series, or a dummy computed
column with the same value for all rows.

Report Bugs to Sybase: http://case-express.sybase.com/cx/welcome.do
Product Enhancement Requests:
http://my.isug.com/cgi-bin/1/c/submit_enhancement

Arnd Schmidt

unread,
Aug 31, 2010, 6:20:31 PM8/31/10
to
OK, I see the dilemma...
You have a graph object within a datawindow, yes?
So with Getchild(), you are lost.

Better try Jason's approach.
But you will get crazy during designtime, especially using PB.NETs
Datawindow Painter.

Sorry for misleading.

Arnd

On 31 Aug 2010 14:28:11 -0700, Arnd Schmidt <arnd.s...@gmx.de> wrote:

>I send you the DW.
>You can put this on a window and then try the setseriesstyle ()
>See what PB 12 make out of this one...
>
>
>
>On 31 Aug 2010 14:03:39 -0700, "Jim Klocksin" <d...@data-architects.net> wrote:
>
>>Arnd:
>>
>>I tried this with "series" check-box checked off AND unchecked and neither one
>>worked for me (using PB 12.0). Is there something else that I need to do? (I
>>don't really have a series in this bar graph...)
>>
>>On 31 Aug 2010 12:09:23 -0700,
>> in sybase.public.powerbuilder.datawindow
>>Arnd Schmidt <arnd.s...@gmx.de> wrote:

John Strano[Sybase]

unread,
Aug 31, 2010, 3:01:34 PM8/31/10
to
Jim:

Here's an article by Bruce Armstrong...

http://virtualization.sys-con.com/read/397003.htm

...and here's a link to some code examples...

http://www.sybase.com/detail?id=1058501#864


--
John Strano - Sybase Technology Evangelist


"Jim Klocksin" <d...@data-architects.net> wrote in message
news:4c7d4e4f$1@forums-1-dub...

Ivaylo Ivanov

unread,
Aug 31, 2010, 1:26:37 PM8/31/10
to
Hi Jim,

Just to be sure, have your failing trials included programming within a
user-defined event mapped to "pbm_dwngraphcreate" system event (as it is
noted in the help for each of the SetSeriesStyle variants)?

Regards,
Ivaylo

"Jim Klocksin" <d...@data-architects.net> wrote in message

news:4c7d1e59$1@forums-1-dub...

tedzimmerman

unread,
Aug 30, 2010, 4:49:40 PM8/30/10
to

Jim Klocksin

unread,
Aug 31, 2010, 5:03:39 PM8/31/10
to
Arnd:

I tried this with "series" check-box checked off AND unchecked and neither one
worked for me (using PB 12.0). Is there something else that I need to do? (I
don't really have a series in this bar graph...)

On 31 Aug 2010 12:09:23 -0700,
in sybase.public.powerbuilder.datawindow
Arnd Schmidt <arnd.s...@gmx.de> wrote:

Arnd Schmidt

unread,
Aug 31, 2010, 5:28:11 PM8/31/10
to
I send you the DW.
You can put this on a window and then try the setseriesstyle ()
See what PB 12 make out of this one...

Jim Klocksin

unread,
Aug 30, 2010, 12:05:03 PM8/30/10
to
0 new messages