Charting live data with .NET C# - c#

I am looking for a way to chart data using C# .NET. I have a SQLite file containing the data I wish to chart, but the data is updated every 15 seconds and I would like to have the ability to "animate" or live update the data at a specified interval.
I was using ASP.NET charting controls but found it to slow down as more data is added. When I was using this method, I simply placed an auto refresh on the page and regenerated the graph each time.
I am open to using any .NET technology available to present this data (i.e. Silverlight, WPF, .NET, etc.).
I also would like to avoid using any third party PAID software, FOSS .NET solutions are fine.
Does anyone know how to present the data and generate the graph so the chart only renders additions instead of rebuilding the entire graph each time the "page" is reloaded?
Thanks!

WPF and Silverlight both support data binding. If the data being monitored supports INotifyPropertyChanged and, for collections, INotifyCollectionChanged, then some behind-the-scenes observer pattern technology gets hooked up and you can get have portions of your GUI respond to very precise changes in your data rather than having to refresh everything. This technology is probably exactly what you are looking for, but may take a little legwork on your part if you aren't familiar with the technology, which is one of the backbones of WPF and of Silverlight.
Fortunately, getting started is not hard, and is a great investment in knowledge. Perhaps start with one of the many free databinding tutorials, or I recommend one of the web certification video courses, such as those offered by PluralSight.

Well i would suggest some Commercial Control's which works fine and are fast enough .
http://devexpress.com/Products/NET/Controls/Charting/
http://www.componentone.com/SuperProducts/Chart/

I have developed a couple of systems that streamed high frequency financial data to client browsers. They used:
Silverlight for the ui.
Silverlight toolkit for the charting components.
a .net server service to collate and push the updates to the clients.
.net sockets used as the transport mechanism. In your case, the updates are relatively infrequent, so you could use Duplex WCF.
I would suggest looking at tutorials on :
Silverlight MVVM
.Pushing data to Silverlight apps using WCF
.Silverlight toolkit
optionally .net sockets
In using Silverlight and pushing updates to the client this way, only the new/ updated data changes, therefore only this data is rendered and there are no page reloads.

Related

Get data from FarPoint Spread control running in another application

I'm attempting to write a application in C# utilizing the Microsoft UI Automation framework. The application to be controlled uses a component called "FarPoint Spread". It's easy enough to automate the rest of the application (e.g. its WinForms controls), but I can't seem to do anything with the FarPoint Spread control.
I'm still very green when it comes to programming. I've got just the basics of C# and UI automation down. Just need someone to point me to the information I need to have to automate this Spread component (if that's even possible). Thanks!
The problem is the grid rendering in Spread is written probably using custom code, and it's not equipped with what UI Automation expects.
I have tested the Sample Explorer provided by GrapeCity here (http://spread.grapecity.com/Pages/Demos/) with UI Automation's Inspect tool, and once you get to the data grid itself, there's nothing shown in Inspect.
There's also this topic in GrapeCity's forums:
Is Spread even supported in coded UI test which clearly states (2 years ago) it's not supported (as you known VS Coded UI also uses UI Automation as the underlying technology).
So, I guess it's not possible to automate Spread using UI automation (maybe they have their own system, you'd have to contact them).

Charting Solution for Windows Service

I need to create 100s of graph through automation, I try couple of library for charting from codeplex. however none of them works for me as they all expect either a WPF or Windows Forms interface to be present. Since I need the task to be done using Background windows service such libraries won't work for me.
I am not stuck to use ZedGraph, yeah it is one of the best library, but the Chart quality is way too dim, I use MSChart with ASP.NET projects of mine, they have such a smooth curves, but ZedGraph doesn't.
Now my only question is: Which is the best library in terms of visual as well as in terms of feature like zedgraph to use for windows service. I prefer if someone tell me how I can improve zedgraph really quick if possible.
If you are using a SQL Server you could use Microsoft's SQL Server Reporting Services which is abbreviated to SSRS. This is similar to Crystal Reports in so much as you can design your report with graphs, tables, textual information etc and then when run the information is populated from your database.
SSRS can be called either by a front-end application or simply as a web service call (via your Windows Service) that can generate the report and save to either Excel, PDF etc.
This is industry recognised and a good place to go if you already have SQL Server. I also mentioned Crystal Reports that you may also want to check out.

How to use Microsoft Excel as a Grid control in C# winforms?

Are there any good samples of using Microsoft Excel as a grid control in a typical winform C# application.
I have come across a lot of threads talking about excel 'like' control or grid controls with functionality similar to Excel etc.
Why not use excel as a GRID control , it has all the goodies in build ( formula engine , sorting, filtering etc )
You certainly can host Excel as a control within a WinForm application, so part of what you want is possible (with major caveats). However, to wire up the rest of the functionality seen in many of the 3rd party grid libraries takes a lot of work, and has many pitfalls.
The prime reason for this is that Excel is a native Windows application, and is not running under the .Net framework. Therefore, all of the manipulation has to be done at arms length - you have to instantiate the application, instantiate a sheet, try and subscribe to certain events (many of which may not be available as Excel was not designed for this purpose), and, of course, try and propertly manage all of the COM references to avoid memory leaks.
The grid controls you mention have all been built from the ground up as controls to be hosted within .Net applications, and therefore expose properties and events around the type of grid style interactions that people want - remember, Excel is more than a grid.
However, as if to acknowledge that Excel can be a powerful tool when leveraged programmatically, Microsoft provided VSTO - a runtime that allows you to develop Excel (and other office applications) using .Net
As far as I know, there are no .NET controls for embedding Office applications.
Earlier you could use the DSOFramer to achieve what you want but then it was discontinued. I believe it still works though (I am not sure). The Web Browser (COM) control is an alternative to DSOFramer, but has its own drawbacks. For example, you cannot use the inbuilt "Goodies".
The below is just my personal opinion
I doubt that MS will never support embedded Office applications and the reason is very simple. MS-Office Applications are "End-User-Targeted" products. You need separate licenses for it and from a business perspective they wouldn't want to loose on that :) Like I mentioned earlier these are just my personal thoughts and do not echo MS's views.

