【问题标题】:X-Axis with Asp:Chart带 Asp 的 X 轴:图表
【发布时间】:2012-07-12 18:43:17
【问题描述】:

我有一个asp:chart,里面有一个系列。该系列共有 13 分。 (1 到 13)

当使用可视化 Web 设计器数据绑定工具将数据绑定到图表时,我什至想查看不接收任何数据的列。 (x 列,其中 y = 0)。

现在我有这个(我的图表的 ASCII 表示):

        4 |[]
        3 |[]      []
        2 |[]  []  [][]      
        1 |[][][][][][]
           ------------
           1 3 5 7 9 10

带有 x 坐标的图表,其中 y > 0。我想要的是这个:

       4 |[]
       3 |[]              []
       2 |[]      []      [][]    
       1 |[]  []  []  []  [][]
          -----------------------------
          1 2 3 4 5 6 7 8 9 10 11 12 13

知道我该如何做到这一点吗?

【问题讨论】:

    标签: asp.net visual-web-developer-2010 aspchart


    【解决方案1】:

    你能分享你的代码吗? 使用下面的标记,我在 X 轴上得到从 0 到 11 的 12 个数字:

    <asp:Chart ID="Chart1" runat="server">
                    <Series>
                        <asp:Series Name="Series1" ChartType="Point">
                            <Points>
                                <asp:DataPoint XValue="1" YValues="2" />
                                <asp:DataPoint XValue="3" YValues="5" />
                                <asp:DataPoint XValue="5" YValues="3" />
                                <asp:DataPoint XValue="7" YValues="8" />
                                <asp:DataPoint XValue="9" YValues="1" />
                                <asp:DataPoint XValue="10" YValues="1" />
                            </Points>
                        </asp:Series>
                    </Series>
                    <ChartAreas>
                        <asp:ChartArea />
                    </ChartAreas>
                </asp:Chart>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-17
      • 1970-01-01
      • 1970-01-01
      • 2016-12-17
      相关资源
      最近更新 更多