在y barchart aspx中设置最大值

发布于 2025-02-05 14:45:07 字数 1122 浏览 1 评论 0原文

我想将y值从0设置为10乘10的跳跃。我找不到有关如何设置它的任何文档,属性或相关帖子。感谢任何帮助。 我将ASPX和ASPX.VB用作后端文件。

aspx文件

<asp:BarChart
    ID="BarChart1"
    runat="server"
    ChartHeight="300"
    ChartWidth="1200"
    ChartType="Column"
    ChartTitleColor="#0095AA"
    CategoryAxisLineColor="#99A7B7"
    ValueAxisLineColor="#99A7B7"
    BaseLineColor="#666666"
    CssClass="nolegend noborder">
</asp:BarChart>

aspx.vb函数

Private Sub fillGraph()
    Dim dtFacultad = getFacultad()
    Dim total = dtFacultad.Rows.Count - 1
    Dim x As String() = data
    Dim y As Decimal() = New Decimal(total) {}

    For i As Integer = 0 To total
        y(i) = i * 10 'Dummy data'
    Next

    BarChart1.Series.Add(New AjaxControlToolkit.BarChartSeries() With {
        .Data = y
    })
    BarChart1.CategoriesAxis = String.Join(",", x)
    BarChart1.ChartWidth = (x.Length * 125).ToString()
End Sub

“

I want to set the Y values from 0 to 100 jumping 10 by 10. I can't find any docs, property or a related post about how to set it up. I would appreciate any help.
I'm using aspx and aspx.vb as the backend file.

aspx file

<asp:BarChart
    ID="BarChart1"
    runat="server"
    ChartHeight="300"
    ChartWidth="1200"
    ChartType="Column"
    ChartTitleColor="#0095AA"
    CategoryAxisLineColor="#99A7B7"
    ValueAxisLineColor="#99A7B7"
    BaseLineColor="#666666"
    CssClass="nolegend noborder">
</asp:BarChart>

aspx.vb function

Private Sub fillGraph()
    Dim dtFacultad = getFacultad()
    Dim total = dtFacultad.Rows.Count - 1
    Dim x As String() = data
    Dim y As Decimal() = New Decimal(total) {}

    For i As Integer = 0 To total
        y(i) = i * 10 'Dummy data'
    Next

    BarChart1.Series.Add(New AjaxControlToolkit.BarChartSeries() With {
        .Data = y
    })
    BarChart1.CategoriesAxis = String.Join(",", x)
    BarChart1.ChartWidth = (x.Length * 125).ToString()
End Sub

Graph

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

豆芽 2025-02-12 14:45:07

尝试

BarChart1.ChartAreas(0).AxisY.Interval = 10 ' Interval from 10 to 10
BarChart1.ChartAreas(0).AxisY.Maximum = 100 ' Y axis maximum = 100

,您将在y轴上从10到10的间隔,y轴的最大值为100。

Try

BarChart1.ChartAreas(0).AxisY.Interval = 10 ' Interval from 10 to 10
BarChart1.ChartAreas(0).AxisY.Maximum = 100 ' Y axis maximum = 100

With this you'll have interval from 10 to 10 in Y axis and also the maximum value in Y axis will be 100.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文