Ideas for a C# UI framework

I need to develop a C# touch-screen desktop application with a "modern good-looking" UI.
How would you approach it? I´ve got in mind using Flash (just for the UI) or WPF... but i´m open to any idea or any third-party C# UI you´d know.
Is Flash easy to integrate with C#?
Thanks for your knowledge!
You should look for a AMF remoting library in C#.
Remoting is when you call a function on your server from flash.
AMF (version 0 or 3) is a binary format used to encode object transfered
between client and server
Weborb and fluorine are solutions for this.
see : .NET and AMF
You will probably be doing well with a third party framework to avoid the overhead of writing user interactions, controls, etc.
A couple of options are
http://xamarin.com/
http://www.resco.net/developer/mobileformstoolkit/
A review of these options is provided here.
I recall combining a flash interface with a C# back-end back in university. There's a method called fscommand() that will take a couple of string parameters (I may be mistaken, read up on it) to pass to and from the interface and the C# "code-behind".Flash is an ok option, but if I were you I'd opt for a WPF interface. I'm a huge fan of the telerik libraries, their WPF one allows you to create the most modern-looking interfaces and dashboards. Not to mention that the skills you will acquire while learning enough about wpf will be hugely beneficial in your career as a developer the way things are going (depending, obviously, on what direction you're heading).
FlashBuilder 4.6 has some nice functionality for quickly building a UI that work on a desktop or mobile device. You could use FluorineFX (free) or webOrb on a webserver to send data back and forth to a database server if that were needed. If you build it with the Flashbuilder 4.6 mobile project template, it would work on a iPad, mac, windows pc, or android device as well. Since a pc touchscreen should use the same type of finger gestures as a mobile app, this might be a nice way to go. (I don't actually have a touchscreen on my pc, but it runs well with a mouse, so I'd assume it worked with gestures too).
Adobe.tv has lots of examples of building a mobile app project (Which also runs on a PC) and there is a Flashbuilder 4.6 free trial.
http://flex.org/

Using Monocross on Windows Phone 7 with Panorama and/or Pivot control

I love the Monocross idea but am a bit lost for Windows Phone 7 when I want to use a Panorama and/or Pivot control. The only view provided is the Page view. So navigating from one page to another works great! But now I want a Pivot or Panorama. Basically I could create a new controller for this view, but do get the "pages" inside the controls. The navigate does really Navigate to it, but not inside the Pivot / Panorama.
For Monotouch and MonoDroid samples have been prepared how to do this (basically a new viewcontroller was created). But WP7 has been left behind.
Anybody?
I am also doing cross platform development using mono and like you and many others face the problem of what to do with respect to the user interface and other underlying hardware integration.
I decided that I did not want to be at the mercy of yet another third party framework (mono is enough) and researched for a solution that I could build and maintain myself. The new MVVM pattern along with Expression Blend is really cool but soon you find yourself stuck when it comes to cross platform development.The MVC an MVP patterns also did not seem to suit what I needed. Finally settled on the PM pattern and expanded it into a PMH where the H is for hardware. To achieve what I needed I had to abstract the fundamental widgets (buttons, panels, textboxes) into a underlying platform layer for each device type. My platform layer represents around 1% of my code base and allows me to skin the application for each device I target it for.
For my WP7 solution I use hardly any HTML only around 25 lines which is enough to initialise the application and the main page. The rest of the user interface is put together programmatically just like I would in WinForms. On WP7 I still make use of the Pivot control as it really is pretty groovy and am modelling a similar control for use on Android/iPhone. While it wont be 100% the same it will be very similar and still use the same navigation engine within my core code.
I am not complete with my development yet but so far I am very happy with my progress. I have been developing user interface for Windows application for some 20 years and I never use the interface builder tools as I find they never give me what I want and really waste my time (Blend is pretty cool though) and also create a tremendous code bloat especially in Blend.
I can't entirely help with monocross - I did do a sample for droid once - https://github.com/slodge/monocross-tab-activity-view - but I never completed the wp7 part of that.
For mvvmcross... which is related... there's a couple of samples - one in the tutorial (a bit hacky!) and one in the conference app - much the preferred sample.
The basic technique I choose was to use sub-viewmodels for each "tab" of the panorama - see how the databinding DataContext is set for each Item in https://github.com/slodge/MvvmCross/blob/master/Sample%20-%20CirriousConference/Cirrious.Conference.UI.WP7/Views/HomeView.xaml
Note that in a bigger app there may be important memory issues to consider when doing this - especially when using a pivot control which does not load all pages into memory at the same time (so you don't really need to load all viewmodels either)
Some bloggage on the conf app: http://slodge.blogspot.co.uk/2012/03/update-on-mvvmcross-sqlbits-conference.html
And the final sql bits source: https://github.com/slodge/MvvmCross/tree/master/Sample%20-%20CirriousConference

Categories

Resources