


private void button1_Click(object sender, EventArgs e)
{
int count = int.Parse(this.comboBox1.Text.Trim());
this.Refresh();
Graphics g = CreateGraphics();
huatu(g,count);
}
private void huatu(Graphics g,int num)
{
Pen p = new Pen(Color.Red, 1);//上涨
Pen p1 = new Pen(Color.Green, 1);//下跌
int width = 1050;
int height = 400;
int Kwidth = width / num - 10;
g.DrawRectangle(p, 80, 80, width, height);
//k线开始
Font myFont = new Font(“微软雅黑”, 8);
string begindate = null;
string jintian = DateTime.Now.ToShortDateString().ToString();
DataSet ds = n

本文介绍了如何使用C#编程在Visual Studio Code中实现动态加载多个股票的价格数据并绘制K线图。通过SQL查询获取数据,利用Graphics对象绘制K线,包括上涨和下跌的区分,并进行横轴时间与纵轴价格的等分处理。
最低0.47元/天 解锁文章
525

被折叠的 条评论
为什么被折叠?



