{"id":9544,"date":"2014-03-12T11:00:11","date_gmt":"2014-03-12T18:00:11","guid":{"rendered":"http:\/\/blog.xamarin.com\/?p=9544"},"modified":"2014-03-12T11:00:11","modified_gmt":"2014-03-12T18:00:11","slug":"building-enterprise-dashboards-for-ipads-and-iphones-using-nuclios","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/xamarin\/building-enterprise-dashboards-for-ipads-and-iphones-using-nuclios\/","title":{"rendered":"Building Enterprise Dashboards on the iPhone and iPad"},"content":{"rendered":"<p dir=\"ltr\">Over the years traditional desktop applications have excelled at rendering large amounts of data on large multi-monitor configurations by leveraging beautiful dashboard and graphing controls from .NET vendors. The enterprise landscape has evolved into a bring your own device workplace and enterprise applications have also started to evolve to adjust for this shift. It is now up to development teams to reimagine their applications from a point and click mouse experience to a beautiful touch based mobile experience that can deliver a truly native experience on each platform. Mobile users desire easy content consumption with simple touch interactions and blazingly fast native performance to fully immerse them visually. They want to get to the data they are most interested in and get to that data quickly.<\/p>\n<p style=\"text-align: center\">\u00a0<img decoding=\"async\" class=\" wp-image-9546 aligncenter\" alt=\"nuclios-charts\" src=\"\/wp-content\/uploads\/sites\/44\/2019\/04\/nuclios-charts-1-1024x783.png\" width=\"819\" height=\"626\" \/><\/p>\n<p dir=\"ltr\">With Xamarin you can create beautiful native experiences for all types of mobile application including bringing these dashboards to mobile devices. We understand that mobile developers need to deliver alluring apps for enterprises and consumers by embracing native platform features while still being highly productive in their development environment. We have a rich ecosystem of components and controls to get developers up and running immediately with highly performing, visual, and customizable controls that meet business requirements. This of course includes dashboards that you can bring to your applications.<\/p>\n<p><img decoding=\"async\" class=\" wp-image-9545 alignright\" alt=\"Nuclios-Logo\" src=\"\/wp-content\/uploads\/sites\/44\/2019\/04\/Nuclios-Transparent.png\" width=\"315\" height=\"57\" \/><\/p>\n<p style=\"text-align: left\">One of these controls is from Infragistics who published their <a href=\"http:\/\/components.xamarin.com\/view\/InfragisticsNucliOS\">NucliOS component<\/a> on the Xamarin Component Store, featuring over 40 different charts optimized for mobile. NucliOS has a wide range of controls to help visualize and analyze large volumes of data ranging from advanced scientific and financial charts, data grids, pie charts, radial gauges, and more. They even have a free iOS app to browse all of the controls featured in NucliOS, which is available on the <a href=\"https:\/\/itunes.apple.com\/us\/app\/nuclios-controls-for-ios\/id564816866\">Apple App Store<\/a>.<\/p>\n<p>NucliOS has tons of awesome controls, which I can&#8217;t attempt to show off in just a single post. So, for this example I am going to get you started by showing you how to make a bar chart using the <em>IGChartView<\/em> control. You can then take it from there to completely customize it as it can render more than 40 different chart types! <\/p>\n<h2>Getting Started<\/h2>\n<p dir=\"ltr\">To get started with NucliOS controls you can either purchase the component from the component store or elect for the \u201cTry\u201d option to start a free trial right away.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-9550\" alt=\"NucliOS-GetStarted\" src=\"\/wp-content\/uploads\/sites\/44\/2019\/04\/NucliOS-GetStarted.png\" width=\"949\" height=\"259\" \/><\/p>\n<p>After you have the component we can started by setting up a data source for the bar chart.\u00a0<\/p>\n<h3>Identify a Data Source<\/h3>\n<p dir=\"ltr\">We will need some sort of data source to feed into our chart. For this example I am going to use something very familiar, Microsoft\u2019s Northwind Database. Northwind is exposed as an <a href=\"http:\/\/services.odata.org\/Northwind\/Northwind.svc\/\" target=\"_blank\">oData Service<\/a> with all sorts of sample data including employees, customers, orders, and products. I will consume this oData feed using the <a href=\"https:\/\/github.com\/object\/Simple.OData.Client\" target=\"_blank\">Simple.oData.Client<\/a> portable class library, which handles connecting to and fetching the data to create a dashboard displaying sales for products based on their categories.<\/p>\n<p>Here is what my <strong>Model<\/strong> looks like for the data: <\/p>\n<pre class=\"lang:csharp decode:true\">\n public class SalesByCategory {\n    public SalesByCategory ()\n    {\n        ProductName = new List ();\n        ProductSales = new List ();\n\n    }\n    public List ProductName{\n        get;\n        set;\n    }\n\n    public List ProductSales{\n        get;\n        set;\n    }\n}\n<\/pre>\n<p>Next up I will create a simple helper method that will query Northwind and grab the top 15 selling products by category:<\/p>\n<pre class=\"lang:csharp decode:true\">\n async Task GetDataAsync() {\n    var client = new ODataClient(&quot;http:\/\/services.odata.org\/Northwind\/Northwind.svc\/&quot;);\n    var salesData = await client.For (&quot;Sales_by_Categories&quot;).Top(15).OrderBy(&quot;ProductSales&quot;).FindEntriesAsync();\n\n    SalesByCategory salesByCategory = new SalesByCategory();\n    foreach (var sale in salesData) {\n        salesByCategory.ProductName.Add (NSObject.FromObject(sale[&quot;ProductName&quot;].ToString()));\n        salesByCategory.ProductSales.Add (NSObject.FromObject(sale[&quot;ProductSales&quot;].ToString()));\n    }\n    return salesByCategory;\n}\n<\/pre>\n<p dir=\"ltr\">With this data I can visualize it by feeding it into an\u00a0<em>IGChartView<\/em> with the help of <em>IGCategorySeriesDataSourceHelper<\/em> :<\/p>\n<pre class=\"lang:csharp decode:true\">\nvar data = await GetDataAsync ();\n\/\/ set data source\nIGCategorySeriesDataSourceHelper barSeriesSource = new IGCategorySeriesDataSourceHelper();\nbarSeriesSource.Values = data.ProductSales.ToArray();\nbarSeriesSource.Labels = data.ProductName.ToArray();\n<\/pre>\n<h3>Create Axises<\/h3>\n<p dir=\"ltr\">We are going to create a 2D chart, so I will set the X and Y axis to chart the data of the product&#8217;s sales and product name respectively.<\/p>\n<pre class=\"lang:csharp decode:true\">\n\/\/ Create axis types and add it to the chart\nIGNumericXAxis xAxisBar = new IGNumericXAxis (&quot;xAxis&quot;);\nIGCategoryYAxis yAxisBar = new IGCategoryYAxis (&quot;yAxis&quot;);\n<\/pre>\n<h3>Create Series<\/h3>\n<p dir=\"ltr\">As mentioned earlier, I am going to plot this data in a bar series. To do this will set it&#8217;s data source from which we created earlier with the help of\u00a0<em>IGCategorySeriesDataSourceHelper<\/em><\/p>\n<pre class=\"lang:csharp decode:true\">\n\/\/ decide on what series need to be displayed on the chart\nIGBarSeries barSeries= new IGBarSeries (&quot;series&quot;);\nbarSeries.XAxis = xAxisBar;\nbarSeries.YAxis = yAxisBar;\n\/\/ set the appropriate data sources\nbarSeries.DataSource = barSeriesSource;\n<\/pre>\n<h3>Putting it all together<\/h3>\n<p dir=\"ltr\">Now all we have to do is set the IGChartView axis, series, and location to finalize the visualization our data.<\/p>\n<pre class=\"lang:csharp decode:true\">\nvar chart = new IGChartView(this.View.Bounds);\nchart.AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth;\nchart.AddAxis(xAxisBar);\nchart.AddAxis(yAxisBar);\nchart.AddSeries(barSeries);\n this.View.Add(chart);\n<\/pre>\n<p dir=\"ltr\">That\u2019s it! We now have a beautiful visualization of our data. <\/p>\n<p dir=\"ltr\"><img decoding=\"async\" class=\"alignnone size-full wp-image-9553\" alt=\"NucliOS-Chart-SalesData\" src=\"\/wp-content\/uploads\/sites\/44\/2019\/04\/NucliOS-Chart-SalesData.png\" width=\"768\" height=\"598\" \/><\/p>\n<p dir=\"ltr\">The <em>IGChartView<\/em> can be completely customized and changed with just a few lines of code. In fact, I can change this into a Column Series by simply changing my X and Y axis and setting up the chart as an <em>IGColumnSeries<\/em>:<\/p>\n<pre class=\"lang:csharp decode:true\">\nvar xAxisBar = new IGCategoryXAxis (&quot;xAxis&quot;);\nvar yAxisBar = new IGNumericYAxis (&quot;yAxis&quot;);\n\nvar columnSeries = new IGColumnSeries (&quot;series&quot;);\ncolumnSeries.XAxis = xAxisBar;\ncolumnSeries.YAxis = yAxisBar;\n<\/pre>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/sites\/44\/2019\/04\/Chart-1024x790.png\" alt=\"Column Series\" width=\"1024\" height=\"790\" class=\"aligncenter size-large wp-image-9894\" \/><\/p>\n<p dir=\"ltr\"><a href=\"https:\/\/github.com\/nishanil\/NorthwindSalesiOS\">You can download all of this source code to try it for yourself from GitHub.<\/a><\/p>\n<p dir=\"ltr\"><a href=\"http:\/\/forums.xamarin.com\/discussion\/13134\/\" target=\"_blank\"><em>Discuss this blog post in the Xamarin Forums<\/em><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Over the years traditional desktop applications have excelled at rendering large amounts of data on large multi-monitor configurations by leveraging beautiful dashboard and graphing controls from .NET vendors. The enterprise landscape has evolved into a bring your own device workplace and enterprise applications have also started to evolve to adjust for this shift. It is [&hellip;]<\/p>\n","protected":false},"author":547,"featured_media":39167,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2,3],"tags":[6,4],"class_list":["post-9544","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-developers","category-enterprise","tag-ios","tag-xamarin-platform"],"acf":[],"blog_post_summary":"<p>Over the years traditional desktop applications have excelled at rendering large amounts of data on large multi-monitor configurations by leveraging beautiful dashboard and graphing controls from .NET vendors. The enterprise landscape has evolved into a bring your own device workplace and enterprise applications have also started to evolve to adjust for this shift. It is [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/posts\/9544","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/users\/547"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/comments?post=9544"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/posts\/9544\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/media\/39167"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/media?parent=9544"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/categories?post=9544"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/tags?post=9544"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}