求一个免费的画折线图的控件

weiyulin510037 2018-12-02 02:53:40
求推荐一个免费的画折线图的控件 或破解版的

要求有下载地址 和 使用说明


谢谢了,大家新年快乐
...全文
626 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
weiyulin510037 2018-12-13
  • 打赏
  • 举报
回复
谢谢了,我确实不是很懂
  • 打赏
  • 举报
回复
highcharts
xian_wwq 2018-12-10
  • 打赏
  • 举报
回复
OpenFlashChar和ZedGraph均免费
  • 打赏
  • 举报
回复
在 asp.net 中说”控件”,这个现在看起来比较诡异。现在可能遇到这类问题,就会有人问你“你学过 html5、css、前端技术吗?” 因为这类跟 asp.net 真没什么关系。现在 asp.net 不但没有任何企业级控件,普通的控件技术也荡然无存了。这类需要学前端。
  • 打赏
  • 举报
回复
另外,上面的地址怎么贴的是 echarts2 的地址呢? http://echarts.baidu.com/ 或者http://echarts.baidu.com/examples/ 不过要说普通”控件“,可能更多地是指封装为一个 VB.NET 或者 WPF 的 Polygen 那样的直接可以拖到设计界面上、直接可以捕获各种事件的控件吧?这还不如直接使用 WPF。Winform基本上是用来做简单的文本框、Grid的。而 WPF 才是做上图系统的工具。
  • 打赏
  • 举报
回复
echarts 是免费的。
stevenjin 2018-12-09
  • 打赏
  • 举报
回复
echarts不用收费啊
yanyue2004csdn 2018-12-04
  • 打赏
  • 举报
回复
那个echart真不错,很漂亮啊。
  • 打赏
  • 举报
回复
asp.net?免费的js绘图类库不要太多 http://echarts.baidu.com/echarts2/doc/example.html
threenewbee 2018-12-02
  • 打赏
  • 举报
回复
另外,自己写一个也没多难。我就写了一个

