In this Angular getting started guide, you'll learn how to use the BubbleChart widget in an HTML project using HTML markup, jQuery script, and AngularJS directives.
For more complex samples that have the controller and model in separate files, see Wijmo Charts in the AngularJS Directive Gallery on our web site.
Drop down and copy markup
Paste in your favorite text editor. |
Copy Code |
---|---|
<!DOCTYPE HTML> <HTML ng-app="MyApp"> <head> </head> <body ng-controller="MyController"> </body> </HTML> |
Drop down and copy references to paste inside the head tags
References |
Copy Code |
---|---|
<!-- jQuery --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" type="text/javascript"></script> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.0/jquery-ui.min.js" type="text/javascript"></script> <!--Theme--> <link href="http://cdn.wijmo.com/themes/aristo/jquery-wijmo.css" rel="stylesheet" type="text/css" /> <!--Wijmo Widgets CSS--> <link href="http://cdn.wijmo.com/jquery.wijmo-pro.all.3.20183.140.min.css" rel="stylesheet" type="text/css" /> <!-- Wijmo Scripts --> <script src="http://cdn.wijmo.com/jquery.wijmo-open.all.3.20161.90.min.js" type="text/javascript"></script> <script src="http://cdn.wijmo.com/jquery.wijmo-pro.all.3.20161.90.min.js" type="text/javascript"></script> <!-- Angular --> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js"></script> <script src="http://cdn.wijmo.com/interop/angular.wijmo.3.20161.90.min.js"></script> |
Script |
Copy Code |
---|---|
<script type="text/javascript"> var app = angular.module("MyApp", ["wijmo"]); //Company class function Company(data) { this.NumberOfProducts = data.NumberOfProducts; this.CompanySales = data.CompanySales; this.MarketShare = data.MarketShare; }; function MyController($scope, $locale) { $scope.list = [ new Company({ NumberOfProducts: 14, CompanySales: 12200, MarketShare: .15 }), new Company({ NumberOfProducts: 20, CompanySales: 60000, MarketShare: .23 }), new Company({ NumberOfProducts: 18, CompanySales: 24400, MarketShare: .1 }) ]; $scope.A = [new Company({ NumberOfProducts: 14, CompanySales: 12200, MarketShare: .15 })]; $scope.B = [new Company({ NumberOfProducts: 20, CompanySales: 60000, MarketShare: .23 })]; $scope.C = [new Company({ NumberOfProducts: 18, CompanySales: 24400, MarketShare: .1 })] } </script> |
Markup |
Copy Code |
---|---|
<wij-bubblechart data-source="list" height="400" width="600" chart-label-format-string="p0"> <axis> <x text="Sales" anno-format-string="C0"> <grid-major visible="true" style="stroke-dasharray:"""></grid-major> <grid-minor visible="true"></grid-minor> </x> <y text="Number of Products"></y> </axis> <chart-label-style fill="white"></chart-label-style> <header text="Market Share by Company"></header> <legend visible="false"></legend> <series-list> <series label="Company Products"> <data> <x bind="NumberOfProducts"></x> <y bind="CompanySales"></y> <y1 bind="MarketShare"></y1> </data> </series> </series-list> </wij-bubblechart> |
MISSING WIDGET TYPE: The "Live Widget" Widget Type could not be found. The "Live Widget" Widget Type may have been deleted since this Widget was created. |