Like what you see? Have a play with our trial version.

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info
titleNote
You can use all the functions that BaseAPI.loadreport takes (apart from reportId, instanceName and filterValues) with createReportElement too.

...

Allows annotations to be disabled.

...

Example

...

To disable all user interactivity on the report when using loadReport:

yellowfin.loadReport({

report

...

     interactions: {

            drillDown: false,

drillAnywhere: false,

drillThrough: false,

unitSelection: false,

brushing: false,

timeSlider: false,

drillBreadcrumbs: false,

seriesSelection: false,

annotations: false

     },

     element: document.querySelector(‘#reportElement’)

}).

Or when using the createReportElement function:

report.createReportElement({

     interactions: {

            drillDown: false,

drillAnywhere: false,

drillThrough: false,

unitSelection: false,

brushing: false,

timeSlider: false,

drillBreadcrumbs: false,

seriesSelection: false,

annotations: false

     }

});


sortAscending(fieldId)

...

Runs the report with the current state of the report applied. If the runReport function is triggered multiple times in a short period of time, the run report request will only be sent to the server once. 

Example

Re-run the report every 5 seconds after the report finishes running.

...

  • timeSeries
  • discreteTimeSeries
  • timeGranularity

Example

See the assistedInsightsRequestedByChart event reference for how to call runAssistedInsights using data from the chart .

...

  • metricDescription {String} (Optional): Description of the metric being used (eg, KPI). This is for UI purposes and is used only to add more information to the default compare panel.

Example

reportAPI.addListener('assistedInsightsRequestedByChart', event => {

let runAssistedInsightsData = event.eventData;

if (runAssistedInsightsData.type === 'compare' && runAssistedInsightsData.value2 == null) {

reportAPI.openComparePanel(runAssistedInsightsData.value1, runAssistedInsightsData.possibleValues, runAssistedInsightsData.metricDescription);

}

});

...

This requires the UUID of the Assisted Insights job. This is passed as eventData when the assistedInsightsInProgress event is triggered.

Example

reportAPI.addListener(‘assistedInsightsInProgress’, event => {

let assistedInsightsTaskUUID = event.eventData;

reportAPI.cancelAssistedInsights(assistedInsightsTaskUUID);

});

...

  • assistedInsightReportId {Number}: ID for the temporary Assisted Insights report. Returned in the data that is passed when the runAssistedInsights promise is resolved or when the assistedInsightsCompleted event is triggered.
Example

let runAssistedInsightsPromise = reportAPI.runAssistedInsights(data);

runAssistedInsightsPromise.then(assistedInsightsData => {

let reportId = assistedInsightsData.assistedInsightsReportId;

reportAPI.deleteTemporaryAssistedInsightsReport(reportId);

});

...

Function to call when the output type has completed. The parameters objects passed to this callback will vary depending on the output type that has been registered.

Example

Register a dataset output type and output the dataset:

...

The outputKey that you wish to de-register.

Example

Register a dataset type and then remove the output type from the report after it has completed once.

...

Clears all of the report interactions (drill, sorting, time sliders, etc.) from a report and then runs the report. This will not reset the filters associated with the report as it is possible that the filters object will be linked to multiple reports, so resetting a filter specifically for this report can have an unintentional effect on another report. If you want to completely reset the report use this function together with filters.resetFiltersToDefault() or filters.clear().

Example

Add a reset button that can reset the reports interactions, but not filters:

...

Returns whether or not the report has been drilled down. This will be true if any of the drill down fields on the report has been drilled down.

Example

console.log(report.isDrillDownApplied()); //Will return "false" as no drilling has been applied
report.drill(1, 'Agency');
console.log(report.isDrillDownApplied()); //Will now return "true" now that has drill down has been applied

...

The number of levels to drill up.

Example

Drill up a single level on a fieldId 1:

...

Drills up one level on all of the fields that are drillable in the report.

Example

Create a drill up button which drills the entire report up a level.

...

The field that you wish to reset drill on.

Example

Reset the drill of the entire report:

...

ChartId that you wish to apply the time slider values to.

Example

Set the time slider to show dates between 'August 2014' and 'November 2014':

...

  • MILLISECOND
    • SECOND
    • MINUTE
    • HOUR
    • DAY
    • WEEK
    • MONTH
    • YEAR
Example

Apply unit selection of MONTH to the reports default chart

...

  • categoryField
  • categoryFieldId (optional)
  • categoryKey (optional)
  • dashboardName: Name of the dashboard
  • dashboardUUID: UUID for the dashboard
  • metricDescription
  • metricField
  • parentReportId: ID for the report that the chart belongs to
  • possibleValues (optional): List of objects representing the values that can be used in a comparison analysis with value1
  • reportKey: key for the report that the chart belongs to
  • sourceId: ID for the Data Source used by the parentReport
  • type: type of Assisted Insights analysis (either ‘explain’ or ‘compare’)
  • value1: The value to be used in the analysis
  • value2 (optional): The second value to be used in a comparison analysis
  • viewId: ID for the view used by the parentReport
Example

reportAPI.addListener('assistedInsightsRequestedByChart', chartData => {

// This already contains all of the data we need to run Assisted Insights so we don’t need to make any additional changes to it

let newData = Object.assign({}, chartData.eventData);

let promise = this.reportAPI.runAssistedInsights(newData);

});

...

Triggered when runAssistedInsights is called.

Parameters

Nothing.

Example

reportAPI.addListener(assistedInsightsStarted, () => {

console.log(“Assisted Insights has started”);

};

...

  • value1 {String or number}: The “actual” value one. This is what will be used in the analysis. Equivalent to the value/rawValue that is passed to openComparePanel
  • valueOneFormatted {String or number}: The description of value one that will be displayed to the user. Equivalent to the description/formattedValue that is passed to openComparePanel
  • value2 {String or number}: The “actual” value two. This is what will be used in the analysis. Equivalent to the value/rawValue that is passed to openComparePanel
  • valueTwoFormatted {String or number}: The description of value two that will be displayed to the user. Equivalent to the description/formattedValue that is passed to openComparePanel
Example

this.reportAPI.addListener('compareValuesSelected', event => {

let comparisonValues = event.eventData;

// Combine them with the existing Assisted Insights data

let allData = Object.assign({}, assistedInsightsData, comparisonValues);

// Generate the assisted insights report

reportAPI.runAssistedInsights(allData);

});

...

Note: The task UUID refers to the UUID for the background task and is different to the Assisted Insights report ID, which is returned when the runAssistedInsights promise is resolved or the assistedInsightsCompleted event is triggered.

Example

reportAPI.addListener(‘assistedInsightsInProgress’, event => {

let assistedInsightsTaskUUID = event.eventData;

reportAPI.cancelAssistedInsights(assistedInsightsTaskUUID);

});

...

  • progressText {String}: A string containing translated updates on the current progress of the assisted insights task. Useful for rendering updates to the user on a custom loader
  • state {String}: Current state of the background task. Can be Queued, Running or Complete
Example

reportAPI.addListener(‘assistedInsightUpdate’, event => {

let progressData = event.eventData;

let customLoader = document.getElementById("myCustomLoader").

customLoader.innerHTML(progressData.progressText);

});

...

  • assistedInsightsReportId {Number}: ID for the temporary Assisted Insights report. This is required when calling deleteTemporaryAssistedInsightsReport
  • chartData {Object}: Object containing Assisted Insights data objects to be rendered in the display panel
    • assistedInsightsImage {base64 String}: Image of the Assisted Insights chart
    • assistedInsightsZoomedImage {base64 String}: Larger version the image of the Assisted Insights chart
    • chartId {Number}: ID for the chart
    • narratives {Array}: Formatted text outlining the Assisted Insights findings
Example

reportAPI.addListener('assistedInsightsCompleted', data => {

// Display the report results

reportAPI.displayAssistedInsightsData(data.eventData);

});

...

  • UUID of the cancelled task
Example

reportAPI.addListener(‘assistedInsightsCancelled’, event => {

console.log(“Task ” + event.eventData + “ has been cancelled”);

});

...

  • getMessageText {function}: Generic error message indicating an error has occurred
Example

reportAPI.addListener(‘assistedInsightsError’, event => {

console.log(event.eventData.getMessageText());

});

...

  • errorMessage: Generic error message indicating that the analysis could not be completed
Example

reportAPI.addListener(‘assistedInsightsExceptionError’, event => {

console.log(event.eventData.errorMessage);

});

...