{"id":723,"date":"2011-12-14T13:17:52","date_gmt":"2011-12-14T13:17:52","guid":{"rendered":"https:\/\/ibex.tech\/visualcpp\/?p=723"},"modified":"2022-02-17T06:24:03","modified_gmt":"2022-02-17T06:24:03","slug":"axis-specific","status":"publish","type":"post","link":"https:\/\/ibex.tech\/visualcpp\/charts\/axis-specific","title":{"rendered":"Axis Specific"},"content":{"rendered":"<h4>ChartsAreas &gt; Collection &gt; ChartArea1 &gt; Axes &gt; Collection<\/h4>\n<p>This is how you get to the properties for the axis of a basic chart.<\/p>\n<h4>Labels &#8211; The Markers Along Each Axis<\/h4>\n<p>Intervals shown with decimal places of incorrect value added.  The interval setting is a double and if your source value is say a single it will not necessarily convert exactly to a double &#8211; use Convert::ToDouble(MySingle.ToString()) to solve this<\/p>\n<pre><code>\r\n\tchartArea1-&gt;AxisY-&gt;Minimum = MyChartMinH;\r\n\tchartArea1-&gt;AxisY-&gt;Maximum = MyChartMaxH;\r\n\tchartArea1-&gt;AxisY-&gt;Interval = Convert::ToDouble(MyChartHInterval.ToString());\r\n\tchartArea1-&gt;AxisY-&gt;LabelStyle-&gt;Interval = Convert::ToDouble(MyChartHInterval.ToString());\r\n<\/code><\/pre>\n<h5>Setting display format<\/h5>\n<pre><code>\r\n\tchartArea1-&gt;AxisX-&gt;LabelStyle-&gt;Format = \"hh:mm\";\t\/\/Set to display in time format\r\n<\/code><\/pre>\n<h4>Axis Type<\/h4>\n<p>Set the Interval Type<\/p>\n<h4>DateTime X Axis<\/h4>\n<p>The X values of data points can be bound to a data source that has DateTime values.<\/p>\n<pre><code>\r\n\tchartArea1-&gt;AxisX-&gt;LabelStyle-&gt;Format = \"HH:mm\";\r\n\tchartArea1-&gt;AxisX-&gt;Minimum = ChartFromDateAndTime.ToOADate();\r\n\tchartArea1-&gt;AxisX-&gt;Maximum = ChartToDateAndTime.ToOADate();\r\n\tchartArea1-&gt;AxisX-&gt;IntervalType = DataVisualization::Charting::DateTimeIntervalType::Minutes;\r\n\tchartArea1-&gt;AxisX-&gt;Interval = MyChartTimeIntervalHours * 60) + MyChartTimeIntervalMinutes;\r\n\tchartArea1-&gt;AxisX-&gt;LabelStyle-&gt;Interval = MyChartTimeIntervalHours * 60) + MyChartTimeIntervalMinutes;\r\n<\/code><\/pre>\n<h4>Using Fixed Axis Scale And Divisions<\/h4>\n<pre><code>\r\n\tchartArea1-&gt;AxisY-&gt;Minimum = 200;\r\n\tchartArea1-&gt;AxisY-&gt;Maximum = 10;\r\n\tchartArea1-&gt;AxisY-&gt;Interval = 1;\t\t\t\t\t\t\/\/Frequency of each line\r\n\tchartArea1-&gt;AxisY-&gt;LabelStyle-&gt;Interval = 10;\t\t\t\/\/Prequency of each label\r\n<\/code><\/pre>\n<h4>Grid Lines<\/h4>\n<p>See MajorGrid and MinorGrid.<\/p>\n<pre><code>\r\n\tchartArea1-&gt;AxisY-&gt;MajorGrid-&gt;Enabled = true;\r\n\tchartArea1-&gt;AxisY-&gt;MinorGrid-&gt;Enabled = true;\r\n<\/code><\/pre>\n<h5>Setting Grid Lines Color<\/h5>\n<p>This can sometimes get lost at run time.  Just re apply in code:<\/p>\n<pre><code>\r\n\tchartArea1-&gt;AxisY-&gt;MajorGrid-&gt;LineColor = System::Drawing::Color::DarkGray;\r\n\tchartArea1-&gt;AxisY-&gt;MinorGrid-&gt;LineColor = System::Drawing::Color::LightGray;\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>ChartsAreas &gt; Collection &gt; ChartArea1 &gt; Axes &gt; Collection This is how you get to the properties for the axis of a basic chart. Labels &#8211; The Markers Along Each Axis Intervals shown with decimal places of incorrect value added. The interval setting is a double and if your source value is say a single [&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-723","post","type-post","status-publish","format-standard","hentry","category-charts"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/723","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=723"}],"version-history":[{"count":9,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/723\/revisions"}],"predecessor-version":[{"id":1036,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/posts\/723\/revisions\/1036"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/media?parent=723"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/categories?post=723"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/visualcpp\/wp-json\/wp\/v2\/tags?post=723"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}