Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Help with formatting a sparkline / line graph?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Help with formatting a sparkline / line graph?
 Login/Join
 
Member
posted
I've been reading the WF761 Graphics documentation trying to solve a problem with a sparkline, and I've been reading a whole bunch of posts here and I'm still stumped, so I'm hoping that maybe I'm missing something obvious.

We have a sparkline / line graph template that we use for our dashboard. Everything seems to work fine, however we've noticed one big flaw...

When a series is either all 100% or all 0 (which happens regularly with some measures), the line won't graph. The chart is just blank.

I've been playing with setRect, setY1ScaleMin, setY1ScaleMax etc all day and I still can't get it to work.

for the purpose of this question, assume my series is always at 100%. I should have a perfectly straight, horizontal line at the top of the graph.

When I adjust the setRect command, I can get this to happen, if I use the setY1MustIncludeZero(true); command, but then on other series values passed into the graph, it skewes the perpsective. If I turn setY1MustIncludeZero to false, it graphs the 100% series at the BOTTOM of my chart.

What am I doing wrong?

Here is the core graph syntax I'm using:

 GRAPH FILE pp_127_sparkline
PRINT Percent_of_Qualifying_Accounts/P12% AS ''
BY MonthDatetime
-*ON GRAPH HOLD AS 127SPARK FORMAT HTMTABLE
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB OFF
ON GRAPH SET 3D OFF
-* turn off the default grid settings.
ON GRAPH SET GRID OFF
-* set absolute height to 20 px.
ON GRAPH SET VAXIS 20
-* set absolute width to 90 px.
ON GRAPH SET HAXIS 90
ON GRAPH SET GRAPHSTYLE *
setGraphType(41);
setDepthRadius(0);
setDepthAngle(0);
setConnectLineMarkers(true);
setFillColor(getSeries(0),new Color(0 0 0));
setTransparentBorderColor(getChartBackground(),true);
setBorderColor(getChartBackground(),new Color(225,235,240));
setFillColor(getFrame(),new Color(225,235,240));
setFillColor(getChartBackground(),new Color(225,235,240));
setFootnoteDisplay(false);
setSubtitleDisplay(false);
setTitleDisplay(false);
setToolTipDisplay(true);
setFrameDisplay(false);
setLegendDisplay(false);
setLegendAutomatic(false);
setO1TitleDisplay(false);
setMarkerShape(getSeries(0),0);
setMarkerSize(getSeries(0),0);
setLineWidth(getSeries(0),1);
setExtendToFrameEdge(true);
setO1LabelDisplay(false);
setO1MajorGridDisplay(false);
setO1AxisLineDisplay(false);
setY1LabelDisplay(false);
setY1MajorGridDisplay(false);
setY1AxisLineDisplay(false);

setRect(getFrame(), new Rectangle(-16000,-15000,32000,31000));

setScaleMinAuto(getY1Axis(),true);
setY1MustIncludeZero(false);
setY1OffScaleDisplay(false);

setPlace(false);
ENDSTYLE 


I've been messing around with so many different combinations of these API's (and their values) that I've just ended up confusing myself and spinning my wheels, so hopefully someone better versed in this can shed some light.

Thanks so much Smiler

This message has been edited. Last edited by: PeterV,


WebFOCUS v. 7.6.10
___________________
Win2k3 Server
Intel Xeon 2.3Ghz/4Gb Ram Apache / IIS / SQL Srvr 2005
 
Posts: 29 | Location: Bellingham, WA | Registered: October 01, 2008Report This Post
<FreSte>
posted
Peter,

If you change setScaleMinAuto(..) into

setScaleMinAuto(getY1Axis(),false);

... you'll get the line in the graph

(tested it with all series being 100%)


-Fred-

This message has been edited. Last edited by: <FreSte>,
 
Report This Post
Member
posted Hide Post
Hi Fred,

That's what's confusing to me. I would have thought the same thing... and under certain conditions it works, but others it doesn't.

Let me show you visibly with images I'm hoping will show Smiler


The sparkline should look like this:


That said, however, the 100% series then graphs like this:


When I change to setScaleMinAuto(getY1Axis(),false) as you suggested, the sparkline now looks like this:


That skews the perspective and removes it's ability to be accurately interpreted. That said, it now graphs the 100% series correctly:



This is why I'm stuck. If I fix the problem with the 0 or 100 series, it breaks the perspective on everything else. If i make it work for the normal series, I can't get the 0 or 100 series graphs to work right.

I shave my head so that I can't pull my hair out... and on days like this, it's a good thing Smiler

Any other possible suggestions?


WebFOCUS v. 7.6.10
___________________
Win2k3 Server
Intel Xeon 2.3Ghz/4Gb Ram Apache / IIS / SQL Srvr 2005
 
Posts: 29 | Location: Bellingham, WA | Registered: October 01, 2008Report This Post
Virtuoso
posted Hide Post
you can read the min and max values
put them in two &vars and use that in the graph minimum and maximum




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
<FreSte>
posted
Peter,

The images you supllied in your post make things very clear what's going on.
I would do as Frank suggested. Get the min and max values and the data in the graph
will then keep it's perspective.


