tags:

views:

8

answers:

0

I have problem with asp.net chart control - no matter what I set for ChartType (Line, Spline, Pie, Point ...), chart is ALWAYS rendered as column. Same thing when I try this through code.
Server runs .net framework 3.5

<%@ Page Language="vb"%>
<%@ Import Namespace="System.IO"%>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Net"%>
<%@ Import namespace="System.Data.SQLClient"%>
<%@ Import Namespace="Microsoft.ApplicationBlocks.Data"%>
<%@ Import Namespace="System.Configuration.ConfigurationSettings"%>
<script runat="server">
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim sql as String = "select x, y from tbl"
        Dim r As SqlClient.SqlDataReader
        Dim sb as New StringBuilder()
        r = SqlHelper.ExecuteReader(AppSettings("conn"), CommandType.Text, sql)
        ch.DataBindTable(r, "x")
        r.Close()
    End Sub
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
<html xmlns="http://www.w3.org/1999/xhtml"&gt;
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Chart ID="ch" runat="server" Width="600px">
           <Series>
              <asp:Series Name="example serie" ChartType="Line" ChartArea="MainChartArea"></asp:Series>
           </Series>
           <ChartAreas>
              <asp:ChartArea Name="MainChartArea"></asp:ChartArea>
           </ChartAreas>
        </asp:Chart>
    </div>
    </form>
</body>
</html>