小编The*_*ise的帖子

如何从0 X轴开始制作折线图

我创建折线图,但我想在X轴上显示从0开始的图表.我怎样才能做到这一点.

我尝试了一些方法,但仍然没有得到我想要的.

Chart1.ChartAreas[0].AxisX.Interval = 0;

Chart1.ChartAreas[0].AxisX.IsStartedFromZero = true;

Chart1.ChartAreas[0].AxisX.Minimum = 0;

Chart1.ChartAreas[0].AxisX.Crossing = 0;
Run Code Online (Sandbox Code Playgroud)

这就是我现在所做的

在此输入图像描述

这就是我要的

在此输入图像描述

还有一个,如何在图表中设置主要和次要单位..?

我的代码在这里

protected void Page_Load(object sender, EventArgs e)
    {
        System.Drawing.Font axisFont = new System.Drawing.Font("Arial", 8, System.Drawing.FontStyle.Bold);
        System.Drawing.Font titleFont = new System.Drawing.Font("Arial", 10, System.Drawing.FontStyle.Bold);

        Chart1.Width = 600;
        Chart1.Height = 400;
        Chart1.BorderlineColor = System.Drawing.Color.Black;
        Chart1.BorderlineWidth = 1;
        Chart1.BorderlineDashStyle = ChartDashStyle.Solid;

        double[] min = { 60.9, 0, 28.81, 7.27 };
        double[] ave = { 60.9, 0, 28.81, 7.27 };
        double[] max = { 5167.72, 1.27, 4176.16, 2566.59 …
Run Code Online (Sandbox Code Playgroud)

.net c# asp.net charts visual-studio-2010

6
推荐指数
1
解决办法
1万
查看次数

标签 统计

.net ×1

asp.net ×1

c# ×1

charts ×1

visual-studio-2010 ×1