开发者

ASP Chart Control doesn't show anything

开发者 https://www.devze.com 2022-12-22 14:02 出处:网络
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:

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 http://img532.imageshack.us/img532/6215/chartt.png

Does anyone know why it isn't showing anything?

Thanks a lot in advance!!


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消