由于以前很少接触曲线图不知道如何下手,想实现共用一个横坐标多个纵坐标曲线图,如图:
ASP.NET曲线

解决方案 »

  1.   

    折腾个啥吖 直接用 openflashchart 自己google去 http://teethgrinder.co.uk/open-flash-chart/
      

  2.   

    不太肯定我理解了你的问题。对于“多个纵坐标”,你写一个通用的转换函数,例如根据数据序列号(1、2、3、4....)和每一个序列的Max、Min把每一个点的y坐标映射在同一个坐标上就行了。
      

  3.   

    折腾啊,也许可以这么实现,先划出一个只有x轴的图片,然后各划出N个没有x轴的图(x轴与其它元素应该可以隐藏的),当然图片宽度一定要一致,x轴也要一致,最后合成图片,合成图片的方法如下,RepeatDirection参数是控制纵向合并还是横向合并
            public Bitmap MergerImg(Bitmap[] maps, System.Web.UI.WebControls.RepeatDirection RepeatDirection)
            {
                if (maps.Length == 0)
                    throw new Exception("图片数不能够为0");            int _width = 0;
                int _height = 0;
                for (int i = 0; i < maps.Length; i++)
                {
                    if (RepeatDirection == System.Web.UI.WebControls.RepeatDirection.Horizontal)
                    {
                        _width += maps[i].Width;
                        if (maps[i].Height > _height)
                        {
                            _height = maps[i].Height;
                        }
                    }
                    else
                    {
                        _height += maps[i].Height;
                        if (maps[i].Width > _width)
                        {
                            _width = maps[i].Width;
                        }
                    }
                }
                //创建要显示的图片对象,根据参数的个数设置宽度
                Bitmap backgroudImg = new Bitmap(_width, _height);
                Graphics g = Graphics.FromImage(backgroudImg);            //清除画布,背景设置为白色
                int len = maps.Length;
                g.Clear(System.Drawing.Color.White);
                int x = 0;
                for (int j = 0; j < len; j++)
                {
                    if (RepeatDirection == System.Web.UI.WebControls.RepeatDirection.Horizontal)
                    {
                        g.DrawImage(maps[j], x, 0, maps[j].Width, maps[j].Height);
                        x = x + maps[j].Width;
                    }
                    else
                    {
                        g.DrawImage(maps[j], 0, x, maps[j].Width, maps[j].Height);
                        x = x + maps[j].Height;
                    }
                }
                g.Dispose();
                return backgroudImg;
            }