检索列表框中的所有条目for for循环到C#中AddY的代码图表点

时间:2017-11-04 03:42:00

标签: c# loops charts

我正在尝试使用for循环遍历我的motherForm上的listBox1,以便将listBox1中所有条目的值正确地添加到第二个表单上的我的图表中? listBox1条目是动态的,如果添加更多条目,图表应相应地响应。

图表将在x轴上正确生成listBox1中条目数的列,但所有列都具有相同的y轴值(仅动态拉动第一个条目而不是每个条目)。代码如下所示。

private void Chart_Load(object sender, EventArgs e)
{            
    for (int i = 1; i <= motherForm.listBox1.Items.Count; i++)
       this.chart1.Series["Minutes"].Points.AddY(Double.Parse(motherForm.listBox1.Items[0].ToString()));
} 

1 个答案:

答案 0 :(得分:-1)

您只需对项目使用const getMoreCustomers = starting_after => { const getThem = starting_after => stripe.customers.list({limit: 100, starting_after: starting_after}) .then(res => res.has_more ? getThem(res.data[res.data.length - 1]).then(result => res.data.concat(...result)) : res.data ); return getThem(starting_after); }; async function getAllCustomers() { const customers = await getMoreCustomers(null); const content = JSON.stringify(customers); fs.writeFile("/data/stripe-customers.json", content, 'utf8', function (err) { if (err) { return console.log(err); } console.log("The file was saved!"); }); } 变量。

i