电数据图的代码:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.Net.Sockets;
using System.IO;
using System.Threading;
using System.Globalization;
using Server;
using ZedGraph;
namespace Server
{
public partial class Pic : Form
{
public Pic()
{
InitializeComponent();
//this.Size = new System.Drawing.Size(700,500);
this.AutoScrollMinSize = new Size(700, 500);//设置自动滚动的最小尺寸
}
public string OpenFilePath;
private void Pic_Load(object sender, EventArgs e)
{
// panel1.Width = 900;
// panel1.Height =500;
pictureBox1.Width =1440;
pictureBox1.Height =600;
// pictureBox1.Location = new Point(0, 0);
}
private void button1_Click(object sender, EventArgs e)
{
Graphics g = pictureBox1.CreateGraphics();
g.ScaleTransform(1.0f,-1.0f); //翻转函数(所有 Y轴的方面 记得 加负号)
Pen pen = new Pen(Color.Red);
byte[] rdata = new byte[2048];//设置2k的读取缓冲区
Stream stream = File.OpenRead(OpenFilePath);//流文件实例
BinaryReader bread = new BinaryReader(stream);//读取文件
bread.Read(rdata, 0, 1440);//读出的是10进制数据
bread.Close();
PointF[] pY = new PointF[1440];
PointF[] pL = new PointF[1440];
PointF pt;
for (int i = 0; i <1440; i++)
{
//pY[i] = new PointF(i , rdata[i]/10f+200);
pL[i] = new PointF(i, -200);
float fx = (float ) i;
float fy = (float ) rdata[i];
pt = new PointF(fx, fy-400);
pY[i] = pt;
}
g.DrawLines(pen,pY);
g.DrawLines(pen, pL);
g.Dispose();
}
}
}
很简单的,google就可以的google chart
或者jqplot
jfreechart 这个是一个组件。你可以看看这个。网上搜索一堆。
嗯 我觉得能 用java script + css 应该 可以