Project Description
The library is used to push points to Leftronic dashboards using the Leftronic HTTP API.

What is currently included?
  • Push a single or multiple points.
  • Support all custom data widgets.

How to use?
// Create and initialize the simple Leftronics poster.
var poster = new SimplePoster();
poster.Init();

// Create an empty list of data to push.
var points = new List<BaseModel>();

// Push to a spark line widget.
points.Add(new NumberPoint { Number = 10, Prefix = "$", StreamName = "spark" });

// Dials, bars and stoplight widgets all use the same type.
// Push to a horizontal bar widget.
points.Add(new NumberPoint { Number = 99, Suffix = "EUR", StreamName = "horbar" });
// Push to a vertical bar widget.
points.Add(new NumberPoint { Number = 12.1m, Suffix = "EUR", StreamName = "verbar" });
// Push to a number widget.
points.Add(new NumberPoint { Number = 199, StreamName = "number" });
// Push to a dial widget.
points.Add(new NumberPoint { Number = 25, Suffix = "%", StreamName = "dial" });
// Push to a stop light widget.
points.Add(new NumberPoint { Number = 51, StreamName = "stoplight" });

// Push points to a bar chart widget.
points.Add(new BarChart
{
    StreamName = "bargraph",
    Points =
        new List<BarChartPoint>
        {
		new BarChartPoint {Name = "Income", Value = 2500, Color = Colors.Green},
		new BarChartPoint {Name = "Cost", Value = 2100, Color = Colors.Red}
        }
});

// Clear another bar chart widget by pushing an empty list.
points.Add(new BarChart
{
    StreamName = "salesbar",
    Points = new List<BarChartPoint>()
});

// Push to a text feed widget.
points.Add(new TextFeed
{
    StreamName = "textfeed",
    Feed = new List<TextFeedPoint> {new TextFeedPoint {Message = "15$", Title = "Sold an item"}}
});

// Show an image.
points.Add(new Image { StreamName = "image", Url = "http://cdn.ttgtmedia.com/ITKE/uploads/blogs.dir/36/files/2011/07/mega-icon-smiley-thumbs-up.jpg" });

// Update a label widget.
points.Add(new Label { StreamName = "label", Message = string.Format("Updated: {0}", DateTime.Now.ToString("yyyy/MM/dd HH:mm")) });

// Push all points and get errors back.
var errors = poster.Post("YourLeftronicsAccessKey", points, false);

Source code
Provided code has been created using Visual Studio 2012 and is build for .Net 4.5.1.

Last edited Mar 22, 2014 at 8:06 PM by nickntg, version 4