Last active
August 8, 2018 09:00
-
-
Save GordonSmith/6c79c4246d10875ec89faec88c4b55e9 to your computer and use it in GitHub Desktop.
Revisions
-
GordonSmith revised this gist
Aug 8, 2018 . 3 changed files with 50 additions and 22 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,28 @@ __Tutorial 3__: Switch from Pie to Column. So [Pie Charts](https://bl.ocks.org/GordonSmith/913403c91d45b11473baa82d0ba790a4) are so last year, lets switch it up to a Column Chart: __1__ - Import the required visualization: ```javascript import { Column } from "@hpcc-js/chart"; ``` __2__ - Instantiate and render the visualisation: ```javascript var widget = new Column() // Create new instance of Column .target("placeholder") // Nominate target on web page .columns(["Subject", "Result"]) // Set "Columns" .data([ // Set "Data" ["English", 45], ["Irish", 28], ["Math", 98], ["Geography", 48], ["Science", 82] ]) .render() // Render ; ``` Note 1: The only difference between this example and the previous [one](https://bl.ocks.org/GordonSmith/913403c91d45b11473baa82d0ba790a4) is the change from "Pie" to "Column" this demonstrates one of the key features of the @hpcc-js visualization framework - the ability to switch easily between visualisations for a single data "shape". Note 2: To discover all the available "published properties" for the `Column` Widget see: [Dermatology-Column](https://rawgit.com/hpcc-systems/Visualization/master/demos/dermatology/index.html?src/chart/Column.simple) and enable the "Properties" view. This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,29 +1,23 @@ <!DOCTYPE html> <html> <head> <title>Column Chart</title> <meta charset="utf-8" /> <link rel="stylesheet" href="./index.css"> <!-- GetLibs: An in-browser module loader for quick demos --> <script src="https://unpkg.com/getlibs"></script> </head> <body> <div id="placeholder"> <!-- Placeholder for Visualization --> </div> <script> // Load Example JavaScript (via GetLibs)--- System.import('./index.js'); </script> </body> </html> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ import { Column } from "@hpcc-js/chart"; var widget = new Column() // Create new instance of Column .target("placeholder") // Nominate target on web page .columns(["Subject", "Result"]) // Set "Columns" .data([ // Set "Data" ["English", 45], ["Irish", 28], ["Math", 98], ["Geography", 48], ["Science", 82] ]) .render() // Render ; -
GordonSmith revised this gist
Sep 17, 2016 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
LoadingSorry, something went wrong. Reload?Sorry, we cannot display this file.Sorry, this file is invalid so it cannot be displayed. -
GordonSmith renamed this gist
Sep 17, 2016 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
GordonSmith revised this gist
Sep 17, 2016 . No changes.There are no files selected for viewing
-
GordonSmith revised this gist
Sep 17, 2016 . 6 changed files with 48 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ license: Apache-2.0 This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +0,0 @@ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ body { padding:0px; margin:0px; overflow:hidden; } #placeholder { width:100%; height:100vh; } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ <!DOCTYPE html> <html> <head> <title>Hello World</title> <meta charset="utf-8" /> <link rel="stylesheet" href="index.css"> <script src="http://viz.hpccsystems.com/v1.14.4/dist-amd/hpcc-viz.js"></script> </head> <body> <div id="placeholder"> </div> <script> require(["src/chart/Column"], function (Column) { var widget = new Column() // Create new instance of TextBox .target("placeholder") // Nominate target on web page .columns(["Subject", "Result"]) // Set "Columns" .data([ // Set "Data" ["English", 45], ["Irish", 28], ["Math", 98], ["Geography", 48], ["Science", 82] ]) .render() // Render ; }); </script> </body> </html> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ Tutorial 3: Switch from Pie to Column. So Pie Charts are so last year, lets switch it up to a Column Chart: ``` require(["src/chart/Column"], function (Column) { var widget = new Column() ... ``` LoadingSorry, something went wrong. Reload?Sorry, we cannot display this file.Sorry, this file is invalid so it cannot be displayed. -
GordonSmith created this gist
Sep 17, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ Column Chart