如何在Winform中显示Panel中的饼图(How to show Piechart in Panel in Winform)
我正在winform中创建Piechart。我的图表很好。我想要加的唯一的事情就是在Panel中显示Piechart但我无法做到..
这是饼图代码..
public void DrawPieChartOnForm() { //Take Total Five Values & Draw Chart Of These Values. int[] myPiePercent = { 10, 20, 25, 5, 40 }; //Take Colors To Display Pie In That Colors Of Taken Five Values. Color[] myPieColors = { Color.Red, Color.Black, Color.Blue, Color.Green, Color.Maroon }; using (Graphics myPieGraphic = this.CreateGraphics()) { //Give Location Which Will Display Chart At That Location. Point myPieLocation = new Point(10, 400); //Set Here Size Of The Chart… Size myPieSize = new Size(500, 500); //Call Function Which Will Draw Pie of Values. DrawPieChart(myPiePercent, myPieColors, myPieGraphic, myPieLocation, myPieSize); } }
请帮帮我..先谢谢..
I am creating Piechart in winform.My chart is coming fine.The only thing that i want to add up is to display the Piechart in Panel but i am not able to do it..
Here is the Code of Piechart..
public void DrawPieChartOnForm() { //Take Total Five Values & Draw Chart Of These Values. int[] myPiePercent = { 10, 20, 25, 5, 40 }; //Take Colors To Display Pie In That Colors Of Taken Five Values. Color[] myPieColors = { Color.Red, Color.Black, Color.Blue, Color.Green, Color.Maroon }; using (Graphics myPieGraphic = this.CreateGraphics()) { //Give Location Which Will Display Chart At That Location. Point myPieLocation = new Point(10, 400); //Set Here Size Of The Chart… Size myPieSize = new Size(500, 500); //Call Function Which Will Draw Pie of Values. DrawPieChart(myPiePercent, myPieColors, myPieGraphic, myPieLocation, myPieSize); } }
Please help me.. Thanks in advance..
原文:https://stackoverflow.com/questions/25987856
最满意答案
事实上,抓住这一切。 我现在正在工作,在我的最后没有明显的变化。 但是,当您注入脚本时,您不应该能够在DOM IIRC中看到它。 是否有可能你只是有一个流浪的错字,导致它不呈现? 您可能想要在其他页面上测试它。
除非Chrome推动一些固定事物(可能)的随机更新,否则我认为它可能只是与intercept.js有关。
尽管如此,我仍然会给Facebook使用严格的文档类型并且不能仅用一个字验证。
初始答案 (保留仅用于表明我的困惑)
我能够用最简单的脚本来复制结果,而我已经在其他页面上工作。 这个问题可能与doctype,XHTML Strict有关,尽管页面管理只包含一个单词,但它不会进行验证 。 我尝试了几种处理它的方法:
- 在manifest.json中将
content_scripts.run_at
更改为"document_end"
- 使用
chrome.tabs.executeScript
注入脚本- 使用
chrome.tabs.executeScript
注入纯代码- 使用
chrome.tabs.executeScript
注入包含在CDATA标记中的代码的脚本- 使用
chrome.tabs.executeScript
注入包含在CDATA标记中的纯代码没有工作。
Actually, scratch all of this. I got it working now with no apparent changes on my end. When you inject a script, however, you shouldn't be able to see it in the DOM IIRC. Is it possible you just have a stray typo that's causing it to not render? You might want to test it on other pages.
Unless it was Chrome pushing some random update that fixed things (possible), I'm thinking it might just have to do with intercept.js.
I will still give Facebook a ton of credit for using a strict doctype and failing to validate with only one word, though.
Initial answer (preserved only to demonstrate my confusion)
I was able to duplicate your result with the simplest scripts possible, which I got working on other pages. The issue might have something to do with the doctype, XHTML Strict, and the fact that -- despite the page managing to contain only a single word -- it doesn't validate. I tried several methods of dealing with it:
- Change
content_scripts.run_at
to"document_end"
in manifest.json- Use
chrome.tabs.executeScript
to inject a script- Use
chrome.tabs.executeScript
to inject pure code- Use
chrome.tabs.executeScript
to inject a script with the code surrounded in CDATA tags- Use
chrome.tabs.executeScript
to inject pure code surrounded in CDATA tagsNone worked.
相关问答
更多-
这意味着,你可能会在扩展/内部页面上看到一个onUpdated事件(popup?options page?detached dev tools?)。 一种选择是按URL过滤: chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) { if(changeInfo.status == "complete") { if(!tab.url.match(/^http/)) { return; } // Wrong ...
-
document.ready仅在加载document.ready时发生一次。 AJAX请求不会导致它。
text
-
事实上,抓住这一切。 我现在正在工作,在我的最后没有明显的变化。 但是,当您注入脚本时,您不应该能够在DOM IIRC中看到它。 是否有可能你只是有一个流浪的错字,导致它不呈现? 您可能想要在其他页面上测试它。 除非Chrome推动一些固定事物(可能)的随机更新,否则我认为它可能只是与intercept.js有关。 尽管如此,我仍然会给Facebook使用严格的文档类型并且不能仅用一个字验证。 初始答案 (保留仅用于表明我的困惑) 我能够用最简单的脚本来复制结果,而我已经在其他页面上工作。 这个问题可能与d ...
-
当读取外部标记 (具有src属性的标记 )时,现代浏览器将异步下载此脚本,即,在下载脚本时继续读取/解析HTML。 但是,浏览器会阻止所有后续脚本的执行(注意不下载),想到脚本执行队列 ,所有脚本将逐个排队并执行,但下载是异步的。 更早的浏览器(主要是IE6和IE7)是不同的,它们会阻止HTML解析过程,等待脚本下载和执行,并继续解析剩余的HTML。 总结: 下载和执行是脚本的不同阶段,现代浏览器块执行阶段, 下载可以是异步和并行以提高性能,早期的浏览器阻止下载阶段,这使得页面解析效率降低。 Mordern ...
-
最简单的方法是,使用jquery.ajax load funciton,解析数据,在另一个var中获取脚本标签数据,将其放入javascript eval函数,有些放在页面上,并将其他数据放在你需要的任何地方要插入的新DOM。 the easiest thing to do is, use the jquery.ajax load funciton , parse the data, get the script tags data in another var, put this into javascr ...
-
如果您事先知道URL模式,我建议使用chrome.webRequest或chrome.declarativeWebRequest API来阻止图像。 这可以从后台/活动页面完成。 ( 这个答案的第一个修订版显示了“beforeload”事件的一个例子。但是这个事件已经从Chrome 35中删除了,所以我删除了这个例子。) If you know the URL patterns in advance, I suggest to use the chrome.webRequest or chrome.decl ...
-
滚动时在Ajax自动加载时反复加载相同的内容(Loading same content again and again on Ajax auto loading while scrolling)[2022-04-12]
只是一个猜测,但如果每次都没有更改网址,您将最终得到内容的缓存副本,一遍又一遍地导致相同的数据,除非服务器发送无缓存标头。 Just a guess, but if the url isn't changing each time, you will end up with a cached copy of the content causing the same data over and over unless the server is sending a no-cache header. -
你试图在表格中设置一个div,这是不可能的。 你可以解决它来改变这个:
etc 将您的JavaScript代码更改为 $(document).ready(function() { setInterval(function () { ... -
您列出了不存在的依赖项。 jQuery是库的名称; 你需要引用它的句柄,以加载库,但是jquery 。 当我相信你试图告诉JS加载页脚时,你也将版本号设置为true。 改变这个: wp_register_script('click_scroll', plugins_url( 'click_scroll.js', __FILE__), array( 'jQuery'), true ); 对此: wp_register_script( 'click_scroll', plugins_url( 'click_s ...
-
正如您所指出的,Durandal将忽略视图中的script标记。 它们仅从index.html (或其等价物)加载。 您是否能够提前引用脚本(和noscript),将它们放在index.html文件中? 换句话说,它们是否必须动态加载? 旁注:你在“main.js中引用了我所有的其他脚本”是什么意思? 你的意思是它们是RequireJS的路径配置吗? 或者你的意思是说它们在index.html文件(或其等价物)中被引用? After much research I found my answer final ...