Quantcast
Channel: Infragistics Community
Viewing all 2372 articles
Browse latest View live

What is Twitter Bootstrap?

$
0
0

Twitter Bootstrap is a free set of tools for building web applications. It comprises template files, as well as optional JavaScript extensions. Developed by a couple of engineers at Twitter (hence the name), it was originally designed to help provide some consistency across tools the guys were building internally. Since its first public (open source) release in 2011 (see the blog post here) it has found huge popularity amongst web developers for its ease of use and feature set, and in 2012 was the most popular project on GitHub. Its advocates praise Bootstrap’s ability to build usable apps, with clean code, quickly and easily.

At its heart, Twitter Bootstrap is basically simple good old CSS, but it uses the LESS preprocessor to add a lot more functionality that CSS could otherwise provide. The total package is a tiny 6KB is size, and only comprises seven files. So what features are included? Here is the low down:

  • Layout grid - A standard 940 pixel width grid layout is provided, allowing developers to quickly get an apps page structure sorted. There is an optional variable width layout, should developers wish to use that instead.
  • Support for responsive design - Websites adjust dynamically based on device being using to browse them. The included grid layout comes in four variations for various devices.
  • Interface components - A large number of interface components are also provided. These include standard buttons, labels, preformatted warning and system messages, navigation controls, wizard controls, pagination, and breadcrumbs.
  • Javascript snippets - Again the focus here is on user interface elements. Included is code to help build tooltips, dialog boxes, as well as more traditional form and input elements (including a nice autocomplete feature).

One of the great things about Bootstrap’s success is the sheer amount of support and advice that is now out there on the web. Not only can you find everything on GitHub but sites like webdesigntuts offer really useful guides.

In future weeks we will try and look at some other frameworks, but if you are looking to build a new web app now, you could certainly do a lot worse than look at Twitter Bootstrap to help get you started.

Check out Ignite UI because in 13.1 we are adding Twitter Bootstrap support for more information see Jason Beres blog post “Ignite UI: What’s New in 13.1 HTML5, jQuery & ASP.NET MVC Controls”  


Developer Humor: Lighting Issues

$
0
0

I'm still on this idea of the Wednesday afternoon slump, and I figured everyone else might be feeling the same way out there. I thought it might be nice to share another picker upper with you all:

Software Developer comics by Infragistics Prototyping Tool Indigo Studio

Share the Fun:

You can embed this comic on your blog or website! Simply copy the below code and paste it into your website:

<a href="http://www.infragistics.com/community/blogs/d-coding/archive/2013/04/17/developer-humor-lighting-issues.aspx"><img src="http://www.infragistics.com/community/cfs-filesystemfile.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/d-coding/5684.tech_5F00_cartoon_5F00_02b.jpg" alt="Software Developer Comics" border="0" /></a></code></p>
<br />
<p></p>
<p><a href="http://www.infragistics.com/community/blogs/d-coding/archive/2013/04/17/developer-humor-lighting-issues.aspx">Software Developer</a> comics by Infragistics <a href="http://www.infragistics.com/products/indigo-studio">Prototyping Tool</a> Indigo Studio</p>

Beta HTML Prototype Viewer

$
0
0

Earlier this week we quietly released a pretty significant release for Indigo--the Beta of our HTML prototype viewer!

Indigo HTML Prototype Viewer

You can see in the URL above that it is HTML, right? ;) Well you can also try opening it on any device or browser that doesn't have Silverlight enabled if you don't believe me.

Here's the way the beta works:

  1. You share your prototype as per usual (with or without a password) to our servers.
  2. You just stick .html on the end of your share link to give people the HTML version of your prototype.

We're doing it this way to give you, the designer, the choice of which one to share. Because the HTML is in beta for now, we can't guarantee it is 100%, so we are, during the beta, keeping Silverlight as the default. If you want to try your prototype where Silverlight is not available, or you don't want to ask your clients to install, just add the .html and try it out. If it works, you can share that. Just keep in mind that it is beta.

Please do let us know at indigo at infragistics dot com if you run into any problems, especially if it doesn't appear to run the same in HTML as it does in Silverlight. We are shooting for 100% parity.

Once we have more testing and your feedback, we will move from beta to release on this, and we will share HTML prototypes by default, both to our servers and to yours.

Enjoy!


About Indigo Studio

If you haven’t already, why not Go Design Something!? Version 1 is free forever.

If you are using Indigo, we welcome your ideas on how we can better apply and refine these and other good interaction design principles to help you to design awesome UIs. If you have any questions or problems, please don’t hesitate to discuss them with us in our forums. We’re also on Twitter @indigodesigned.

About the Author

Ambrose Little is principal design technologist at Infragistics and has worked on Indigo Studio as interaction designer and product manager along with an awesome team based here in Cranbury, NJ, USA and Montevideo, Uruguay.

Infragistics Releases 13.1!

$
0
0

The wait is over! This morning, Infragistics released NetAdvantage Ultimate 13.1 and our related 13.1 toolsets and products to the community. Ultimate 13.1 is the only design and development toolset on the market that lets you create both hybrid and native mobile applications, in addition to modern and touch-friendly apps for the desktop and web. The release includes updated versions of our WPF, Silverlight, iOS (NucliOS), ASP.NET, and HTML5/jQuery (Ignite UI) toolsets, as well as brand new to market Windows UI controls. Ultimate also features the new Indigo Studio design tool which lets you create rapid, interactive prototypes of your application UIs while maintaining your focus on your users, and whole lot more.  

Highlights in this release of Infragistics NetAdvantage platform include:

  • New toolset NetAdvantage for Windows UI offering 20 XAML and HTML controls for native Windows 8 app development.
  • Greater breadth and depth of the NucliOS controls, including over 35 Chart types, Grid enhancements, and Xamarin.iOS support (MonoTouch), so you can create native iPad and iPhone apps in C#.
  • Responsive UI Framework of the Ignite UI (HTML5/jQuery) Grid and Chart to control screen behavior when it’s resized for different devices, as well as new Pivot Grid, Tile Manager UI, and Gauge controls for mobile business intelligence.
  • New Doughnut Chart control, and enhancements to the Geographic Map and Data Chart for Silverlight and WPF.
  • Optimized touch-experience controls across all UI toolsets and Windows UI/touch themes for more modern application development.

If you’re looking for more information on a specific toolset, check out these detailed rundowns:

In addition, if you have any questions about Infragistics’ 13.1 release, we would love to hear from you! Here are some of the best ways to get in touch:

Xamarin EVOLVE Follow-up: Building Mobile Cross-Platform Geospatial Apps

$
0
0

XamarinEvolveBannerNick

I spent a few days this week at Xamarin EVOLVE, hanging out with the Xamarin folks, the mobile cross-platform dev community, talking to attendees at our booth and speaking about mobile geospatial development. It was definitely a great event and Xamarin deserves major kudos, both for the event itself, but also for their products and impressive keynote announcements. Xamarin is a partner of Infragistics and it’s certainly an exciting time to be a mobile developer.

As promised during my talk, I’m posting all my session material here, including the slides, demos, and reference links. I had a great time at EVOLVE and I hope to speak there again if/when Xamarin holds another show.

Building Mobile Cross-Platform Geospatial Apps

This session will not reveal why we are on Earth, but it will teach you how to find out where we all are on it. Looking for the user? Just find the phone. Thanks to standard built-in Location Services and hybrid positioning hardware, every modern smartphone knows where it is. In this session, ActiveNick shows you how to build a truly “smart” cross-platform phone application by adding Geospatial Services to it. Using C# and MonoTouch for iOS, the Windows Phone SDK, and Mono for Android, you will learn how to locate the device using the phone GPS and other Location Services, display spatial data on maps, manipulate them with touch gestures, geocode addresses into lat/long pairs, and more. We’ll discuss the various mapping technologies, SDKs and APIs across various mobile platforms, how to tap into geospatial features programmatically with Xamarin tools, and explore how geospatial systems can benefit from mobile services and apps. Location Intelligence is a natural extension of mobility. Come learn how all mobile developers should also be geospatial developers.

