Focal Point
[SOLVED] Spectral / Heat Map issue with NOPRINTS

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4217004386

August 11, 2016, 12:44 PM
krhapner
[SOLVED] Spectral / Heat Map issue with NOPRINTS
I am trying to order by HIGHEST TOTAl dollars, but for some odd reason instead of printing the state name on the y-axis, this prints the highest total dollars (as a number). This only happens on a heat map / spectral graph.
quote:

GRAPH FILE GGSALES
SUM DOLLARS AS ''
BY HIGHEST TOTAL DOLLARS NOPRINT
BY ST
ACROSS DATE AS ''
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET HTMLENCODE ON
ON GRAPH SET GRAPHDEFAULT OFF
ON GRAPH SET ARGRAPHENGIN JSCHART
ON GRAPH SET VZERO ON
ON GRAPH SET GRWIDTH 1
ON GRAPH SET GRMERGE ON
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 1
ON GRAPH SET LOOKGRAPH SPECTRAL
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
END


So, what I really want is the state to be on the y-axis, the date to be on the x-axis. The most dense colors should appear at the top of the heat map because it should be ordered by highest total dollars.

I have changed the GRXAXIS + the GRMERGE with no luck.

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


WebFOCUS 8
Windows, All Outputs
August 11, 2016, 11:08 PM
David Briars
quote:
... state to be on the y-axis, the date to be on the x-axis. The most dense colors should appear at the top of the heat map because it should be ordered by highest total dollars...

There are probably different ways to do this.

Here is one possible approach.



SET ASNAMES = ON
-*
-* Summarize Dollars by State and by State/Date
-*
TABLE FILE GGSALES
SUM DOLLARS
BY HIGHEST TOTAL DOLLARS AS 'TOTAL_DOLLARS'
BY ST 
SUM DOLLARS AS 'DAY_DOLLARS'
BY HIGHEST TOTAL DOLLARS
BY ST 
BY DATE 
ON TABLE HOLD AS HOLD1 
END
-RUN
-*
-* Create Yaxis (State) Labels.  
-*
TABLE FILE HOLD1
PRINT TOTAL_DOLLARS
      DATE
      DAY_DOLLARS
      ST
COMPUTE ST_YAXIS/I2 = IF ST EQ LAST ST THEN ST_YAXIS ELSE ST_YAXIS + 1;
COMPUTE NEW_ST/A100 = '/*' | EDIT(ST_YAXIS) | '*/' | ST; 
ON TABLE HOLD AS HOLD2
END
-RUN
-*
-* Create Spectral Visualization.
-*
GRAPH FILE HOLD2
SUM DAY_DOLLARS AS ''
BY  NEW_ST AS 'State'  
ACROSS DATE AS ''
ON GRAPH PCHOLD FORMAT JSCHART
ON GRAPH SET LOOKGRAPH SPECTRAL
ON GRAPH SET GRMERGE ADVANCED
ON GRAPH SET GRMULTIGRAPH 0
ON GRAPH SET GRLEGEND 0
ON GRAPH SET GRXAXIS 2
ON GRAPH SET AUTOFIT ON
ON GRAPH SET STYLE *
-*
*GRAPH_SCRIPT
  setLegendPosition(2);
  setToolTipStyle('html5');
*END
-*
*GRAPH_JS
  title: {text: 'Sales Heat Map', visible: true},
  subtitle: {text: 'Sales By Highest State Across Date', visible: true},
  yaxis: {title: {visible: true, text:'Sales'}},
  xaxisOrdinal: {title: {visible: true, text:'Date'}}
*END
ENDSTYLE
END
-EXIT 

August 12, 2016, 12:50 PM
GavinL
quote:
yaxis: {title: {visible: true, text:'Sales'}},


To add to David's example, I prefer 3 colors, because 2 color has a tendency to be too faded in the middle.

yaxis: {title: {visible: true, text:'Sales'}, mode: 'color', colorScale: {colors: ['red','yellow','green']}},




- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
August 12, 2016, 12:57 PM
Tony A
Ah, the water melon chart!

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
August 18, 2016, 03:14 PM
krhapner
That works - thanks!


WebFOCUS 8
Windows, All Outputs