Posts Tagged ‘Silverlight’

Silverlight charts using visifire and asp.net

Monday, July 19th, 2010

A drill down chart is an interactive component that lets the user drill down through levels of data thereby providing a rich user experience. It is a common requirement in projects to create reports for different levels of data. Recently our research and development team experimented an open source charting tool visifire which makes use of the Microsoft silverlight plugin in the browser and JavaScript to render the graph. Since it is done on client side the server response is made lighter. These charts can be embedded into desktop or web applications or even into mobile applications (Windows phone 7 series). Visifire does not provide a ready to use feature for creating live charts that can be drilled down to lower levels, which can however be achieved by making use of javascript events. Visifire has got an in-built event handler to invoke these events triggered while clicking on various points on the chart. Let’s see how this can be done.

Consider the example of a column chart which gives the year wise project completion status for a client. Now, on clicking on one of the columns, it should show the number of projects completed in different platforms (say .net, php, iPhone, android etc), for that corresponding year.

For the second level of chart to be rendered, the click event of the first chart should be captured which calls a javascript function, which can be implemented by adding a few lines of code as follows, before rendering the chart. 

//vChart1.preLoad = function(args)

  {

   chart1 = args[0];

      chart1.Series[0].MouseLeftButtonUp = function(e)

   {

                 onMouseUpProjectsPerPlatform(e.AxisXLabel);

            };

  }; //

On clicking one of the columns of the first chart, a call is made to the javascript function ‘onMouseUpProjectsPerPlatform’, which accepts one parameter, the AxisXLabel of the first chart, which here is the ‘year’ selected. On obtaining the year, we can render the next level, by generating the required xml. This can be done entirely from the client side, but in most cases, we will have to pull data from the database and generate the xml from the server side. To generate the XML from code behind, we can make use of pagemethods or webservices.

Rendering of the chart from the server side is accomplished using RegisterStartUpScript,. However this is meaningless in a webmethod, and we have to return the xml to the calling function.

//function onMouseUpProjectsPerPlatform(var year)

