HTML elements

There are two parameters required for HTML elements:

id
Specify an identifier for the data element. The Custom Search Dashboard uses this value to determine the data that is displayed. In the application file, the chart specifications use this id to specify the data element used for the chart.
htmltext
Specify the HTML that you want to display. A HTML portlet is used to display the HTML that you specify.

Example

This is a sample JSON output which contains both the types of output which contains both chart data and HTML output:
{
    "data":[
        {
            "id":"ErrorsWarningsVsTime",
            "fields":[
                {
                    "id":"timestamp",
                    "label":"Date",
                    "type":"TEXT"
                },
                {
                    "id":"severity",
                    "label":"severity",
                    "type":"TEXT"
                },
                {
                    "id":"count",
                    "label":"count",
                    "type":"LONG"
                }
            ],
            "rows":[
                {
                    "timestamp":"10-21 13:00",
                    "severity":"W",
                    "count": 221
                },
                {
                    "timestamp":"10-21 13:00",
                    "severity":"E",
                    "count": 204
                }
            ]
        },
        {
            "id":"htmlData",
            "htmltext":",<!DOCTYPE html><html><body><div><h1>Sample HTML</h1>
            </div></body></html>" 
        }
     ]
 }

In this example, the data id ErrorsWarningsVsTime is defined in the script.

chartdata.append({
'id':'ErrorsWarningsVsTime',
'fields':facetFields, 
'rows':facetRows})

In the application file chart specification, the id ErrorsWarningsVsTime is referenced to specify the data set used in the chart.

{
	                        "type": "Tree Map",
	                        "title": "Messages by Hostname - Top 5 over Last Day",
	                        "data": {
	                            "$ref": "ErrorsWarningsVsTime"
	                        },
	                        "parameters": {
	                            "level1": "date",
	                            "level2": "count",
	                            "level3": "severity",
	                            "value": "count"
	                        }

Launching a new context tab in a HTML Custom Search Dashboard

You can provide a link within a HTML Custom Search Dashboard that launches a URL in a new tab within the Custom Search Dashboard. The search or Custom Search Dashboard is executed with the context parameters that you specify in the URL.

This example contains the URLs to launch searches with search parameters within a Custom Search Dashboard:
{
	"id": "htmlData",
	"htmltext": "<!DOCTYPE html><html><body><br><div>
	<a href=http://www.espncricinfo.com//>Normal URL - 
	-  ESPN Cricinfo</a>
	</div><br><div><a href=https://192.168.56.101:9987/Unity/CustomApps
	UI?name=All%20Supported%20Visualizations&appParameters=[]>Custom App LIC 
	- - All Supported Visualizations</a></div><br><div><a href=https://192.168.56.101:99
	87/Unity/SearchUI?queryString=diagnosticLevel:==Warning&timefilters=
	{\"type\":\"relative\",\"lastnum\":\"1\",\"granularity\":\"year\"}&d
	ataSources=[{\"type\":\"datasource\",\"name\":\"/DB2Diag1\"}]>Sear
	ch UI LIC - - DB Log Events with Diagnostic Level - Warning</a></div>
	<br><div><a href=https://192.168.56.101:9987/Unity/SearchUI?querySt
	ring=diagnosticLevel:==Severe&timefilters={\"type\":\"relative\",\"la
	stnum\":\"1\",\"granularity\":\"year\"}&dataSources=[{\"type\":\"datasour
	ce\",\"name\":\"/DB2Diag1\"}]>Search UI LIC - - DB Log Events with Diag
	nostic Level - Severe</a></div></body></html>" }
Note: Any spaces that are required in your URL must be escaped. If you want to include a % character in your URL in must be added as %25.