In this article I’m going to explain how to create Google combo chart example with database in ASP.NET.  

        Google charts allows you to create a chart that lets you render each series as a different marker type from the following list:

·         line,

·         area,

·         bars,

·         candlesticks

·         stepped area.

To assign a default marker type for series, specify the seriesType property. Use the series property to specify properties of each series individually.

 

          Following screen shots are demonstrate various marker type used to create different combo charts.

 1.  seriesType: line – series: area

 

2. seriesType: area – series: line

 

3. seriesType: bars – series: area

 

Sample data:

 

id

Month

Bolivia

Ecuador

Madagascar

Average

1

2004/05

165

938

522

614.6

2

2005/06

135

1120

599

682

3

2006/07

157

1167

587

623

4

2007/08

139

1110

615

609.4

5

2008/09

136

691

629

569.6

 

 

Designer source code:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

 <head>

 <title>Google Combo chart</title>

    <script type="text/javascript" src="https://www.google.com/jsapi"></script>   

  </head>

<body>

    <form id="form1" runat="server">

    <div>

    <asp:Literal ID="lt" runat="server" ></asp:Literal>

   <div id="chart_div" style="width: 660px; height: 400px;"></div>

    </div>   

    </form>

</body>

</html>

 

C# code:

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Data;

using System.Data.SqlClient;

using System.Text;

public partial class _Default : System.Web.UI.Page

{

    SqlConnection conn = new SqlConnection("Data source=localhost; Initial catalog=Demo; Integrated security=true");

    protected void Page_Load(object sender, EventArgs e)

    {

        BindChart();

    }

    private DataTable GetData()

    {

        DataTable dt = new DataTable();

        string cmd = "select * from Production";

        SqlDataAdapter adp = new SqlDataAdapter(cmd, conn);

        adp.Fill(dt);

        return dt;

    }

    private void BindChart()

