.--. .-.               .-.    _  _   
: .--': :              .' `. _: :: :_ 
: :   : `-.  .--.  .--.`. .':_  ..  _:
: :__ : .. :' .; ; : ..': : :_      _:
`.__.':_;:_;`.__,_;:_;  :_;   :_;:_;  


Project Description

Simple Google Charts API wrapper for .NET projects. Inspired by the Google Charts Sharp project on Google Code.

Supported Chart Types
  • Bar chart
  • Line chart
  • Pie chart
  • Scatter plot
  • Venn diagram
  • QR code

Future Chart Types
  • Radar chart
  • Maps
  • Google-o-meters


Usage

The library provides a simple fluent syntax for creating charts using the Google Charts API. A couple of examples are shown below.

Bar Chart

var chart = new BarChart(BarsType.Grouped, BarsDirection.Vertical)
    .BarSize(6, 1)
    .Size(420, 125)
    .Color(new[]
    {
        "AA0000",
        "0000AA",
        "00AA00",
        "AA00AA",
    })
    .DataSet(new int[][]
    {
        new[] { 10, 20, 30, 40, 50, 60 }, 
        new[] { 60, 50, 40, 30, 20, 10 },
        new[] { 10, 20, 10, 20, 10, 20 },
        new[] { 50, 60, 50, 60, 50, 60 },
    })
    .Title("My Grouped Bar Chart", "333333")
    .Legend(new[]
    {
        "Summer",
        "Winter",
        "Autumn",
        "Spring",
    });


Line Chart

var chart = new LineChart()
    .AxisType(new ChartAxisType(new[]
    {
        AxisTypes.x,
    }))
    .AxisLabel(new ChartAxisLabels(new string[][]
    {
        new[] { "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" },
    }))
    .LineStyle(new ChartLineStyles(new[]
    {
        new LineStyle(3, 7, 1),
        new LineStyle(2, 7, 1),
    }))
    .Size(300, 125)
    .Color(new[]
    {
        "1E90FF",
        "AA0000",
    })
    .Title("Line Chart\nSimple", "808000", 10)
    .DataSet(new int[][]
    {
        new[] { 1, 25, 26, 51, 52, 61, 1 },
        new[] { 1, 61, 52, 51, 26, 25, 1 },
    })
    .Legend(new[]
    {
        "Summer",
        "Winter",
    });


Pie Chart

var chart = new PieChart(PieChartType.ThreeDimensional)
    .Size(200, 200)
    .Color(new[]
    {
        "1E90FF",
    })
    .Title("Pie Chart\nSimple", "808000", 10)
    .DataSet(new[]
    {
        30, 30, 40
    })
    .Legend(new[]
    {
        "A",
        "B",
        "C",
    });


Scatter Plot

var chart = new ScatterPlot()
    .Size(420, 125)
    .Color(new[]
    {
        "1e90ff",
    })
    .Title("Scatter Plot\nSimple")
    .DataSet(new int[][]
    {
        new[] { 10, 20, 30, 40, 50, 60 },
        new[] { 10, 25, 40, 54, 30, 5 },
        new[] { 20, 50, 10, 50, 20, 20 },
    });


Venn Diagram

var chart = new VennDiagram()
    .Size(420, 125)
    .Color(new[]
    {
        "AA0000",
        "00AA00",
        "0000AA",
    })
    .Title("Venn Diagram\nSimple")
    .DataSet(new[]
    {
        100, 80, 60, 30, 25, 20, 10
    });


QR Code

var chart = new QR.QRCode(40, 40)
    .Text("Hello CodePlex!")
    .Encoding(QR.EncodingType.UTF8);

Last edited Sep 29, 2009 at 4:51 AM by tbell, version 8