C# zedGraphControl控件如何关联一个double数组

C# zedGraphControl控件如何关联一个double数组,第1张

取现没画过,先给你一个画饼的,不行再追问

        Random rand = new Random()

        //填充Pane背景颜色和倾斜度

        myPane.Fill = new Fill(Color.White, Color.Goldenrod, 45.0f)

        //背景填充类型

        myPane.Chart.Fill.Type = FillType.None

        //设置位置

        myPane.Legend.Position = LegendPos.Float

        myPane.Legend.Location = new Location(0.95f, 0.15f, CoordType.PaneFraction, AlignH.Right, AlignV.Top)

        //文字大小

        myPane.Legend.FontSpec.Size = 12f

        myPane.Legend.IsHStack = false

        //添加饼图片值

        PieItem[] segment = new PieItem[data.Count]

        string[] labels = new string[data.Count]

        data.Keys.CopyTo(labels, 0)

        for (int x = 0 x < data.Count x++)

        {

            segment[x] = myPane.AddPieSlice(data[labels[x]], Color.FromArgb(rand.Next(0, 255), rand.Next(0, 255), rand.Next(0, 255)), Color.White, 45f, 0, labels[x])

            segment[x].LabelType = PieLabelType.Name_Value

            segment[x].LabelDetail.FontSpec.Size = 12f

            segment[x].LabelDetail.FontSpec.FontColor = Color.Red

        }

去网上找.NET画图的代码。

*** 作就是逻辑构思好图的大小,然后设计位置宽路。。然后根据你的数据控制出一个个得点出来。然后在点之间画线就可以了。

重点就在与确定点的位置。屏幕是像素你就的自己算好准确的位置然后画就可以了。比较简单!


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/bake/11803543.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-18
下一篇 2023-05-18

发表评论

登录后才能评论

评论列表(0条)

保存