Bonjour à tous,

Je suis face à un probleme que je n'arrive pas à résoudre, j'espere que vous pourrez m'aider.

J'ai le chart suivant :

Code html : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
 <asp:Chart ID="Chart1" runat="server" Width="932px" DataSourceID="SqlDataSource1" 
        Height="572px">
        <series>
            <asp:Series Name="CPU_Count" ChartType="StackedColumn" XValueMember="MONTH" 
                YValueMembers="cpuCount" IsValueShownAsLabel="true" Legend="Legend1">
            </asp:Series>
                </series>
        <chartareas>
            <asp:ChartArea Name="ChartArea1" Area3DStyle-Enable3D="false">
            </asp:ChartArea>
        </chartareas>
        <Legends>
            <asp:Legend Name="Legend1">
            </asp:Legend>
        </Legends>
    </asp:Chart>
</asp:Content>

associé à la requete datasource SQL suivante :

Code html : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:vm_historyConnectionString %>" 
 SelectCommand="SELECT [CC]      ,[Month]      ,[cpuCount]      ,[DISK_SIZE]      ,[MEM_SIZE], [TOTAL_PRICE], CPU  FROM MaTable WHERE ([CC] = @COST_CENTER)">
        <SelectParameters>
            <asp:ControlParameter ControlID="DropDownList1" Name="COST_CENTER" 
                PropertyName="SelectedValue" Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>


Je voudrais binder la valeur "CPU" au label de ma serie "CPU_Count".

J'ai essayé :
Code html : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
         <series>
            <asp:Series Name="CPU_Count" ChartType="StackedColumn" XValueMember="MONTH" 
                YValueMembers="cpuCount" IsValueShownAsLabel="true" Legend="Legend1" Label='<%# Bind("CPU") %>'>
            </asp:Series>
Mais j'ai l'erreur : "The Series control with a two-way databinding to field CPU must have an ID."

Y-a-t-il un moyen de faire ce que je cherche à faire ?

Merci d'avance de votre retour.

DeWaRs