Download the session slides here

Download the iOS & Windows Phone demo here

Download the Android demo here. It’s a modified version of the Google Maps Android API v2 demo found on Github here. Make sure to read both readme files in the Zip since you’ll need dependencies from the Github project to make the demo work.

Noteworthy Links

Building iOS Apps with Xamarin and NucliOS

We (Infragistics) launched release 13.1 of all our developer controls yesterday. This includes NucliOS 13.1, our stellar native controls for iOS developers. With NucliOS you get a powerful data & layout grid control, a versatile chart control supporting more than 40 chart types – including the new Pie Chart control – as well radial gauges and rich-text labels.

The good news for C# developers is that NucliOS also ships with full bindings for Xamarin.iOS. With a single package, NucliOS offers the best native iOS controls for developers, whether they build their apps in Objective C with Xcode, or in C# with Visual Studio or Xamarin Studio.

If you’ve never built any apps for iOS or even learned iOS development, this is your chance to get started. Download the free starter edition of Xamarin.iOS here, then download the trial for NucliOS and start building gorgeous iOS apps for iPhone and iPad today.

Here are some links to get you started.

Download a trial version of NucliOS 13.1 here

NucliOS Product Page at Infragistics.com

What’s New in NucliOS 13.1 for iOS Developers

Visit the NucliOS 13.1 page in the Xamarin Component Store here

Creating iOS Apps with Xamarin.iOS and NucliOS – Webinar by Brent Schooley

Download the NucliOS 13.1 Samples Browser for free on your iPhone or iPad from the iTunes App Store here

 

NUCLiOS_Banner_728x90_a

Until Next Time…

I will be doing a very similar session to my mobile cross-platform geospatial apps talk at Code PaLOUsa, April 25-27 (next week!), in Louisville, KY. Make sure to attend if you’re in the area.

You can also catch me and attend more of my talks at the following events over the next few months:

If you have any questions about the topics discussed in these sessions, you can post them in the comments below or contact me on Twitter at @ActiveNick.

‘LESS’– A dynamic language that simplifies your CSS

$
0
0

css-less-nnish

For this post, I am assuming you are a programmer like me and design is a planet just outside your universe. If you are from the design planet, you too can read on; may be there is something for you too!

Writing CSS is fun, exciting and easy until your website grows fat with pages and complicated layouts. If you have ever tried fixing a layout in such a page – you know what I mean. Did I talk about fixing a layout? Oh yeah thanks to all the browsers.

Many at times while writing CSS I wished I could write it more programmatically than just styling them. For e.g. If CSS had allowed variable declarations, I could have simply held the values in variables, perform few operations and re-use them in properties. But that’s too much to ask for from a stylesheet language which should just do styling!

Fortunately there are a few preprocessors like Sass& LESS that nicely extends CSS and adds everything a programmer ever wanted. After doing couple of research I picked up LESS to see how it works. I spent a few hours re-styling some of my demos with LESS and I am must say I am thoroughly impressed with this language. So here I’m explaining you about LESS.

So LESS

LESS is a dynamic stylesheet language that extends CSS and adds nice features like variables, mixins, operations and functions to it. More importantly it takes fewer efforts for developers to write complex CSS and build amazing looking websites real fast.  LESS uses existing CSS syntax that makes learning a breeze and you can always fall back to CSS.

LESS’ first version was written in Ruby and was used as a server side language which upon compiling emitted CSS. However in the later versions, use of Ruby is deprecated and replaced by JavaScript. Adding LESS.js JavaScript file to your HTML page allows real-time compilation within browsers. It also supports server side compiling with the help of Node.js making it easier for developers to choose between the two.

Adding Less.js – Client side usage

 

All LESS files should have the extension “.less” and you may have them under CSS directory of your webserver.

Add the following lines of code to your HTML page to ensure Pre-Compiling of CSS happens in your browser:

<link rel="stylesheet/less" type="text/css" href="css/style.less"/><script src="js/less-1.3.3.min.js"></script>

Note: If you working on a local file system i.e. if you are accessing the page using “file:///” on Chrome or IE you may incur an error of “Cross origin requests are only supported for HTTP” or “Access Denied” respectively. These are some security related errors and I did not find a way to get rid of them. Host them on a development server and you will see this go away. However I did not find any issues with Mozilla Firefox.

Server side usage

 

If performance is what running in your mind then you can look at compiling these files on the server side. First, download and install Node.js, then using npm  download the less compiler(lessc.cmd).

To compile use this command:

lessc styles.less > styles.css

For more options like CSS minifying, run lessc without parameters.

There are few nice editors out there that will let you live compile these files. For e.g. I use WebStorm which nicely compiles LESS to CSS as I type. If you are on a large project and most of your developers are comfortable on LESS then you can add the sever side compilation step to your build task.

Now that you have know how to make “.less” files and compile them to CSS, let’s look at this language in detail.

Variables

As mentioned earlier variables are one nice feature to have in stylesheets. LESS let’s you add variables with the help of @ symbol and use them into properties. Find below an example where I set background-color and color of the body with the help of variables.

@backgroundColor: #333;
@color: #fff;

body {
  background-color: @backgroundColor;
  color: @color;
  border-top: solid 10px #000;
  font-size: .85em;
  font-family: "Segoe UI", Verdana, Helvetica, Sans-Serif;
  margin: 0;
  padding: 0;
}

These variables can be now re-used in the rest of the code and any change that you make to color will apply to all. CSS codes can co-exist with LESS – If you notice only two of the properties were set by variables and the rest is CSS.

Operations

Now that you know variables are a possibility in stylesheet, you must be happy to know that you can perform operations on them. It’s easy! Here’s is an example of how to do it:

@baseColor: #000;
@backgroundColor: (@baseColor + #333);
@color: (@backgroundColor / 3);
@font-family: "Segoe UI", Verdana, Helvetica, Sans-Serif;
@font-Size: 1em;
#body {
  background-color: @backgroundColor;
  color: @color;
  border-top: solid 10px @baseColor;
  font-size: (@font-Size - .15em);
  font-family: @font-family;
}

Have a look at how @backgroundColor, @color and font-size gets the calculated value from an operation. Find below the output that gets generated.

Output:

#body {
  background-color: #333333;
  color: #111111;
  border-top: solid 10px #000000;
  font-size: 0.85em;
  font-family: "Segoe UI", Verdana, Helvetica, Sans-Serif;
}

Mixins

Mixins help you reuse the whole bunch of properties from one ruleset into another ruleset. Here’s an example:

@baseColor: #000;
@font-family: "Segoe UI", Verdana, Helvetica, Sans-Serif;
@font-Size: 1em;

.gradients {
  /*local scoped variables*/
  @gradientStartColor: #eaeaea;
  @gradientEndColor: #cccccc;
  background: @baseColor; /* variable from global scope */
  background: linear-gradient(top, @gradientStartColor, @gradientEndColor);
  background: -o-linear-gradient(top, @gradientStartColor, @gradientEndColor);
  background: -ms-linear-gradient(top, @gradientStartColor, @gradientEndColor);
  background: -moz-linear-gradient(top, @gradientStartColor, @gradientEndColor);
  background: -webkit-linear-gradient(top, @gradientStartColor, @gradientEndColor);
}

#body {
 .gradients;
  border-top: solid 10px @baseColor;
  font-size: (@font-Size - .15em);
  font-family: @font-family;
}

In the above code you can see how .gradients ruleset is re-used into #body. It’s a pretty nice feature, think about how less code you need to write now!

Variable Scoping

 

Like every other programming language, LESS provides variable scoping too. Variables are looked up locally first and when not found it will search globally. In the above example you can see that the @baseColor is being used in both .gradients and #body. If you have locally scoped variables like @gradientStartColor and @gradientEndColor they are not accessible outside the scope unless they are mixed in. In the above example #body can access those variables inside since .gradients is referred.

