tags:

views:

148

answers:

1

Hi everyone,

I am using the new ASP control "Chart", but I have some problems with it: I can't see anything when I execute the aspx. The data is binded to a ObjectDataSource, like this:

<asp:Chart ID="RcrBufferChart" runat="server" Visible="true" 
    DataSourceID="RcrBufferSizeODS" BackColor="WhiteSmoke" BackGradientStyle="TopBottom" 
    BackSecondaryColor="White" Palette="BrightPastel" BorderDashStyle="Solid" 
    BorderColor="26, 59, 105" Height="583px" Width="1159px" >

    <borderskin skinstyle="Emboss"></borderskin>

    <series>
        <asp:series Name="Series1" ChartType="Spline" ShadowColor="Black" 
            BorderColor="180, 26, 59, 105" Color="224, 64, 10" IsValueShownAsLabel="True" 
            XValueMember="CreationDate" XValueType="DateTime" YValueMembers="Size" 
            YValueType="Double"></asp:series>
    </series>

    <chartareas>
        <asp:ChartArea Name="ChartArea1">
            <AxisY Title="Tamaño RCR sin enviar">
            </AxisY>
            <AxisX Title="Fecha">
            </AxisX>
        </asp:ChartArea>
    </chartareas>

</asp:Chart>


<asp:ObjectDataSource ID="RcrBufferSizeODS" runat="server" 
    SelectMethod="GetByAppliance" 
    TypeName="Esabe.Grazalema.Business.RcrBufferSizes">
    <SelectParameters>
        <asp:QueryStringParameter Name="serialNumber" QueryStringField="SerialNumber" 
            Type="String" />
    </SelectParameters>
</asp:ObjectDataSource>

but the result I get is the following:

alt text

Does anyone know why it isn't showing anything?

Thanks a lot in advance!!

A: 

Try adding the points manually to the chart in your code. Get you data in code behind and loop through your datasource. Use this command to add points to the chart:

Chart1.Series["Series1"].Points.AddXY(ValueForXAxis, ValueForYAxis);

When you try to do everything using the controls with no code it is often hard to figure out what is going on. For example, maybe your data source isn't returning anything. You can't see, because you can't put a breakpoint and check in the code behind.

adinas