Use http://webwidgets-qa.longboatatanalytics.com for Development and Quality Assurance environments
Use http://webwidgets.longboatatanalytics.com for production environments.
Do not add libraries if you are already using then in your website. For expample Jquery.
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" /> <link rel="stylesheet" href="http://webwidgets-qa.longboatatanalytics.com/bower_components/jquery-ui-1.11.2.custom/jquery-ui.min.css" /> <script src="http://webwidgets-qa.longboatatanalytics.com/bower_components/handlebars/handlebars.min.js"></script> <script src="http://webwidgets-qa.longboatatanalytics.com/bower_components/jquery/dist/jquery.min.js"></script> <script src="http://webwidgets-qa.longboatatanalytics.com/bower_components/jquery-ui-1.11.2.custom/jquery-ui.min.js"></script> <script src="http://webwidgets-qa.longboatatanalytics.com/bower_components/flot/jquery.flot.js"></script> <script src="http://webwidgets-qa.longboatatanalytics.com/bower_components/flot/jquery.flot.time.min.js"></script> <script src="http://webwidgets-qa.longboatatanalytics.com/bower_components/flot/jquery.flot.selection.min.js"></script>
Add always these files to your website.
<link rel="stylesheet" href="http://webwidgets-qa.longboatatanalytics.com/Stylesheet/widgets.css" /> <script src="http://webwidgets-qa.longboatatanalytics.com/Scripts/Widgets.js"></script>
Add the following HTML code to your website.
<button class="btn">Click Me!</button>
<div id="fund_comparison_container">
<!-- Genetared code will be inserted here -->
</div>
Execute the following JavaScript code.
// Configure WebWidgets library
var LAWWGT = new LongboatAnalyticsWebWidgets({
apiKey: "db34b5f1-08c5-4ef7-8027-b4d2363ce350",
serviceHost: "http://webwidgets-qa.longboatanalytics.com/" // remove -qa in production
});
// Initialize WebWidgets library
LAWWGT.initialize(function () {
// Fund details
var entities = [
{ entityType: LAWWGT.EntityTypeEnum.Fund, id: 25000256, countryCode: "IE", selected: true },
{ entityType: LAWWGT.EntityTypeEnum.Fund, id: 25000257, countryCode: "IE", selected: false },
{ entityType: LAWWGT.EntityTypeEnum.Fund, id: 25000258, countryCode: "IE", selected: false },
{ entityType: LAWWGT.EntityTypeEnum.Fund, id: 25000259, countryCode: "IE", selected: false },
{ entityType: LAWWGT.EntityTypeEnum.Fund, id: 25000260, countryCode: "IE", selected: true },
{ entityType: LAWWGT.EntityTypeEnum.Fund, id: 25000261, countryCode: "IE", selected: false },
{ entityType: LAWWGT.EntityTypeEnum.Fund, id: 25000262, countryCode: "IE", selected: false },
{ entityType: LAWWGT.EntityTypeEnum.Fund, id: 25000263, countryCode: "IE", selected: true },
{ entityType: LAWWGT.EntityTypeEnum.Fund, id: 25000264, countryCode: "IE", selected: false },
{ entityType: LAWWGT.EntityTypeEnum.Fund, id: 25000265, countryCode: "IE", selected: false },
{ entityType: LAWWGT.EntityTypeEnum.Fund, id: 25001038, countryCode: "IE", selected: true },
{ entityType: LAWWGT.EntityTypeEnum.Fund, id: 25001251, countryCode: "IE", selected: false },
{ entityType: LAWWGT.EntityTypeEnum.Fund, id: 25001254, countryCode: "IE", selected: false },
{ entityType: LAWWGT.EntityTypeEnum.Fund, id: 25001340, countryCode: "IE", selected: true },
{ entityType: LAWWGT.EntityTypeEnum.Fund, id: 25001341, countryCode: "IE", selected: false },
{ entityType: LAWWGT.EntityTypeEnum.Fund, id: 25001342, countryCode: "IE", selected: false }
];
// Create Fund Comparison Widget
var fundComparisonWgt = new LAWWGT.widgets.FundComparisonWidget({
placeholder: "#fund_comparison_container",
entities: entities,
dateFrom: new Date().getTime(), // TODAY
dateTo: new Date().setFullYear((new Date().getFullYear() - 1)) // ONE YEAR FROM TODAY
});
// initialize widget
fundComparisonWgt.initialize();
// Show widget when we click on the button
$(".btn").on("click", function (e) {
fundComparisonWgt.show();
});
});
Copyright © 2014 Longboat Analytics