Check out Scope for more info.

Parametric Mixins

This is special type of ruleset which can be mixed in like classes, but accepts parameters. Here’s an example that sets up border-radius for different browsers.

.border-radius (@radius: 4px) {
  border-radius: @radius;
  -moz-border-radius: @radius;
  -webkit-border-radius: @radius;
}
#body {
 .gradients;
  .border-radius;
  border-top: solid 10px @baseColor;
}
#sidebar{
  .border-radius(25px);
  background: #eee;
}

If you look at #body it calls without parameters that’s because LESS allows to set default values of parameters which in this case is 4px. Look at #sidebar for call with parameters. You can also set multiple parameters, check this out for more information.

Functions

LESS provides few helper functions for transforming colors, string manipulation, and do math. Find below an example from the LESS documentation which uses percentage to convert 0.5 to 50%, increases the saturation of a base color by 5% and then sets the background color to one that is lightened by 25% and spun by 8 degrees:

#sidebar{
  width: percentage(0.5);
  color: saturate(@baseColor, 5);
  background-color: spin(lighten(#ff0000, 25%), 8);
}

Check out Function Reference for details.

Summary

By now you would have a fair idea of what LESS brings to the table. But be aware that LESS is not the only CSS preprocessor. There is Sass which stands for Syntactically Awesome Stylesheets and few others but they aren’t popular. There are various blogs out there which will tell you some good comparison between the two. I suggest you try both and stick to the syntax that you like! After all they emit CSS Smile

Have a feedback? Find me on twitter @nishanil

0640.IgniteUI_Banner_728x90_b

Using FlatDataSourceGrouping - XamPivotGridGrouping Series - Post 2

$
0
0

XamPivotGridGrouping 2 - Providing the Data

As I mentioned in my last post, we are going to make use of the XamPivotGridGrouping control to create a new WPF Football Statistics Analysis application.  We'll use the XamPivotGridGrouping to showcase our data and summarize it based on a variety of different data points.  To do this, we're going to need a data source. 

Just like the XamPivotGrid, the XamPivotGridGrouping supports the following data sources:

  • SSAS (via GroupingFlatDataModelProvider)
    • XmlaDataSource
      • The XmlaDataSource allows connecting and executing queries against SSAS through XML for Analysis model provider.
    • AdomdDataSource
      • The AdomdDataSource allows connecting and executing queries directly against SSAS
  • SAP NetWeaver Business Warehouse (via GroupingFlatDataModelProvider)
    • XmalSapDataSource
      • The XmalSapDataSource provides a way to connect and execute queries against SAS through XMLA
  • Oracle Essbase (via GroupingFlatDataModelProvider)
    • XmlaOracleDataSource
      • The XmlaOracleDataSource provides a way to connect and execute queries against Essbase for Oracle through XMLA.
  • IEnumberable data collection
    • (GroupingFlatDataSource)FlatDataSource
      • The FlatDataSource, or in this case GroupingFlatDataSource, provides a way to use System.Collections.IEnumerable as data source to display data.

Now, for no better reason than that it's simple and straightforward, we are going to use the GroupingFlatDataSource controller.
We'll use it for both our GroupingDataSelector and our XamPivotGridGrouping control.

From our perspective, the way data binding works for the XamPivotGridGrouping is shown here:

For the GroupingFlatDataSource, the ItemSource can be any object that implements IEnumerable.

For our sample, we are going to base everything on an object called BaseStatisticTotalResult which implements INotifyPropertyChanged.
The class diagram is shown here (I hid the Fields Compartment for brevity):

Our data source will be built off an IEnumerable.
The data itself is stored in a SQL Server db which I've added to hold the stat data.  I'm using Entity to connect, and we'll be calling some stored procedures via Function Imports to aquire the data. 

I have a Utility class called FlatDataConstructr which we'll use to generate the IEnumerable and pass it back to the ViewModel which handles Data in our project.  This snippet shows the OffensiveStatisticsAllTeams() method of FlatDataConstructor.

publicIEnumerable<BaseStatisticTotalResult> OffensiveStatisticsAllTeams()
     {
           m_offensiveAll = newList<BaseStatisticTotalResult>();
           var items = GetAllStatsSQL();
           int counter = 0; 
          try
           {
                 foreach(SQLStatisticResultObject o in items)
                {
                    // For each Resultant Item from our above Entity Call,
                    // create aBaseStatisticTotalResult and add it to theLocalList
                    BaseStatisticTotalResult stat = newBaseStatisticTotalResult
                    {
                         Game = GetGameDescription2(o.AwayTeam ,o.HomeTeam, (int
                                                    o.AwayScore, o.HomeScore),
                         Player = o.FName + " " + o.LName,
                         Position = o.Position,
                         PositionType = o.PosType,
                         Season = (int)o.Season,
                         Statistic = o.StatResult,
                         ResultID = (Int64)o.ResultID,
                         StatisticTotal = o.ResultTotal,
                         Team = o.Name,
                         StatSubType = o.StatSubType,
                         StatType = o.StatType,
                         Height = o.HEIGHT,
                         Weight = o.WEIGHT.ToString(),
                         College = o.College,
                         Number = o.Number,
                         QuarterValue = (int)o.Quarter,
                         PlayerID = (Int64)o.PlayerID,
                         GameID = (Int64)o.GameID
                  };
// Some of the properties ofBaseStatisticTotalResult are not directly mapped to a field 
// in the result of the Entity query. So additional work is needed. Above this is done using
// GetGameDescription2 which returns a description of the Game and below the Opposing Team is 
// determined by comparing thePlayerTeam to the Home and Away Teams of the game.
              stat.OpposingTeam = o.PlayerTeam != o.HomeTeam ? o.HomeTeam : o.AwayTeam;
              counter++;
              m_offensiveAll.Add(stat);
            }
        }
        catch (Exception exception)
        {
              if (exception.Message.Length > 0)
              {
                   // Handle exceptions here.
              }
              throw;
        }
// These are special case statistics for Passer Rating,Avg Yards, Comp% etc.
        AddRatingsStatsForQB(m_offensiveAll);
        AddPrecentageStatsForPlayer(m_offensiveAll);
        return m_offensiveAll;
  }

As you can see in this snippet, we return a List<BaseStatisticTotalResult> as IEnumberable. 

The ViewModel which is in charge of generating our OLAP cube, and defining the Dimensions, Measures and Hierarchies is called DataConstructorViewModel.  Here is a abbreviated class structure for this viewmodel:

 

The specifics of the class are as follows:

  • m_dataConstructor is an instance of FlatDataConstructor
  • m_oStatsAllTeamsFlat is an instance of GroupingFlatDataSource
  • OffensiveStaticstAllTeamsData is a public GroupingFlatDataSource 

What we'll eventually be doing is using our OffensiveStaticstAllTeamsData as the data source for our XamPivotGridGrouping and it's associated XamDataSelectorGrouping.

To close out our look at building the data source, let's examine the methods in the DataConstructorViewModel and see how each one is being used to build out the final GroupingFlatDataSource.

Let's start with OffensiveStatisticsAllTeams:

        public void OffensiveStatisticsAllTeams()
        {

            if (m_allTeamsOStatsList= null) m_allTeamsOStatsList = newList<BaseStatisticTotalResult>();
            if (m_dataConstructor= null) m_dataConstructor = newFlatDataConstructor();
            m_allTeamsOStatsList m_dataConstructor.OffensiveStatisticsAllTeams().ToList();
            m_allTeamsOStatsList.GetEnumerator();
           
            var statsDataSource = new GroupingFlatDataSource
            {
                ConnectionSettings newGroupingConnectionSettings(),
                ItemsSource = m_allTeamsOStatsList,
                Cube = DataSourceBase.GenerateInitialCube("Cube"),
                Columns = DataSourceBase.GenerateInitialItems( "[Season].[Season], [Game].[Game], " +
                                                                [Half].[Half], [Quarter].[Quarter]
"),
                Rows = DataSourceBase.GenerateInitialItems(
                        "[Player].[Player], [Team].[Team], [Position].[Position],
                          [StatType].[StatType],[StatSubType].[StatSubType], [Statistic].[Statistic]
"),
                Measures = DataSourceBase.GenerateInitialItems("StatisticTotal")
            };

            DefineOffensiveDimensionMetadata(statsDataSource);
            SetFlatDataProperties(statsDataSource);

            m_oStatsAllTeams = statsDataSource;
       }

Let's break down this method a little.  The beginning of the method is fairly self-explanitory as we are just declaring the List and an instance of the FlatDataConstructor.  We then call the OffensiveStatisticsAllTeams method to populate our list.  So we start dealing with our GroupingFlatDataSource beginning with this snippet:

      var statsDataSource = new GroupingFlatDataSource
            {
                ConnectionSettings newGroupingConnectionSettings(),
                ItemsSource = m_allTeamsOStatsList,
                Cube = DataSourceBase.GenerateInitialCube("Cube"),
                Columns = DataSourceBase.GenerateInitialItems("[Season].[Season], [Game].[Game], " +
                                                              "[Half].[Half], [Quarter].[Quarter]"),
                Rows = DataSourceBase.GenerateInitialItems(
                        "[Player].[Player], [Position].[Position], [StatType].[StatType], " +
                        "[StatSubType].[StatSubType], [Statistic].[Statistic]
"                
                RowsGroups = DataSourceBase.GenerateInitialItems("[Team].[Team]"               
                Measures = DataSourceBase.GenerateInitialItems("StatisticTotal")
            };

Because we are simply using a IEnumberable data source, we can pass in an empty GroupingConnectionSettings.  However, if we were pulling directly from SQL or another data source we would need to implement them here.

ItemsSource is, of course, the list we just generated from the FlatDataConstructor. 

Cube uses the DataSourceBase.GenerateInitialCube() method to generate an Infragistics.Olap.Data.ICube that can be passed to Cube property as the default cube.

For Columns, Rows and RowsGroups we use DataSourceBase.GenerateInitialItems to set the initial set of IFilterViewModel items whicfor each of these respective collections.

Measures uses the GenerateInitialItems method to set the collection of IMeasureViewModel items for our model.

This snippet creates our GroupingFlatDataSource.  The next two lines call methods which assist us in refining that datasource.

DefineOffensiveDimensionMetadata(statsDataSource);
SetFlatDataProperties(statsDataSource);

Let's look at each of these methods:

private static void DefineOffensiveDimensionMetadata(GroupingFlatDataSource flatDataSource)
{
       var modelMetadata = newCubeMetadata();
       flatDataSource.AllowRemainderTotalForColumns = true;
       flatDataSource.UseZerosOnEmptyTotals = true;
       modelMetadata.DataTypeFullName = typeof(BaseStatisticTotalResult).FullName;
       modelMetadata.DisplayName =
                                   Strings.Label_DataConstructorViewModelDataFields;

// Add Base Result Hierarchies - By arranging Members of a Dimension into a hierarchy,
// not only do we determine the aggregation of Dimension members,

// but also simple mathematical summation or addition can be eliminated since the values
// for each members will automatically sum up or total to its parent

// aggregate member. 
       AddBaseHierarchies(flatDataSource);

// Add Base Dimensions - Dimensions are the business parameters normally seen in the rows
// and columns of a report.
       AddBaseDimensions(modelMetadata);

// Add Model Metadata toCubeSettings
       flatDataSource.CubesSettings.Add(modelMetadata);

// Adding this to set the Parent of expandable columns to be place in front of children.
        flatDataSource.ParentInFrontForColumns = true;

}

Initially in this method we create an object called CubeMetadata.  In other data sources, the data my already be organized into cubes, and each dimension may already have defined hierarchies.  This isn't the case when we use a FlatData source.  With FlatData, we can define the hierarchies for each property of our BaseStatisticTotalResult.  The last two method calls within this method will do just that.

After declaring and instantaiting our CubeMetada,  we set a couple additional properties on the GroupingFlatDataSource.  The key property for us right now is AllowRemainderTotalForColumns.  Setting this to true allows our columns to provide a "remainder".  This means if a record value is assigned to a parent column but not a child column, the remainder value will be displayed beneath that column.  

As an example, say we had a running back that played in 4 games during the 2011 Season.  He had statistics for each of those games.  For whatever reason, let's say we could only find associations for our statistics to 5 games, even though we had all the stats for the full season.  If we expanded the season out..those values for statistics not assigned to a game would be considered the remainder, and would appear beneath the parent (Season) column.  

The UseZeroesOnEmptyTotalForColumns, DataTypeFullName and DisplayName properties are self-explanatory.  (Note: In my strings resource, the value for the Label_DataConstructorViewModelDataFields isData Fields).

The AddBaseDimensions and AddBaseDimensions methods finish off this method.  As previously mentioned, these methods will allows us to define our own dimension and hierarchies for our BaseStatisticTotalResult. 

For each method, I'll show a snippet that is defining a hierarchy for two of the cube’s properties. The cube is the class specified in the data source as the main data holder. We can efine as many HierarchyLevelDescriptors as needed.

Here are the the two listed methods (I have removed some of the hierarchies for brevity) and an additional helper method to add Dimensions.

private static void AddBaseHierarchies(GroupingFlatDataSource flatDataSource)
{
    …
    var tHierarchy = newHierarchyDescriptor<BaseStatisticTotalResult>(p => p.Player);
    tHierarchy.AddLevel(p => p.Player, "Player" );
    tHierarchy.HierarchyName = "Player";  
    tHierarchy.HierarchyDisplayName = Strings.Label_OffensivePlayer; 
    flatDataSource.HierarchyDescriptors.Add(tHierarchy);

    var
teamHierarchy = newHierarchyDescriptor<BaseStatisticTotalResult>(p => p.Team);
    teamHierarchy.AddLevel (p => p.Team, "Team" );
    teamHierarchy.HierarchyName = "Team";
    teamHierarchy.HierarchyDisplayName = Strings.Label_Team;
    flatDataSource.HierarchyDescriptors.Add(teamHierarchy);
   
}

private static void AddBaseDimensions(CubeMetadata modelMetadata)
{
     AddDimensionData(modelMetadata, "Player" ,Strings.Label_OffensivePlayer ,
             DimensionType
.Dimension);
     AddDimensionData(modelMetadata, "StatType" , "Type" ,
             DimensionType
.Dimension);
     AddDimensionData(modelMetadata, "OpposingTeam",
             "OpposingTeam
",DimensionType.Dimension);
     AddDimensionData(modelMetadata, "Quarter" , "Quarter" ,DimensionType.Dimension);
     AddDimensionData(modelMetadata, "Half" , "Half" ,DimensionType.Dimension);
     AddDimensionData(modelMetadata, "StatSubType", "Category" ,DimensionType.Dimension);
     AddDimensionData(modelMetadata, "Height" , "Height" ,DimensionType.Dimension);
     AddDimensionData(modelMetadata, "Weight" , "Weight" ,DimensionType.Dimension);
     AddDimensionData(modelMetadata, "College" , "College" ,DimensionType.Dimension);
     AddDimensionData(modelMetadata, "Game" ,Strings.Label_Game , 
              DimensionType.Dimension);
     AddDimensionData(modelMetadata, "Team" ,Strings.Label_Team ,DimensionType .Dimension);
     AddDimensionData(modelMetadata, "Position" ,Strings.Label_Position ,
              DimensionType
.Dimension);
     AddDimensionData(modelMetadata, "PositionType",Strings .Label_PositionType ,
              DimensionType
.Dimension);
     AddDimensionData(modelMetadata, "Season" ,Strings.Label_Season , 
              DimensionType
.Dimension);
     AddDimensionData(modelMetadata, "Games" ,Strings.Label_GamesPlayed ,
              DimensionType
.Dimension);
     AddDimensionData(modelMetadata, "GamesStarted" ,Strings.Label_GamesStarted ,
              DimensionType
.Dimension);
     ...
     modelMetadata.DimensionSettings.Add(resultTotal);
}


private static void AddDimensionData(CubeMetadata model, string source, string display,
                     DimensionType type, IAggregator aggregator = null , string format = null)
{
     var dim = newDimensionMetadata
     {
           SourcePropertyName = source,
           DisplayName = display,
           DimensionType = type
      };
     if (aggregator != null)
     {
           dim.Aggregator = aggregator; 
     }
     if (format != null)
    {
          dim.DisplayFormat = format;
     }
    model.DimensionSettings.Add(dim);
}

For the Hierarchies, LevelExpressionPath is the property on which to group the data. LevelName will appear in the tree with hierarchies in the data selector.

For the Dimenseions, DisplayName is used to change the name of the hierarchy/measure in the UI and the DisplayFormat is used for measures. Raw value goes to the Value property of the cell and the formatted value goes to the FormattedValue property. 

At the end of the method we set one more property, which I set aside only for the purposes of highlighting it. This property, ParentInFrontForColumns, impacts how the expanding columns will appear.  Set to true, and the parent columns appear in front of the children, set to false, they appear behind the children.   

The last method we have to look at simply sets a few more properties on the GroupingFlatDataSource and is called SetFlatDataProperties.

private static void SetFlatDataProperties(GroupingFlatDataSourceflatDataSource)

     flatDataSource.MergeHierarchySettings.AllowMergeOfColumns = true;
     flatDataSource.DimensionsGenerationMode = DimensionsGenerationMode.Mixed;

AllowMergeOfColumns needs to be set to true to allow our expanding and collapsing columns to merge together. The DimensionsGenerationMode enum is defined as follows:

Metadata       

The dimensions are created based on the CubeMetadata.DimensionSettings found in FlatDataSource.CubesSettings.

Mixed

Both data sources are used as data found in CubeMetadata.DimensionSettings takes precedence.

Property

The dimensions are created based on the properties exposed by the class of items found in items source.

With that, we have a GroupingFlatDataSource which is ready to be handed off to the XamPivotGridGrouping!  In the next post, we'll take a look at the results of this data, and start working on customizing the control to fit the requirements we set out.  

NetAdvantage Reporting Release Notes – April: 13.1 Volume Release

$
0
0

With every release of NetAdvantage Reporting comes a set of release notes that reflects the state of resolved bugs and new additions from the previous release. You’ll find the notes useful to help determine the resolution of existing issues from a past release and as a means of determining where to test your applications when upgrading from one version to the next.

Release notes are available in PDF format and summarize the changes to this release along with a listing of each item. In order to download the release notes, use the following link:


12.2 to 13.1 EBNF Converter

$
0
0

As I mentioned in a previous post, the format of EBNF special sequences has changed in the 13.1 version and it is not so easy to change over the 12.2 format to the new format by hand. So if you have already written an EBNF grammar using 12.2 and you want to upgrade to 13.1, I have created a utility to help you convert the file from the old format to the new.

One thing to note when converting is that regular expressions are now more limited in 13.1. In 12.2, we were using .NET regular expressions so you could use anything they supported. But in 13.1, we created a custom regular expression engine specifically designed to lex a document as fast as possible. For example, in 12.2 we were able to lex 74,157 lines of C# per second on one machine. On that same machine, the 13.1 version was able to lex 180,326 lines of C# per second. However, the downside to using a custom regular expression engine is that not all regular expression patterns can be supported. So when converting, you may see some messages about terminal symbols that cannot be converted because their regular expression patterns are no longer valid in 13.1. This must be fixed in the original file before the conversion can succeed, so I recommend that you back up the original file before trying to convert it (or try to convert a copy of the original).

And finally, a short disclaimer before I link to the converter (please excuse the legalese):

Copyright (c) 2013, Infragistics, Inc.

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND INFRAGISTICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INFRAGISTICS BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

The converter can be found here and you can find the source code for it here.

By Mike Dour

Xamarin Evolve 2013 - Review

$
0
0

Last week I had the pleasure of attending Xamarin Evolve 2013 as both an attendee, a sponsor, and as a lightning talk presenter. This was one of the best conferences I’ve ever been to and I’m not just saying that because I’ve been involved with Xamarin’s iOS offerings for a long time. The conference was so great it’s incredibly hard to believe this was Xamarin’s first time hosting a conference. 600+ attendees at a beautiful venue in the amazing city of Austin, TX.

evolve-th

Announcements

During the keynote there were some big announcements that will really change the game for developers on this platform and in mobile development on the whole.

async/await

The move to the Mono 3.0 runtime for both Xamarin.iOS and Xamarin.Android opens the door for the async/await pattern as well as other important features from C# 5.0.

F# Support

Didn’t see this one coming, but I can certainly see it being useful for certain types of programs. Always use the right tool for the right job.

iOS Designer

This one is huge. Xamarin already has an Android designer that is better than the designer shipped by Google. Now, the team has gone ahead and tackled possibly one of the biggest shortcomings of its iOS offering. Available now in the Alpha channel of Xamarin Studio is a designer for iOS XIB files. It’s a little buggy and rough around the edges right now but it will be a great addition to their tooling as it gets better. The designer is capable of rendering third party components and custom views which is something that Xcode is not capable of. This means you can see what your view will actually look like at design time. This will be fantastic for NucliOS development!

xamarin-designer-ios-th

Test Cloud

This was a huge “One More Thing”-style announcement made by Nat Friedman at the end of the keynote. Test Cloud is an ambitious new service from Xamarin that promises to “automatically test your app on hundreds of mobile devices”. You upload your application (Android or iOS, native or hybrid, Xamarin or not) to Test Cloud, choose the devices you want to run the tests on, and your app will be run on potentially hundreds of physical devices (depending on what you chose to run them on). The results of the test show you which devices failed the tests and you can even walk through the screenshots of each step in the test for all devices. This is nothing short of amazing and will really help Android developers work through the fragmentation issues they currently experience with respect to testing.

Conference review

The team at Xamarin put on quite a show for their first ever conference. The two day training was full of valuable information for both beginners and experienced Xamarin developers. The keynotes by Scott Hanselman and Josh Clark were very entertaining and informative. The Hilton Downtown Austin was a fantastic venue for a conference of this size. It never felt too big or too small for the crowd. The event staff was second to none and the video production crew rapidly took footage from the night before and turned it into masterpieces for the next day. The sessions I was able to attend were definitely worth the time. All in all, this was a great conference. Looking forward to next year already. I have posted a lot of pictures from the event on my personal blog.

Contact

Next stop for me is Code PaLOUsa 2013 and I leave tomorrow. If you have any questions or comments in the meantime, please feel free to email me at bschooley@infragistics.com or find me on Twitter@brentschooley.

Using SQLite3 as a Data Source in an Xcode Project (Objective-C)

$
0
0

Introduction

One important aspect of almost any application is the data source that provides or store data to the UI elements. In this article we'll wire up the most widely deployed SQL database engine in the world, SQLite, to the IGGridView. In addition you'll learn how to execute a SELECT statement on a SQLite3 database, and turn the results into NSMutableArray of custom objects.

The illustration below will be the final result.

image


 

Requirements

This article requires the use of the frameworks listed below.

  • CoreText
  • libsqlite3.dylib
  • QuartzCore
  • IG (the trial for NucliOS can be found here)

Create the Custom Object

Before retrieving the SQL data, we need to create the object model that will store data from each row returned from the SELECT statement. The 'Employees' table used in this example contains these fields:

  • Index (primary key)
  • Name (text)
  • Email (text)
  • Department (text)


Using this information about the fields we can create a simple NSObject to hold these values.

@interface EmployeeObject : NSObject
@property (nonatomic, retain) NSString *name;
@property (nonatomic, retain) NSString *email;
@property (nonatomic, retain) NSString *department;
@end

 

@implementation EmployeeObject
@synthesize department, email, name;
@end


Note:The 'Index' field is not stored in our object because we will not being using it for anything useful in this article.

Obtaining Data from the Database

Now that we have our custom object ready for the returned results we can focus on retrieving the path to the SQLite database file and executing a SELECT statement on the 'Employees' table. First we'll create a method to retrieve the path to our database file that's included in the Xcode project.

-(NSString *)getDatabasePath
{return [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"BasicData.db"];
}


Next, we'll create the method that takes the database path as an parameter and executes a SELECT statement on the 'Employees' table. We then loop through the rows and insert the results into the custom object, after which is placed into an NSMutableArray.

-(void)getSQLiteData:(NSString *)dbPath
{
    _sqliteData = [[NSMutableArray alloc] init];
    sqlite3 *database;if (sqlite3_open([dbPath UTF8String], &database) == SQLITE_OK) {constchar *sql = "select Name, Email, Department from Employees";
        sqlite3_stmt *selectStatement;if(sqlite3_prepare_v2(database, sql, -1, &selectStatement, NULL) == SQLITE_OK) {while(sqlite3_step(selectStatement) == SQLITE_ROW) {
                EmployeeObject *employeeObject = [[EmployeeObject alloc] init];
                employeeObject.name = [NSString stringWithUTF8String:(char *)sqlite3_column_text(selectStatement, 0)];
                employeeObject.email = [NSString stringWithUTF8String:(char *)sqlite3_column_text(selectStatement, 1)];
                employeeObject.department = [NSString stringWithUTF8String:(char *)sqlite3_column_text(selectStatement, 2)];
                [_sqliteData addObject:employeeObject];
            }
        }
    }
    sqlite3_close(database);
}

Wiring up the Data

With the methods created to obtain our data, we can now begin wiring up the data to the IGGridView. This article will use the viewDidLoad method for wiring the data. First, we'll set the view backgroundColor and call the getSQLiteData method to fill the NSMutableArray.

self.view.backgroundColor = [UIColor whiteColor];
[self getSQLiteData:[self getDatabasePath]];


Next we'll create the IGGridViewinstance and add it's view to the view controller's subviews.

_gridView = [[IGGridView alloc] initWithFrame:self.view.bounds style:IGGridViewStyleDefault];
_gridView.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth;
_gridView.headerHeight = 0;
[self.view addSubview:_gridView];


Finally, we'll create the grid's IGGridViewDataSourceHelper instance, assigning our NSMutableArray as the data and the 'Department' field as the groupingKey. After which, the data source helper is assigned to the grid's dataSourceproperty.

_dsh = [[IGGridViewDataSourceHelper alloc] init];
_dsh.data = _sqliteData;
_dsh.groupingKey = @"department";
_gridView.dataSource = _dsh;

Download the Source

The Xcode project source code for this article can be downloaded by clicking this link. You will need to add the IG.framework to the Xcode project after you install the NucliOS trial.

A much easier to read format of this post can be found here.

The Microsoft ‘Most Valuable Professional’ Program

$
0
0

What is a Microsoft ‘Most Valuable Professional’?

The Microsoft ‘Most Valuable Professional’ (MVP) award is given out by the folks at Redmond to members of the Microsoft community that are judged to be leaders and influencers within their fields. In particular, focus is given to people who are very active online (with things like message boards, blogs, Twitter) as well as at conferences and events.

Microsoft has long enjoyed active and enthusiastic communities for many of its products (SharePoint, Dynamics CRM, and .NET platform are excellent examples) and the MVP award both acknowledges people who contribute to these communities, as well as helps to foster the activity in the first place. There are currently 4000 MVPs in 90 countries, covering 90 different Microsoft products. Microsoft estimates that these people answer more than 10 million questions a year.

So how do does one get involved? Let us explain.

Why become one?

MVPs are able to count themselves among a select group of professionals in the Microsoft world, and the various benefits of the program stem from this standing amongst peers. Useful as they are, they can best be categorized as intangible - things like respect among peers, a more direct line to Microsoft, and access to a wealth of useful technical resources.

The best way of thinking about the MVP Award, and its benefits, is not to think about it at all really. Better to focus on getting involved in the community, contributing online, and working to help your fellow professionals. Then, and really only then, should you consider the MVP program. Over the years, Microsoft has become very adept at judging the Award and who is suitable, and it is much better to apply once you have some standing in the community. Treat it as a reward rather than a goal.

How do I become one?

There are no actual set rules for becoming an MVP. This is in part due the varied nature of Microsoft’s products. What makes an Azure expert an MVP, might differ from what makes someone who works with Windows Phone OS an MVP. However, Microsoft does provide some basic guidelines for things they take into account. This list includes:

  • Contributions to Microsoft Answers, TechNet, and MSDN
  • Contributions to wikis, blogs, and other online content
  • Appearances at conferences and user groups
  • Articles and books authored

Here are a few more tips we have garnered from past and present winners, we hope they prove useful:

  • “Don’t focus too much on winning the award, rather sharing knowledge online and being helpful to users in your community.”
  • “The MVP award has always been proud of being independent from Microsoft. Bear this in mind.”
  • “An MVP award is generally for a particular focus on a particular product. This isn’t for ‘jacks of all trades’”
  • “The award is for one year only, so don’t stop doing what you do if you wish to be renewed, Microsoft is always watching!”

Are there Microsoft MVPs at Infragistics?

Yes, there are! Infragistics is proudly home to several Microsoft MVPs, with more to come in the future. Our current MVPs are:

NetAdvantage for WPF Release Notes – 13.1 Volume Release

$
0
0

Release notes reflect the state of resolved bugs and new additions from the previous release. You will find these notes useful to help determine the resolution of existing issues from a past release and as a means of determining where to test your applications when upgrading from one version to the next.

Release notes are available in both PDF and Excel formats. The PDF summarizes the changes to this release along with a listing of each item. The Excel sheet includes each change item and makes it easy for you to sort, filter and otherwise manipulate the data to your liking.

Download the Release Notes

NetAdvantage for Silverlight Release Notes – 13.1 Volume Release

$
0
0

Release notes reflect the state of resolved bugs and new additions from the previous release. You will find these notes useful to help determine the resolution of existing issues from a past release and as a means of determining where to test your applications when upgrading from one version to the next.

Release notes are available in both PDF and Excel formats. The PDF summarizes the changes to this release along with a listing of each item. The Excel sheet includes each change item and makes it easy for you to sort, filter and otherwise manipulate the data to your liking.

Download the Release Notes

NetAdvantage for WPF Release Notes – April: 13.1 Service Release

$
0
0

Release notes reflect the state of resolved bugs and new additions from the previous release. You will find these notes useful to help determine the resolution of existing issues from a past release and as a means of determining where to test your applications when upgrading from one version to the next.

Release notes are available in both PDF and Excel formats. The PDF summarizes the changes to this release along with a listing of each item. The Excel sheet includes each change item and makes it easy for you to sort, filter and otherwise manipulate the data to your liking.

In order to download release notes, use the following links:

WPF 2013 Volume 1 Service Release

PDF - NetAdvantage for WPF 2013 Volume 1 (Build 13.1.20131.2032)
Excel - NetAdvantage for WPF 2013 Volume 1 (Build 13.1.20131.2031)


NetAdvantage for Silverlight Release Notes – April: 13.1 Service Release

$
0
0

Release notes reflect the state of resolved bugs and new additions from the previous release. You will find these notes useful to help determine the resolution of existing issues from a past release and as a means of determining where to test your applications when upgrading from one version to the next.

Release notes are available in both PDF and Excel formats. The PDF summarizes the changes to this release along with a listing of each item. The Excel sheet includes each change item and makes it easy for you to sort, filter and otherwise manipulate the data to your liking.

In order to download release notes, use the following links:

Silverlight 2013 Volume 1 Service Release

PDF - NetAdvantage for Silverlight 2013 Volume 1 (Build 13.1.20131.2029)
Excel - NetAdvantage for Silverlight 2013 Volume 1 (Build 13.1.20131.2029)

Custom Axis Labels on iOS Charts (Objective-C and C#)

$
0
0

Introduction

When visualizing data and presenting it to your users, the readability of your presentation is key. Users should be able to look at the graphic like a body of text and have an understanding of what is being presented. One key element that provides easier readability are axis labels, in this article we'll cover how to customize the x and y axis labels found on the NucliOS IGChartView.

The illustration below is a clipped portion of the final result that shows custom axis labels.

image

Requirements

This article requires the use of the following frameworks. The requirements have been split depending on your use of Objective-C or C# (using Xamarin.iOS).

Objective-C

  • QuartzCore
  • IGChart

C#

  • IGChart.dll

Note: The trial for NucliOS can be found here.

Creating the Custom Data Object

Before customizing axis labels and filling an array full of data, we need to build the object that will represent each data item. The data object contains two properties, one for territory and one for cost.

C#
public class GraphObject : NSObject
{
    [Export("Territory")]
    public String Territory {get; set;}
    [Export("Cost")]
    public Double Cost {get; set;}
    public GraphObject() {}
}


Objective-C
@interface GraphObject : NSObject
@property (nonatomic,retain) NSString *territory;
@property (nonatomic, assign) double cost;
@end
@implementation GraphObject
@synthesize cost, territory;
@end

Generating Data

The data source for this article will create random data based on the custom data object named GraphObject that we created in the last step. Each object created is added to an array that will be used with the IGCategorySeriesDataSourceHelper.

C#
private void generateData()
{
    String[] territories = new string[] {@"Canada", @"Finland", @"Holland", @"Japan", @"USA"};
    for (int i = 0; i < 5; i++)
    {
        GraphObject graphObject = new GraphObject();
        graphObject.Territory = territories[i];
        graphObject.Cost = new Random(i).Next(100000);
        _data.Add(graphObject);
    }
}


Objective-C
-(void)generateData
{
    NSArray *territories = [NSArray arrayWithObjects:@"Canada", @"Finland", @"Holland", @"Japan", @"USA", nil];
    for (int i = 0; i < 5; i++)
    {
        GraphObject *graphObject = [[GraphObject alloc] init];
        graphObject.territory = [territories objectAtIndex:i];
        graphObject.cost = arc4random() % 100000;
        [_data addObject:graphObject];
    }
}

Adopting the IGChartViewDelegate Protocol

Adopting the IGChartViewDelegate protocol in Objective-C is simple and consists of adding IGChartViewDelegate to your @interface declaration.

@interface igViewController : UIViewController <IGChartViewDelegate>
@end


In C#, we must create a class that derives from IGChartViewDelegate and override any methods we wish to take advantage of.

public class ChartViewDelegate : IGChartViewDelegate
{
    //..
}

Customizing Axis Labels

With the IGChartViewDelegate protocol adopted, it's now possible to implement the ResolveLabelForAxis (C#) or labelForAxis (Objective-C) method. This method's parameters consist of the IGChartView instance that called the method, the axis, and the data point item or number item depending on the type of axis that is requesting a label string. The sample source used in this article checks the axis key and returns a label string. Since we'll be using a column series chart type, the x-axis will use the supplied territory name as the label, and the double value y-axis will be formatted using NSNumberFormatter to display the value in a currency format.

C#
public override string ResolveLabelForAxis (IGChartView chartView, IGAxis axis, NSObject item)
{
    if (axis.Key.Equals("xAxis"))
    {
        return ((IGCategoryPoint)item).Label;
    }
    else if (axis.Key.Equals("yAxis"))
    {
        NSNumberFormatter formatter = new NSNumberFormatter();
        formatter.NumberStyle = NSNumberFormatterStyle.Currency;
        return formatter.StringFromNumber((NSNumber)item);
    }
    return String.Empty;
}


Objective-C
- (NSString *)chartView:(IGChartView *)chartView labelForAxis:(IGAxis *)axis withItem:(NSObject *)item
{
    if([axis.key isEqualToString:@"xAxis"])
        return ((IGCategoryPoint *)item).label;
    else if ([axis.key isEqualToString:@"yAxis"])
    {
        NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
        [formatter setNumberStyle:NSNumberFormatterCurrencyStyle];
        return [formatter stringFromNumber:(NSNumber *)item];
    }
    return nil;
}

Putting the Pieces Together

Everything is now in place to generate the data we need and provide the customized axis labels. Using the ViewDidLoad (C#) or viewDidLoad (Objective-C) method, we'll put the pieces together. To start, we'll generate our data and wire it up to the IGCategorySeriesDataSourceHelper.

C#
this.generateData();
_source.Data = _data.ToArray();
_source.ValuePath = @"Cost";
_source.LabelPath = @"Territory";


Objective-C
_data = [[NSMutableArray alloc] init];
[self generateData];
_source = [[IGCategorySeriesDataSourceHelper alloc] init];
_source.data = _data;
_source.valuePath = @"cost";
_source.labelPath = @"territory";


Next we'll create the chart instance and add a column series that uses our generated data with custom axis labels.

C#
RectangleF chartRect = this.View.Frame;
chartRect.Inflate(-30.0f, -30.0f);
_chart.Frame = chartRect;
_chart.AutoresizingMask = UIViewAutoresizing.FlexibleHeight|UIViewAutoresizing.FlexibleWidth;
_chart.Theme = IGChartGradientThemes.IGThemeDark();
_chart.Delegate = new ChartViewDelegate();
this.View.Add(_chart);
_chart.AddSeries(new MonoTouch.ObjCRuntime.Class("IGColumnSeries"), "series", _source, "xAxis", "yAxis");


Objective-C
_chart = [[IGChartView alloc] initWithFrame:CGRectInset(self.view.frame, 30.0, 30.0)];
[_chart setAutoresizingMask:UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight];
_chart.theme = [IGChartGradientThemes IGThemeDark];
_chart.delegate = self;
[self.view addSubview:_chart];
[_chart addSeriesForType:[IGColumnSeries class] usingKey:@"series" withDataSource:_source firstAxisKey:@"xAxis" secondAxisKey:@"yAxis"];


Illustrated below is the final result when the project is ran.

image

Download the Source

The Xcode and Xamarin.iOS project source code for this article can be found at these locations.

Project source for Xamarin.iOS (C#)
Project source for Xcode (Objective-C)


Note: Remember to add IGChart.framework to the project if you're using Xcode, or IGChart.dll to the project if you're using Xamarin.iOS. The trial for NucliOS that contain the necessary files can be found here.

A much easier to read format of this post is available here.

Scratch - The Most Ingenious (and Simple) Programming Tool Ever Created!

$
0
0

In my first programming class back at National Computer Camp (shoutout to NCC grads!), there was no such thing as Scratch, or, a cute way to learn programming concepts. I sat there with my monitor and listened to my counselor, who was younger than I am now, and tried to puzzle out the logic behind these completely foreign concepts. The way things were made simpler for us was to use… BASIC.  

Now, fast-forward to the MOOC world with all kinds of adults from all over the world taking an intro to programming class over the internet. We have our shiny new VMs installed and we’re ready to go. However, some people have no background in programming logic – you know, for loops, if loops, while loops, Boolean statements, I could go on and on.

With the foresight of professors who have been around the block a few times, instead of diving directly into writing code, we started our class off with MIT’s Scratch.

What is Scratch?

The MIT creators describe Scratch as a graphical programming language. It was developed by the Lifelong Kindergarten Group at the MIT Media Lab and was made possible by funding from the National Science Foundation, Microsoft, Intel Foundation, MacArthur Foundation, Google, Iomega and the MIT Media Lab research consortia. The purpose of creating Scratch was to enable students “to think creatively, reason systematically, and work collaboratively.”

How Does That Translate to Programming?

The functionality of Scratch is actually ingenious, in my opinion. In a purely graphical interface, the user can select from a variety of programming functions to literally puzzle together a basic program. When you first install and open Scratch, you’re presented with the following home screen:

From here you can upload your own custom sprites to animate in your program, which is what I would suggest doing first. After you’ve gotten your creative out, turn your attention to the left hand toolbar. In the top left you have a variety of tool categories, which looks like this:

One of the best things about scratch is that it is about as wysiwig programming as you can possibly get. The motion category? Those manage the movement of your sprites. Sound? You guessed it, the audio. Variables? That allows you to create those pesky buggers who hold information! As you navigate through these categories you can get a pretty solid feel for the capabilities (and limitations as well) of Scratch. You’re not going to create the next $50million iOS app in here, but it is a really great place to get started and learn the basic concepts of programming.

How Exactly Can You Create Something With Scratch?

Creating with Scratch is the most fun aspect of the entire process! On the left toolbar below the tool categories, as you navigate through the categories, the tools available appear below the category section, and the category is highlighted (and the colors match, which makes my design brain very happy).

Once you have the toolbars available, all you have to do to create actions in your program is link the commands together. If you take a peek at the image above, you’ll see that each command conveniently even looks like a puzzle piece, to encourage you to build something awesome!  Here’s an example of a basic program that was created in Scratch:

As you can see, it’s incredibly easy to read through the commands and decipher what this program is intended to do – even for the most novice developer.

Bringing It All Together

Overall, this post is basically a big love-fest for Scratch. Coming back into programming cold after not working with code or coding concepts at all for years, being able to solely focus on the logic of what I wanted to build was invaluable. For me personally, Scratch gave me a chance to warm back up to programming without the struggle of syntax and that made my transition much smoother than it would have been otherwise.

Did You Actually Make Anything?

That’s a great question! I made the most in depth and amazing game known to humankind. You can play it live from the Scratch website!

Questions/Comments?

Feel free to comment here on my blog, or find me on Twitter @DokiDara.

By Dara Monasch

Android User Interfaces Resources

$
0
0

One of the biggest challenges for Android developers is the swift development of the operating system. No sooner was ‘Ice cream sandwich’ released (December 2011) then ‘Jelly Bean’ came along (twice actually - June and November 2012 - Google didn’t deem the second release worthy of a new name). This poses a number of issues, not least changes to the user interface standards and styles used in the various versions. ‘Honeycomb’, released in February 2011, is a case in point. This was the first version of the OS designed specifically for tablet devices, and as a result had its own unique interface requirements. ‘Ice cream sandwich’ unified the OS for the first time, and again Google introduced new guidelines to cater for the wider range of devices supported.

So how is a good developer supposed to keep up? What help is available to ensure Android interfaces match their mobile rivals? One of the best ways is to use pattern libraries. These websites and resources provide standard interface patterns (as well as tips and tricks, and code samples) to help developers create beautiful user interfaces. Specialist sites exist, which focus solely on Android devices, and below we present our current favorites. Check them out and let us know in the comments if you use any other good ones.

Android Pattern Libraries

  • The official Android developer’s site
    • Your first stop should be the official Android site. This contains the latest guidelines and documentation, and should be treated as the most up-to-date advice available.
  • Android App Patterns
    • This site includes well over a thousand screenshots across a wide range of categories (such as calendars, maps, menus etc.). This site also includes screenshots of 150 complete apps, which provides a really nice way to look holistically at how an app is made up.
  • Android Patterns 
    • This site contains a great number of wireframes covering all aspects of Android apps. The depth of content is fantastic, with many pages offering extra tips, pros and cons, sample screenshots and more. An essential resource.
  • Android UI Patterns
    • More of a blog than a traditional patterns site, this site offers a number of useful articles and resources.
  • Smashing Magazine
    • Smashing Magazine is a great resource for developers, and generally has a good focus on interface and design articles. The linked article, from last year, includes some very useful tips for designing Android apps.

If you are looking for a High quality book on Android design with a focus on patterns and anti-patterns check out “Android Design Patterns” by Greg Nudelman.  This book was tech-edited by Infragistics Principal Design Technologist, Ambrose Little

ReportPlus v2.0 released!! More than 50% off for April!!

$
0
0

I'm very pleased to announce that a brand new release of ReportPlus is available for download in the app store. It's the second major release, ReportPlus v2.0, and It shipped with some amazing features such as:

  • iPhone support, 
  • Dashboard styling & branding
  • Dashboard Templates
  • Localization
  • Open & Save from repositories in the Cloud
  • Password locked dashboards
  • Plus a host of new data source connectors

This release was aimed at broadening the audience and appeal of the application. It's about giving more options to the user, at very different levels, device, style, languages, and also connectors. Always staying true to the vision of a self service & collaborative approach to generating business intelligence assets anywhere, allowing to share them in different formats.

Not only iPad anymore

With version 2.0 ReportPlus stops being an iPad only application, to include iPhone support as well. Taking after SharePlus, we've made ReportPlus a universal build. Meaning with the same purchase you can get it in all your iOS devices (iPod Touch, iPhone & iPad).

It's a pocket version of the iPad's user interface, but it has all the same features and capabilities of the iPad experience, so you can use it both for viewing, and for creating dashboards.

iPhone Business Intelligence

Dashboard Styling & Branding

From now on, ReportPlus' dashboards don't have to stick with the same look & feel of white background and dark titles. You can style both at the dashboard level, as well as at the widget level background color, title, margins, paddings, etc. 

We did this for two reasons. The first one is to allow the designer of a dashboard to incorporate gestalt principles of visual perception, such as: proximity, enclosure, and similarity into the dashboard design process . By establishing (or removing) margins, and borders between dashboard widgets the user is able to provide grouping and association cues, that will help the viewer digest the information better.

The second one is to enable the designer to incorporate corporate branding material into the dashboard design, something that according to our user base is desirable in some scenarios, specially when dashboards are being shared across organisational boundaries, and you need to leave a very clear mark of where the value was generated from. 

The following are two sample styled dashboards.

NewImage

Mobile BI Dashboard

Dashboard Templates

Dashboard templates are pre canned dashboards meant to minimize the time to value of the application. It's a shortcut to have a dashboard up & running connected to your data, without the need for the user to be savvy on concepts such as data aggregations, and data analysis. It's included in the dashboard creation process as an alternative option. This release ships with 10 preloaded templates, with time, we'll be adding more and improving the existing ones. 

Dashboard Template ReportPlus

Open & Save dashboards from shared repositories

Some users would generate awesome dashboards, and would email them to management. Management would be delighted, but would always request some change, which leads to another email with the modified version, and then another, and before you know it you have different versions of the same dashboard on your inbox. Version 2.0 enhances this type of collaboration by allowing users to save and open dashboards from shared file repositories such as: SharePoint, Google Drive, and Dropbox, making this iterative dashboard design process flow better. By the way the enterprise version has an even improved version of this, but I won't go into that now.

ReportPlus Open Dashboard

Password locked dashboards

Enabled password lock in order to share dashboard for viewing only purposes, retaining control over who makes changes to a dashboard's design.

Dashboard

More & more popular data source connectors

ReportPlus v2.0 ships with support for connecting to many new data sources, among them:

  • Microsoft Dynamics CRM
  • Salesforce
  • PostgreSQL
  • Hadoop Hive
  • Google Drive
  • Google Analytics
  • Facebook Analytics
  • Twitter

Promotional price for the next 5 days

Get a 66% discount by purchasing it before May comes! Then it will go back to it's 29.99 usual price.

Viewing all 2372 articles
Browse latest View live




Latest Images