Sorry - either this article does not exist or you haven't been given permission to view it.
Knowledgebase

Using JS to create a modal menu using Sisense DOM service.

// making the prism dom injector look more friendly.
const $dom = prism.$injector.get('ux-controls.services.$dom')

// example of how information can be injected into the modal.
const info = 'hello world'

// creating HTML to be displayed by the modal
const popupHtml = `<div> ${info} </div>`

// setting up settings object for modal injector
const settings = {
  template: popupHtml,
  scope: 'fake',
  css: 'resize-modal',
  id: 'myModal'
} // Hack for $dom service

// create the modal using settings
$dom.modal(settings)

Cumulative Sum can be achieved across a sorted category by:

  • adding the value of the current item to the previous item,
  • where the item isn't the first item in the list.

This can be achieved on a widget level for each series with the following script.

widget.on('processresult', (widget, args) => {
  args.result.series.forEach((series) => {
    for (i = 1; i < series.data.length; i++) {
      series.data[i].y += series.data[i - 1].y
    }
  })
})

Running PHPMyAdmin locally to connect to a remote MySQL instance is made fast and easy with Docker.

Download Docker. This can be installed on Windows.

Open a cmd prompt and enter the following

docker pull phpmyadmin

This will install the PHPMyAdmin docker image

In the command prompt enter the following, changing IP with the IP of the MySQL server (this will work for MySQL hosted on AWS amongst others).

docker run --name myadmin -d -e PMA_HOST=IP -p 8080:80 phpmyadmin

Now access PHPMyAdmin in a web browser at http://localhost:8080/

Full documentation on docker commands for PHPMyAdmin is at: https://hub.docker.com/_/phpmyadmin

Most popular articles 
 
Newest articles 
 
Copyright © RAPID BI Pty Ltd 2020