{

      // call to the web method, which returns the required xml.  

//}

We can now render the xml to the required HTML container element from the OnSucces function of the webmethod call. 

//function OnSuccess(xml)

{   

    vChart2.setDataXml(xml);

    vChart2.render("htmlElementID");

//} 

In the above instance, we can add a third level which gives the month wise project completion status for that year and selected platform.

Dotnet team @ Software Associates

    Getting ready with HTML 5

    Friday, June 11th, 2010

    The much awaited HTML5, the major revision of HTML, is expected to take over the world wide web by the end of 2010. It is considered to be the major replacer for HTML 4.01, XHTML 1.0. The most notable feature of HTML5 is its big foot over the plug-in-based rich internet application (RIA) technologies such as Adobe Flash, Microsoft Silverlight, and Sun Java FX. The reason is that, HTML 5 can do whatever these applications can, in a perfect manner with its powerful set of tags and related attributes. If it is about the origin of HTML5, it’s a different story.

    The core developers of HTML, the W3C was found to focus much on XML and XHTML rather than looking forward to real world application needs. The HTML working group felt disturbed over this and they formed a new group called Web Hypertext Application Technology Working Group (WHATWG).It focused purely to evolving web and its future .This group is the core team behind HTML5 and maybe that is why HTML5 is not a W3C recommendation yet. The latest news from Adobe Dreamweaver is that the new version Dreamweaver CS5 will be supporting the HTML5 and CSS3 in its full flavours.

    Now looking over to HTML5 and conventional HTML, the following are the basic changes as an overview.

    1) Simple DOCTYPE

     HTML5 requires very simple DOCTYPE: <!DOCTYPE html>.

    2) Easy attributes for language

    In HTML5 we don’t need to remember xml:lang attributes in the <html> tag. <html lang=”en”> will now make it work.

    3) Trailing slashes taken off

    Void elements in HTML5 such as the br, img and input elements don’t require a trailing slash.

    4) Elements disappeared

    These are the following set of element not supported in HTML5:

    <acronym>, <applet>, <basefont>, <big>, <center>, <dir>, <font>, <frame>, <frameset>, <noframes>, <s>, <strike>, <tt>, <u> and <xmp>

    New tags on deck

    HTML5 Introduces, a very distinct set of powerful new tags.

    ·         audio – denoting an audio stream
    ·         source – the video or audio source files
    ·         video – denoting a video stream
    ·         canvas – a place to draw dynamic graphics
    ·         command – denotes a command button that has information sent to the server or script
    ·         datagrid – references dynamic data in a tree form or tabular data form
    ·         datalist – references a list of data in a drop-down list
    ·         details – provides additional details of a page element, like pop-up help text
    ·         output – references the output of a script or calculation
    ·         progress – represents a progress bar in the completion of a process
    ·         dialog – a conversation or people talking
    ·         hgroup – a grouping of header tags that should stay together
    ·         meter – a scalar gauge of measurement
    ·         time – a date or time

    Features

    High level of user privilege is the most highlighted feature of HTML5.The very new set of tags plays a crucial role for this achievement. . Of all tags  <video> takes the videos through web to a new level. HTML 5 video ensures maximum reach by allowing you to encode your video in as many formats as you need, so that your customers don’t need an additional plugin for viewing the video. It also lets you control every aspect of your video, from who can view it, how long it is, what the content is, where it's hosted and how the server performs etc as far we know till now.

    Considering the Browser side, Google chrome, upcoming IE9, Apple safari, firefox 4.0 etc   are all set up for providing a perfect support for HTML5 pages.

    Drawbacks

    Some of the drawbacks pointed against HTML5 are based on hosting HTML5 videos to sites like youtube. They are

    ·         Encoding of video in at least three different codecs is needed
    ·         Browsers that don't support HTML 5 will work only with the aid of some set of java scripts
    ·         Bandwidth requirements of hosting videos must be satisfied

    Another problem developers have to face is the conversion of XHTML 1 to HTML5, unless we have a well formed and valid XHTML document

    HTML Team @ Software Associates

      Visual studio 2010, .NET framework 4, Silverlight 4 released – Software Associates

      Wednesday, April 14th, 2010

      Web developers around the world have something new to look into. Microsoft Corporation has announced the general availability of Visual Studio 2010, .NET Framework 4 and Silverlight 4 in the second week of April 2010.  These  technologies in combination can take advantage of new and existing devises and emerging platforms.

      This web application framework is an upgrade to the rich internet plug-in platform that integrates multimedia, animation, graphics and interactivity into single runtime environment. Since its first release in 2007, the framework has been enhanced to be compatible to the emerging technologies.

       The current version of the Silverlight, will be released to web on 15th April 2010. The feedback are hence yet to be waited for.

      Some of the highlighted features included are:

      • Google Chrome compatibility 
      •  Extended out-of-browser capabilities. It provides XAP signing and verification for application integrity as well as custom window chrome for application presentation flexibility.
      • Leveraged for application development on Windows Phone 7 platform.
      • Printing and control capabilities
      • Pre-written control for quickly build rich, interactive applications.
      • Web cam and microphone support
      • Browser support for rendering HTML inside Silverlight
      • Content protection for H.264 and support for playing offline DRM protected media.

       

      The new release is expected to offer powerful business application capabilities in simpler and efficient ways.

       

      Visual Studio 2010

      We have already talked about Visual Studio 2010 in detail, we would be covering it here in brief. This version was developed to reduce clutter and complexity of the previous versions.

       For the Visual Studio developers

      • The new editor use Windows Presentation Foundation which supports multiple monitor and multiple document windows.
      • Integrated access of Sharepoint functionality into Visual Studio IDE. 
      • Windows Azure tools to quickly develop, debug, test and deploy cloud applications from within the familiar Visual Studio environment.
      • Built-support for ASP.NET Model-View-Controller to separately update the appearance and core business logic of applications.
      • Integrated Phone Design Surface of Visual Studio for mobile application developments.
      • Enhanced testing and developing features.
      • Most of the common tasks have been automated
      • IntelliTrace .tool to trace non reproducible bugs by recording the application's execution history using
      • Includes Multi-paradigm programming language ML-variant F# , M-the textual modeling language, and Quadrant, the visual model designer
      • Quicksearch features
      • Windows 7 Multitouch and ribbon interfaces will increase the flexibility for the end users.

       

      Visual Studio 2010 comes with .NET framework 4 and supports application development targeting Windows 7. 

       

      .NET Framework 4

       

      .NET Framework 4 has come with additional support for industry standards. It requires operating systems such as Windows 7; Windows Server editions, Windows Vista; Windows XP etc

       A few of the features are:

      • More language choice
      • Support for high-performance middle-tier applications including parallel programming, and side-by-side installation with .NET Framework 3.5.
      • It includes Oslo modeling platform, along with the M programming language
      • Faster deployments

       More set of enhancements such as Dublin are been awaited.  

      We at Software Associates are eagerly awaiting the release!!

        By .NET Team, Software Associates