-Fred-


GRAPH FILE CAR
  SUM 
    COMPUTE PP/D6 = DEALER_COST * 100 / RETAIL_COST; AS ''
  BY MODEL
  ON TABLE HOLD
END
-RUN

TABLE FILE HOLD
  SUM 
    MIN.PP
    MAX.PP
  ON TABLE HOLD AS MINMAX FORMAT ALPHA
END
-RUN
-READ MINMAX &VALMIN.6 &VALMAX.6

GRAPH FILE HOLD
  SUM PP
  BY MODEL
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET BARNUMB OFF
ON GRAPH SET 3D OFF
-* turn off the default grid settings.
ON GRAPH SET GRID OFF
-* set absolute height to 20 px.
ON GRAPH SET VAXIS 20
-* set absolute width to 90 px.
ON GRAPH SET HAXIS 90
ON GRAPH SET GRAPHSTYLE *
setGraphType(41);
setFillColor(getSeries(0),new Color(0 0 0));
setTransparentBorderColor(getChartBackground(),true);
setBorderColor(getChartBackground(),new Color(225,235,240));
setFillColor(getFrame(),new Color(225,235,240));
setFillColor(getChartBackground(),new Color(225,235,240));
setFootnoteDisplay(false);
setSubtitleDisplay(false);
setTitleDisplay(false);
setToolTipDisplay(true);
setFrameDisplay(false);
setLegendDisplay(false);
setLegendAutomatic(false);
setO1TitleDisplay(false);
setMarkerSize(getSeries(0),0);
setLineWidth(getSeries(0),1);
setO1LabelDisplay(false);
setO1MajorGridDisplay(false);
setO1AxisLineDisplay(false);
setY1LabelDisplay(false);
setY1MajorGridDisplay(false);
setY1AxisLineDisplay(false);
setRect(getFrame(), new Rectangle(-16000,-15000,32000,31000));

setScaleMinAuto(getY1Axis(),false);
setY1ScaleMin(&VALMIN);
setY1ScaleMax(&VALMAX);

ENDSTYLE 
END
 
Report This Post
Member
posted Hide Post
wow, now there's a concept that I hadn't thought of. I need to try that, it makes total sense.

Awesome, thanks guys. I'll leave this open for a bit so I can post back if I break something again, but that's a good suggestion, thank you Smiler

_____________________________________

EDIT: Nope, it didn't work. It processed, yes, but on the series of all 100% values, it produced this graph again -


So I'm back to the drawing board. That was a great suggestion, though... I really thought it would work. =\

This message has been edited. Last edited by: PeterV,


WebFOCUS v. 7.6.10
___________________
Win2k3 Server
Intel Xeon 2.3Ghz/4Gb Ram Apache / IIS / SQL Srvr 2005
 
Posts: 29 | Location: Bellingham, WA | Registered: October 01, 2008Report This Post
<FreSte>
posted
Peter,

Those 100 percent's are quite hard to deal with. After playing with some settings I noticed that if the min and/or max values are 0 or 100, it goes wrong (not always), so what you maybe could do is the following:

TABLE FILE HOLD
  SUM 
    MIN.PP
    MAX.PP
  ON TABLE HOLD AS MINMAX FORMAT ALPHA
END
-RUN
-READ MINMAX &VALMIN.6 &VALMAX.6
-SET &VALMIN2 = &VALMIN - 1;
-SET &VALMAX2 = &VALMAX + 1;


Just add/substract 1 from the values and use these 2 new variables in the GRAPH-settings.
It still is not a bullet-proof solution, but maybe you can play with these values (or determine the difference between the MIN and MAX
and that will be the bandwidth of your graph ??).

-Fred
 
Report This Post
Member
posted Hide Post
hmm, you know, that's not bad either. All I need is that horizontal line towards the top of the chart, the customer cant' tell if it's a series at 99 or 100. Nice. Smiler

I'll try that and see if that works Smiler

Thanks again Fred!


WebFOCUS v. 7.6.10
___________________
Win2k3 Server
Intel Xeon 2.3Ghz/4Gb Ram Apache / IIS / SQL Srvr 2005
 
Posts: 29 | Location: Bellingham, WA | Registered: October 01, 2008Report This Post
Member
posted Hide Post
I think it might have worked that time, great idea. I'm going to test it on a measure to verify, but that was probably the answer to the question!

Thanks so very much Smiler


WebFOCUS v. 7.6.10
___________________
Win2k3 Server
Intel Xeon 2.3Ghz/4Gb Ram Apache / IIS / SQL Srvr 2005
 
Posts: 29 | Location: Bellingham, WA | Registered: October 01, 2008Report This Post
<FreSte>
posted
Peter,

Glad it worked out, but as I said, it's not bullitproof. I was thinking the other day that an extra condition should be build in; only if the MIN and MAX value are 0 or 100, this "correction" is required.

Cheers,
-Fred-

This message has been edited. Last edited by: <FreSte>,
 
Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Help with formatting a sparkline / line graph?

Copyright © 1996-2020 Information Builders