MS Chart with ASP.NET chart type “column” not showing axis x label if there are more than 9 bar in the chart

后端 未结 4 1179
春和景丽
春和景丽 2020-12-15 07:14

I have a problem with an MS Chart chart type column. If there are more than 9 bars in the chart, the axis-x labels won\'t show up properly, some of them just disappear.

相关标签:
4条回答
  • 2020-12-15 07:55

    I had the same problem, but i'm using c# on page load.

    I solved it by adding this

        Chart2.ChartAreas["ChartArea1"].AxisX.Interval = 1;
    
    0 讨论(0)
  • 2020-12-15 08:09

    Try setting the width of the chart and see if that resolves issue with only showing 9 bars.

    <asp:Chart ID="chtNBAChampionships" runat="server" Width="400px">
    

    You can set the color in the DataPoint.

    <asp:DataPoint AxisLabel="Celtics" YValues="17" Color="Green" />
    
    0 讨论(0)
  • 2020-12-15 08:12

    Chart2.ChartAreas["ChartArea1"].AxisX.Interval = 1;

    0 讨论(0)
  • 2020-12-15 08:14
    <ChartAreas>
    <asp:ChartArea Name="ChartArea1" >
    <AxisY Title="Progress->">
    </AxisY>
    <AxisX Interval="1" Title="Activity->">
    </AxisX>
    </asp:ChartArea>
    
    0 讨论(0)
提交回复
热议问题