{"id":368,"date":"2010-07-23T11:14:30","date_gmt":"2010-07-23T11:14:30","guid":{"rendered":"https:\/\/ibex.tech\/visualcpp\/?p=368"},"modified":"2022-02-17T06:24:05","modified_gmt":"2022-02-17T06:24:05","slug":"dynamically-altering-charts","status":"publish","type":"post","link":"https:\/\/ibex.tech\/visualcpp\/charts\/dynamically-altering-charts","title":{"rendered":"Dynamically Altering Charts"},"content":{"rendered":"<pre><code>\r\n\tthis-&gt;SuspendLayout();\r\n\r\n\tchart1-&gt;ChartAreas[0]-&gt;AxisY-&gt;Title = L\"Kg\";\r\n\r\n\t\/\/Set max \/ min\r\n\tchart1-&gt;ChartAreas[0]-&gt;AxisY-&gt;Minimum = 0;\r\n\tchart1-&gt;ChartAreas[0]-&gt;AxisY-&gt;Maximum = 1000;\r\n\r\n\t\/\/Set tool tip text\r\n\tchart1-&gt;Series[0]-&gt;ToolTip = \"#VALX\\n#VAL Kg\";\t\/\/To get possible expressions go to the charts\r\n\t\t\t\t\t\t\t\t\t\/\/Series &gt; Map Area &gt; Tool Tip property\r\n\r\n\t\/\/Set individual bar colours\r\n\tchart1-&gt;Series[0]-&gt;Points[0]-&gt;Color = Color::Orange;\t\/\/Point value is point index to set colour of.  Set colour after databind\r\n\r\n\tthis-&gt;ResumeLayout();\r\n\r\n\t\/\/Invalidate chart to update it\r\n\tchart1-&gt;Invalidate();<\/code><\/pre>\n<h4>Causing Chart To Update<\/h4>\n<pre><code>\r\n\t\/\/Invalidate chart to update it\r\n\tchart1-&gt;Invalidate();\r\n<\/code><\/pre>\n<h4>Changing Format Of X Axis Lables<\/h4>\n<pre><code>\r\nchart.ChartAreas[0].AxisX.LabelStyle.IntervalType = DateTimeIntervalType.Seconds;\r\nchart.ChartAreas[0].AxisX.LabelStyle.Format = \"T\";\t\/\/Set DateTime type to display as time not date\r\n<\/code><\/pre>\n<h4>Good Resources<\/h4>\n<p><a href=\"http:\/\/blogs.msdn.com\/alexgor\/\">http:\/\/blogs.msdn.com\/alexgor\/<\/a><br \/>\n<a href=\"http:\/\/blogs.msdn.com\/alexgor\/archive\/2008\/11\/11\/microsoft-chart-control-how-to-using-keywords.aspx\"> http:\/\/blogs.msdn.com\/alexgor\/archive\/2008\/11\/11\/microsoft-chart-control-how-to-using-keywords.aspx<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>this-&gt;SuspendLayout(); chart1-&gt;ChartAreas[0]-&gt;AxisY-&gt;Title = L&#8221;Kg&#8221;; \/\/Set max \/ min chart1-&gt;ChartAreas[0]-&gt;AxisY-&gt;Minimum = 0; chart1-&gt;ChartAreas[0]-&gt;AxisY-&gt;Maximum = 1000; \/\/Set tool tip text chart1-&gt;Series[0]-&gt;ToolTip = &#8220;#VALX\\n#VAL Kg&#8221;; \/\/To get possible expressions go to the charts \/\/Series &gt; Map Area &gt; Tool Tip property \/\/Set individual bar colours chart1-&gt;Series[0]-&gt;Points[0]-&gt;Color = Color::Orange; \/\/Point value is point index to set colour of. Set [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43],"tags":[],"class_list":["post-368","post","type-post","status-publish","format-standard","hentry","category-charts"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/368","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/comments?post=368"}],"version-history":[{"count":4,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/368\/revisions"}],"predecessor-version":[{"id":1094,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/368\/revisions\/1094"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/media?parent=368"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/categories?post=368"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/tags?post=368"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}