class CFXChart
{
public class DataPoint
{
public DateTime sj { get; set; }
public int value { get; set; }
}

public class DrawItem
{
public string Title { get; set; }
public Color Color { get; set; }
public int Max { get; set; }
public int Min { get; set; }
public List<DataPoint> DataPoints { get; set; }
public DrawItem(string title, Color color, IEnumerable<DataPoint> datapoints)
{
Title = title;
Color = color;
DataPoints = datapoints.ToList();
Max = DataPoints.Select(x => x.value).Max();
Min = DataPoints.Select(x => x.value).Min();
int newMax = (Max - Min) / 10;
int newMin = -(Max - Min) / 10;
if (newMax < 2) newMax = 2;
if (newMin > -2) newMin = -2;
Max += newMax;
Min += newMin;
}
}

public List<DrawItem> DrawItems { get; set; }

public int Width { get; set; }

public int Height { get; set; }

public CFXChart(int width, int height, params DrawItem[] data)
{
Width = width;
Height = height;
DrawItems = new List<DrawItem>();
foreach (var item in data)
DrawItems.Add(item);
}

private void FillBlank(Graphics g)
{
g.Clear(Color.White);
}

private void DrawTitle(Graphics g, string title)
{
var titlesize = g.MeasureString(title, new Font("宋体", 14));
g.DrawString(title, new Font("宋体", 14), Brushes.Black, new PointF((float)((Width - titlesize.Width) / 2.0), (float)(Height * 0.06)));
}

private void DrawBody(Graphics g, RectangleF rect, DateTime dt1, DateTime dt2)
{
g.DrawRectangle(Pens.Black, rect.X+40.0f, rect.Y, rect.Width-40.0f, rect.Height-40.0f);
float x = rect.X;
float y = rect.Y;
int n = 15 / this.DrawItems.Count;
if (n <= 1) n = 2;
for (int i = 0; i <= n; i++)
{
y = rect.Y + i * (rect.Height - 40.0f) / (float)n;
if (i != n && i != 0)
g.DrawLine(new Pen(Color.Gray, 0.5f), new PointF(rect.X + 40.0f, y), new PointF(rect.X + rect.Width, y));
foreach (var item in this.DrawItems)
{
g.DrawString(((item.Max - item.Min) * (1 - i / (float)n) + item.Min).ToString("0.00"), new Font("宋体", 8), new SolidBrush(item.Color), new PointF(x, y - 5.0f));
y += 10.0f;
}
}
g.DrawLine(new Pen(Color.Black, 2.0f), new PointF(rect.X + 40.0f, ywarn), new PointF(rect.X + rect.Width, ywarn));
n = 8;
for (int i = 0; i <= n; i++)
{
x = rect.X + 40.0f + i * (rect.Width - 40.0f) / (float)n;
if (i != n && i != 0)
g.DrawLine(new Pen(Color.Gray, 0.5f), new PointF(x, rect.Y), new PointF(x, rect.Y + rect.Height - 40.0f));
double totals = new TimeSpan(dt2.Ticks - dt1.Ticks).TotalSeconds;
DateTime tlabel = dt1.AddSeconds(totals / (double)n * (i));
string timelabel = tlabel.ToString("HH:mm");
//if (i != 0)
g.DrawString(timelabel, new Font("宋体", 8), Brushes.Black, new PointF(x - 12.0f, y + 5.0f));
}

foreach (var item in this.DrawItems)
{
float dv = rect.Top + (item.Max - item.DataPoints[0].value) / (float)(item.Max - item.Min) * (rect.Height - 40.0f);
float dt = rect.Left + 40.0f + (float)(new TimeSpan(item.DataPoints[0].sj.Ticks - dt1.Ticks).TotalSeconds) / (float)(new TimeSpan(dt2.Ticks - dt1.Ticks).TotalSeconds) * (rect.Width - 40.0f);
for (int i = 1; i < item.DataPoints.Count; i++)
{
float dv1 = rect.Top + (item.Max - item.DataPoints[i].value) / (float)(item.Max - item.Min) * (rect.Height - 40.0f);
float dt11 = rect.Left + 40.0f + (float)(new TimeSpan(item.DataPoints[i].sj.Ticks - dt1.Ticks).TotalSeconds) / (float)(new TimeSpan(dt2.Ticks - dt1.Ticks).TotalSeconds) * (rect.Width - 40.0f);
g.DrawLine(new Pen(item.Color, 1.0f), new PointF(dt, dv), new PointF(dt11, dv1));
dv = dv1;
dt = dt11;
}
}
}

private void DrawLegend(Graphics g, RectangleF rect)
{
float x = rect.X + 10;
float y = rect.Y + 10;
foreach (var item in this.DrawItems)
{
g.DrawString(item.Title, new Font("宋体", 8), Brushes.Black, new PointF(x, y));
x += 35.0f;
g.DrawLine(new Pen(item.Color, 2.0f), new PointF(x, y + 5.0f), new PointF(x + 10.0f, y + 5.0f));
x += 25.0f;
}
}

public Bitmap MakeChart()
{
DateTime mintm = DrawItems.Select(x => x.DataPoints.Select(y => y.sj).Min()).Min();
DateTime maxtm = DrawItems.Select(x => x.DataPoints.Select(y => y.sj).Max()).Max();
string titile = string.Format("{0:yyyyMMdd HHmm} - {1:yyyyMMdd HHmm}", mintm, maxtm);
Bitmap bmp = new Bitmap(Width, Height);
var g = Graphics.FromImage(bmp);
FillBlank(g);
DrawTitle(g, titile);
RectangleF rectbody = new RectangleF((float)(Width * 0.06), (float)(Height * 0.16), (float)(Width * 0.88), (float)(Height * 0.64));
DrawBody(g, rectbody, mintm, maxtm);
RectangleF rectlen = new RectangleF((float)(Width * 0.06), (float)(Height * 0.84), (float)(Width * 0.88), (float)(Height * 0.1));
DrawLegend(g, rectlen);
return bmp;
}
}
threenewbee 2018-12-02
  • 打赏
  • 举报
回复
不要什么下载地址,也不要什么说明,vs自带的mschart就可以。

62,041

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