    {

        DataTable dt = new DataTable();

        StringBuilder str = new StringBuilder();

        try

        {

            dt = GetData();

 

            str.Append(@" <script type='text/javascript'>

                      google.load('visualization', '1', {packages: ['corechart']});

                    </script>

                    <script type='text/javascript'>

                    function drawVisualization() {       

                    var data = google.visualization.arrayToDataTable([

                    ['Month', 'Bolivia', 'Ecuador', 'Madagascar', 'Average'],");

 

            int count=dt.Rows.Count - 1;

            for (int i = 0; i <= count; i++)

            {

                if (count == i)

                {

                    str.Append("['" + dt.Rows[i]["Month"].ToString() + "'," + dt.Rows[i]["Bolivia"].ToString() + "," + dt.Rows[i]["Ecuador"].ToString() + "," + dt.Rows[i]["Madagascar"].ToString() + "," + dt.Rows[i]["Average"].ToString() + "]]);");

                }

                else

                {

                    str.Append("['" + dt.Rows[i]["Month"].ToString() + "'," + dt.Rows[i]["Bolivia"].ToString() + "," + dt.Rows[i]["Ecuador"].ToString() + "," + dt.Rows[i]["Madagascar"].ToString() + "," + dt.Rows[i]["Average"].ToString() + "],");

                }

            }

           

            str.Append("var options = { title : 'Monthly Coffee Production by Country', vAxis: {title: 'Cups'},  hAxis: {title: 'Month'}, seriesType: 'bars', series: {3: {type: 'area'}} };");

            str.Append(" var chart = new google.visualization.ComboChart(document.getElementById('chart_div'));  chart.draw(data, options); } google.setOnLoadCallback(drawVisualization);");

            str.Append(" </script>");

 

            lt.Text = str.ToString();

        }

        catch (Exception ex)

        { }

    }

}

 

Please refer this link for further reference

https://developers.google.com/chart/interactive/docs/gallery/combochart

cytotec abortion

http://www.extrageek.com/template/default.aspx?an-abortion-pill buy abortion pills online
medical abortion pill online abortion pill abortion pill


View demo Download
http://www.dotnetfox.com/Document/1099/0Demo1.gif

If you enjoyed this article, get email updates (it's free).


Related Articles
  • How to create dynamic Google chart in ASP.NET using C#In this article I’m going to explain how to create dynamic Google chart in ASP.NET using C#. I got a requirement that I should make graphical representation for statistics data. So I’ve preferred to create Pie Chart. Already we’ve standard web control for Pie Chart in ASP.NET and AjaxControl Toolkit provides controls for Pie Chart. Google provides functionality to create Pie Chart in ASP.NET. Here...
  • How to create dynamic Ajax Pie Chart in ASP.NET using C# In this article I’m going to explain how to create dynamic Ajax pie chart in ASP.NET using C#. Ajax Control toolkit provides a ways to create Pie Chart that would be display the statistics data in graphical representation. The PieChart control enables you to render a pie chart from one or more PieChartValues. I already wrote some articles related to Chart
  • How to create dynamic Ajax Bar Chart in ASP.NET using C#In this article I’m going to explain how to create dynamic Ajax Bar Chart in ASP.NET using C#. Ajax Control toolkit provides a ways to create Bar Chart that would be display the statistics data in graphical representation. The BarChart control enables you to render a bar chart from one or more series of values. I already wrote some articles related to ASP.NET Chart
  • How to create dynamic Ajax Area Chart in ASP.NET using C#In this article I’m going to explain how to create dynamic Ajax Area Chart in ASP.NET using C#. Ajax Control toolkit provides a ways to create Area Chart that would be display the statistics data in graphical representation. The AreaChart control enables you to render area chart from one or more series of values. I already wrote some articles related to ASP.NET Chart.
  • Bind ASP.NET chart control from database using C# In this article I’m going to explain how to bind chart control from database in ASP.NET using C#. The Chart controls enable you to create ASP.NET pages with simple, intuitive, and visually compelling charts for complex statistical or financial analysis Here I’ll show you how to bind chart from SQL Server database.
  • Export Chart control to PDF document in ASP.NET using iTextSharp and C#In this article I’m going to explain how to export ASP.NET chart control to PDF using C#. I have already written an article about bind ASP.NET Chart control from database. You could refer this article by following this below link. Bind ASP.NET chart control from database using C#. If you are not aware to include iTextSharp.dll in ASP.NET project you could read this article How to create PDF docume...
  • Create google Geochart with region mode in ASP.NETIn this article I’m going to explain how to create google Geomap with region mode in ASP.NET. A Geochart is a map of a country, a continent, or a region with two modes: The region mode colorizes whole regions, such as countries, provinces, or states. The marker mode marks designated regions using bubbles that are scaled according to a value that you specify. A Geochart is rendered within the brows...
  • Create google Geochart with Marker mode in ASP.NETIn this article I’m going to explain how to create google Geomap with marker mode in ASP.NET. A Geochart is a map of a country, a continent, or a region with two modes: The region mode colorizes whole regions, such as countries, provinces, or states. The marker mode marks designated regions using bubbles that are scaled according to a value that you specify. A Geochart is rendered within the brows...
  • Create multi column or multi series bar chart from database in ASP.NET In this article I’m going to explain how to create multi column or multi series bar chart from database in ASP.NET using C#. The Chart controls enable you to create ASP.NET pages with simple, intuitive, and visually compelling charts for complex statistical or financial analysis. If you want to create multi series bar chart you could follow the steps given below. Step-1: First drag and drop Chart...
  • How to install or configure Fusion Charts in ASP.NETFusionCharts Free can effectively be used within ASP.NET applications. For the sake of better understanding, we have developed few sample applications using ASP.NET C#, where we have shown how easily FusionCharts can be integrated with ASP.NET. You can download Fusion charts by following the link given below or you can download source code which has been attached along with this article.

Comments
comments powered by Disqus

Thanks for downloading..!!

×
Subscribe via Email
    
message to display in fancybox