January 19, 2017, 11:53 AM
SquatchIt appears that, for treemap charts, WebFOCUS knows what is best for you.
Here is the JavaScript generated for the tree map example posted above... the custom series/tooltip requests seem to be overridden:
var chart = new tdgchart({backend:'js', allowBackendFallback:true});
chart.data = [];
chart.title.text = '';
chart.width = 760;
chart.height = 400;
chart.parsePFJString(script);
// CUSTOM CHART SET COMMANDS, WHICH WILL BE OVERRIDDEN LATER FOR TREEMAP CHART
chart.set({
// The following properties are from the *GRAPH_JS section of the stylesheet:
htmlToolTip: {enabled: true, snap:true}
});
chart.set({
series: [
{series: 'reset', tooltip: function(v, s, g) {return 'Customized Tooltip <br/>' + 'Value: ' + v
+'<br/>Series: ' + s +'<br/>Group: ' + g;}}
]
});
// THE DATA
chart.set({
// The following properties were generated by the Reporting Server:
data: [
['CA', undefined, undefined]
,['Biscotti', 'CA', [18887.00, 43760.00]]
,['Capuccino', 'CA', [9713.00, 46533.00]]
,['Coffee Grinder', 'CA', [22867.00, 31709.00]]
,['Coffee Pot', 'CA', [-19419.00, 31061.00]]
,['Croissant', 'CA', [17043.00, 131263.00]]
,['Espresso', 'CA', [-9525.00, 47647.00]]
,['Latte', 'CA', [-22942.00, 141403.00]]
,['Mug', 'CA', [26723.00, 59763.00]]
,['Scone', 'CA', [15098.00, 47688.00]]
,['Thermos', 'CA', [-2531.00, 29743.00]]
,['CT', undefined, undefined]
,['Biscotti', 'CT', [1854.00, 46214.00]]
,['Capuccino', 'CT', [17421.00, 12386.00]]
,['Coffee Grinder', 'CT', [10288.00, 13691.00]]
,['Coffee Pot', 'CT', [11158.00, 15523.00]]
,['Croissant', 'CT', [-28679.00, 45847.00]]
,['Espresso', 'CT', [-20481.00, 22482.00]]
,['Latte', 'CT', [-27803.00, 74623.00]]
,['Mug', 'CT', [-31366.00, 31728.00]]
,['Scone', 'CT', [14653.00, 22378.00]]
,['Thermos', 'CT', [2802.00, 17568.00]]
,['FL', undefined, undefined]
,['Biscotti', 'FL', [-5387.00, 40606.00]]
,['Capuccino', 'FL', [31833.00, 24143.00]]
,['Coffee Grinder', 'FL', [10777.00, 16968.00]]
,['Coffee Pot', 'FL', [-3410.00, 16145.00]]
,['Croissant', 'FL', [-42808.00, 50175.00]]
,['Espresso', 'FL', [20008.00, 19730.00]]
,['Latte', 'FL', [3422.00, 71123.00]]
,['Mug', 'FL', [18230.00, 31628.00]]
,['Scone', 'FL', [12289.00, 24543.00]]
,['Thermos', 'FL', [7856.00, 15241.00]]
,['GA', undefined, undefined]
,['Biscotti', 'GA', [-13512.00, 43639.00]]
,['Capuccino', 'GA', [-32120.00, 27522.00]]
,['Coffee Grinder', 'GA', [15153.00, 16968.00]]
,['Coffee Pot', 'GA', [-15237.00, 18431.00]]
,['Croissant', 'GA', [-5128.00, 53782.00]]
,['Espresso', 'GA', [-9677.00, 25947.00]]
,['Latte', 'GA', [-38190.00, 73707.00]]
,['Mug', 'GA', [-28815.00, 29746.00]]
,['Scone', 'GA', [-21466.00, 22863.00]]
,['Thermos', 'GA', [1512.00, 17678.00]]
,['IL', undefined, undefined]
,['Biscotti', 'IL', [-6957.00, 29413.00]]
,['Coffee Grinder', 'IL', [-8419.00, 19339.00]]
,['Coffee Pot', 'IL', [-3427.00, 15785.00]]
,['Croissant', 'IL', [21111.00, 43300.00]]
,['Espresso', 'IL', [18962.00, 32237.00]]
,['Latte', 'IL', [13553.00, 77344.00]]
,['Mug', 'IL', [-11858.00, 30157.00]]
,['Scone', 'IL', [27838.00, 45355.00]]
,['Thermos', 'IL', [6742.00, 14651.00]]
,['MA', undefined, undefined]
,['Biscotti', 'MA', [-46375.00, 47064.00]]
,['Capuccino', 'MA', [-18403.00, 15358.00]]
,['Coffee Grinder', 'MA', [-9746.00, 14382.00]]
,['Coffee Pot', 'MA', [48.00, 15349.00]]
,['Croissant', 'MA', [-22088.00, 41029.00]]
,['Espresso', 'MA', [-5954.00, 19698.00]]
,['Latte', 'MA', [-23701.00, 74572.00]]
,['Mug', 'MA', [327.00, 32360.00]]
,['Scone', 'MA', [20482.00, 25363.00]]
,['Thermos', 'MA', [-5001.00, 16734.00]]
,['MO', undefined, undefined]
,['Biscotti', 'MO', [7674.00, 29188.00]]
,['Coffee Grinder', 'MO', [10069.00, 14614.00]]
,['Coffee Pot', 'MO', [-1298.00, 14807.00]]
,['Croissant', 'MO', [21262.00, 48941.00]]
,['Espresso', 'MO', [2268.00, 32596.00]]
,['Latte', 'MO', [45645.00, 77347.00]]
,['Mug', 'MO', [19364.00, 27040.00]]
,['Scone', 'MO', [3262.00, 37602.00]]
,['Thermos', 'MO', [6202.00, 15592.00]]
,['NY', undefined, undefined]
,['Biscotti', 'NY', [-2156.00, 51964.00]]
,['Capuccino', 'NY', [-18414.00, 17041.00]]
,['Coffee Grinder', 'NY', [-2984.00, 12904.00]]
,['Coffee Pot', 'NY', [6225.00, 15313.00]]
,['Croissant', 'NY', [-17937.00, 50518.00]]
,['Espresso', 'NY', [3640.00, 25947.00]]
,['Latte', 'NY', [5250.00, 73671.00]]
,['Mug', 'NY', [4936.00, 27409.00]]
,['Scone', 'NY', [6333.00, 22991.00]]
,['Thermos', 'NY', [-8950.00, 14568.00]]
,['TN', undefined, undefined]
,['Biscotti', 'TN', [12597.00, 35349.00]]
,['Capuccino', 'TN', [-12374.00, 21599.00]]
,['Coffee Grinder', 'TN', [10262.00, 13147.00]]
,['Coffee Pot', 'TN', [9371.00, 15346.00]]
,['Croissant', 'TN', [-19611.00, 52499.00]]
,['Espresso', 'TN', [-6224.00, 22353.00]]
,['Latte', 'TN', [27301.00, 64824.00]]
,['Mug', 'TN', [-11057.00, 27100.00]]
,['Scone', 'TN', [-17531.00, 26373.00]]
,['Thermos', 'TN', [4344.00, 16057.00]]
,['TX', undefined, undefined]
,['Biscotti', 'TX', [23381.00, 27504.00]]
,['Coffee Grinder', 'TX', [4051.00, 16440.00]]
,['Coffee Pot', 'TX', [-9404.00, 16564.00]]
,['Croissant', 'TX', [18.00, 46941.00]]
,['Espresso', 'TX', [15485.00, 36321.00]]
,['Latte', 'TX', [-3432.00, 76932.00]]
,['Mug', 'TX', [-16713.00, 29521.00]]
,['Scone', 'TX', [19961.00, 33170.00]]
,['Thermos', 'TX', [952.00, 16344.00]]
,['WA', undefined, undefined]
,['Biscotti', 'WA', [-16823.00, 26676.00]]
,['Capuccino', 'WA', [8478.00, 24635.00]]
,['Coffee Grinder', 'WA', [9253.00, 16372.00]]
,['Coffee Pot', 'WA', [2847.00, 16371.00]]
,['Croissant', 'WA', [2004.00, 65759.00]]
,['Espresso', 'WA', [-6799.00, 24028.00]]
,['Latte', 'WA', [-29371.00, 72517.00]]
,['Mug', 'WA', [4965.00, 34118.00]]
,['Scone', 'WA', [-17116.00, 25088.00]]
,['Thermos', 'WA', [-1919.00, 15905.00]]
],
treemapProperties: { internalLabelSeparator: '--;:;--' },
// TOO BAD, SO SAD :( ... WEBFOCUS APPEARS TO OVERRIDE CUSTOM TREEMAP SERIES/TOOLTIP REQUESTS
htmlToolTip: { enabled: true },
series: [ { series: 0, tooltip: 'auto' } ],
xaxis: { title: { text: 'PROFIT' } },
yaxis: { title: { text: 'Unit Sales' }, mode: 'color' },
chartType: 'treemap'
});
chart.draw('jschart_HOLD_0');
})();
Trying to intercept this code and remove the overriding commands before the HTML page initializes would be very tricky indeed, if it is even possible at all.