Bonjour,

Je viens de créer un graphique avec Mschart et j'ai quelques petits soucis d'affichage que je n'arive pas à corriger.
J'ai le code suivant pour définir mon graphique.
Code : 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
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
 
 <asp:Chart runat="server" ID="MsChart" Width="900px" Height="600px" Visible="false">
            <Legends>
                <asp:Legend Name="D">
                    <Position Auto="false" Y="100" Width="10" Height="5" X="80" />
                </asp:Legend>
                <asp:Legend Name="C">
                    <Position Auto="false" Y="100" Width="10" Height="5" X="60" />
                </asp:Legend>
                <asp:Legend Name="B">
                    <Position Auto="false" Y="100" Width="10" Height="5" X="40" />
                </asp:Legend>
                <asp:Legend Name="A">
                    <Position Auto="false" Y="100" Width="10" Height="5" X="20" />
                </asp:Legend>
            </Legends>
            <Series>
                <asp:Series XValueType="Double" IsValueShownAsLabel="false" Legend="A" LegendText="A"
                    ChartType="StackedColumn100" Color="Lime" Name="A" BorderColor="180, 26, 59, 105">
                </asp:Series>
                <asp:Series XValueType="Double" IsValueShownAsLabel="false" Legend="B" LegendText="B"
                    ChartType="StackedColumn100" Color="Yellow" Name="B" BorderColor="180, 26, 59, 105">
                </asp:Series>
                <asp:Series XValueType="Double" IsValueShownAsLabel="false" Legend="C" LegendText="C"
                    ChartType="StackedColumn100" Color="#ff9900" Name="C" BorderColor="180, 26, 59, 105">
                </asp:Series>
                <asp:Series XValueType="Double" IsValueShownAsLabel="false" Legend="D" LegendText="D"
                    ChartType="StackedColumn100" Color="Red" Name="D" BorderColor="180, 26, 59, 105">
                </asp:Series>
            </Series>
            <ChartAreas>
                <asp:ChartArea Name="ChartArea1" BackSecondaryColor="White" BackColor="#EFE6F7" ShadowColor="DarkRed"
                    BackGradientStyle="TopBottom">
 
                </asp:ChartArea>
            </ChartAreas>

et je l'alimente en code-behing à partir d'un SQLDataReader
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
while (dr.Read())
        {
            MsChart.Series["A"].Points.AddY(dr["AperCent"]);
            MsChart.Series["B"].Points.AddY(dr["BperCent"]);
            MsChart.Series["C"].Points.AddY(dr["CperCent"]);
            MsChart.Series["D"].Points.AddY(dr["DperCent"]);
 
            MsChart.Series["A"].Points[i].AxisLabel = dr["Chapitre"].ToString();
 
            i += 1;
        }
Les colonnes de mon graphique s'affichent correctement mais je ne vois que quelques labels (3 au lieu 15) et je ne comprends pas pourquoi ??
Dans mon while j'affecte bien un label à chaque colonne alors pourquoi ne m'en restitue t'il que quelques un ?
De plus certains labels sont longs et je souhaiterai les afficher sur 2 colonnes.
Ex : au lieu d'avoir
'Ceci est mon libellé long'
Je souhaiterai avoir
'Ceci est mon
libellé long'

Merci par avance des réponses ou pistes que vous pourrez m'apporter.
La doc MsChart n'est pas des plus simples à appréhender !!!