复选框和饼图 [英] Checkboxes and a Pie Chart

查看:68
本文介绍了复选框和饼图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开发一个asp.net页面,我希望用户检查一些复选框,并且当用户选中复选框时,我想要一个饼图,它会在按钮点击时更新。例如..



I am currently working on an asp.net page that I want the users to check some checkboxes and as the users check the check boxes I would like a pie chart that would update on a button click. For example..

if (checkbox1.checked = true)
{
 piechart1 = 10%;
}





我确定这不是怎么做的,只是让你明白了。



我对图表和asp.net都很陌生,所以任何帮助都会受到赞赏。谢谢!



i''m sure that this is not how this is done but just so you get the idea.

I am pretty new to both charts and asp.net so any help is appreciated. Thanks!

推荐答案

我能不能看到它?! :-)



假设你想说 if(checkbox1.checked == true){/ * ... * /} 并将''='''(检查相等)与''=''(赋值)混淆,并在已检查中丢失大写(已检查将无法编译)。它发生了。但是, if(checkbox1.checked == true){/ * ... * /} 应该是 if(checkbox1)是不是很明显.Checked){/ * ... * /} ,因为 CheckBox.Checked 已经是布尔值;没有必要比较它 true



这甚至不是一个bug。这表明你正在做什么,编程,或者只是在浪费你的时间。



这不是任何想法。听取一个好建议:停止使用图表或任何东西,停止ASP.NET开发或其他任何你正在做的事情。你可以更好地利用你的时间。从一开始就学习编程:类型和实例,变量和成员,运算符;使用简单的仅限控制台的应用程序,可以做更简单的练这就是你现在真正需要的。 ASP.NET,图形,UI - 它都需要OOP,但你甚至都不是很接近。不要急,因为,现在,做这一切,你会感到沮丧,不会去任何地方。在你学习基础知识之前。



-SA
Can I unsee it?! :-)

Suppose you wanted to say if (checkbox1.checked == true) { /* ... */ } and mixed up ''=='' (check for equality) with ''='' (assignment) and lost the upper-case in "Checked" ("checked" would not compile). It happens. But isn''t it obvious that if (checkbox1.checked == true) { /* ... */ } should be if (checkbox1.Checked) { /* ... */ }, because CheckBox.Checked is already Boolean; there is no need to compare it the true?

This is not even a bug. This is the indication of what you are doing, programming, or just wasting your time.

It cannot be the idea of anything. Listen to a good advice: stop working with charts or anything, stop ASP.NET development or whatever else you are doing. You can use your time much better. Learn programming, from the very beginning: types and instances, variables and members, operators; do simple exercises, better with simple console-only application. This is what you really need right now. ASP.NET, graphics, UI — it all needs OOP, but you are not even close. Don''t rush, because, right now, doing all that, you will stay frustrated, won''t go anywhere. Until you learn the very basics.

—SA


这篇关于复选框和饼图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