﻿<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Programming By A Tool &#187; Dynamic Controls</title>
	<atom:link href="http://byatool.com/tag/dynamic-controls/feed/" rel="self" type="application/rss+xml" />
	<link>http://byatool.com</link>
	<description>This is my recorded stumbling through ASP.Net, Framework 3.5, C# 3.0, Ajax, Javascript, and Love.  Stay, learn, destroy.  It's your life.</description>
	<lastBuildDate>Thu, 03 May 2012 17:28:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>jQuery: Slide Menu With Pop Up Divs.  Yay!</title>
		<link>http://byatool.com/ui/jquery-slide-menu-with-pop-up-divs-yay/</link>
		<comments>http://byatool.com/ui/jquery-slide-menu-with-pop-up-divs-yay/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 20:48:30 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[UI]]></category>
		<category><![CDATA[Dynamic Controls]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://byatool.com/?p=851</guid>
		<description><![CDATA[So you may have seen this post about how I came to create such a wonderful menu with no real purpose as of yet. Well that menu has been improved and can be downloaded here. Remember that question you never asked? Well once again I&#8217;ve answered it. To take the normal sliding menu farther I [...]]]></description>
			<content:encoded><![CDATA[<p>So you may have seen <a href="http://byatool.com/index.php/ui/jquery-slide-menu-another-cause-i-can-experiment/">this post</a> about how I came to create such a wonderful menu with no real purpose as of yet. Well that <a href="http://byatool.com/Hosted/LiveDemos/SlideMenuHoverDivs/SlideMenuHoverDivs.htm">menu has been improved</a> and can be <a href="http://iamwebproject.com/BAT/SlideMenuHoverDivs.zip">downloaded here</a>.</p>
<p>Remember that question you never asked? Well once again I&#8217;ve answered it.</p>
<p>To take the normal sliding menu farther I thought I should have something happen when hovering over the menu items. Novel! Well as you can see if you clicked on the link above (Sorry, can&#8217;t repost the link. Links are expensive.) the menu items have large counter parts that show up when hovered over and don&#8217;t go away until the counter part or the main item is left. What does this all mean? I DON&#8217;T KNOW but I&#8217;ll find out eventually. It&#8217;s in the cards man, it&#8217;s in the cards&#8230;</p>
<p>Ok so additions&#8230; For the style sheet, I added a class:</p>
<pre><span style="color: #800000;">.menuItemBig
</span>{
  <span style="color: #ff0000;">height</span>:<span style="color: #0000ff;">100px</span>;
  <span style="color: #ff0000;">margin</span><span style="color: #ff0000;">-right</span>:<span style="color: #0000ff;">5px</span>;
  <span style="color: #ff0000;">position</span>:<span style="color: #0000ff;">absolute</span>;
  <span style="color: #ff0000;">width</span>:<span style="color: #0000ff;">100px</span>;
  <span style="color: #ff0000;">z-index</span>:<span style="color: #0000ff;">100</span>;
}</pre>
<p>And have included a child div to the menu item:</p>
<p><strong>Before</strong></p>
<pre>  &lt;<span style="color: #800000;">div</span> <span style="color: #ff0000;">class</span><span style="color: #0000ff;">="menuItem</span> <span style="color: #0000ff;">floatLeft</span> <span style="color: #0000ff;">blue</span>"&gt;1&lt;/<span style="color: #800000;">div</span>&gt;</pre>
<p><strong>Now</strong></p>
<pre>  &lt;<span style="color: #800000;">div</span> <span style="color: #ff0000;">class</span><span style="color: #0000ff;">="menuItem floatLeft blue"</span>&gt;
    1
    &lt;<span style="color: #800000;">div</span> <span style="color: #ff0000;">class</span><span style="color: #0000ff;">="menuItemBig red"</span>&gt;THIS IS THE BIG ITEM 1&lt;/<span style="color: #800000;">div</span>&gt;
  &lt;/<span style="color: #800000;">div</span>&gt;</pre>
<p>I added two methods:</p>
<pre><span style="color: #008000;">//
</span><span style="color: #008000;">// mouseenter: Find any menuItemBig within the given element and show</span>
<span style="color: #008000;">//             Reset the position of the menuItemBig element to appear</span>
<span style="color: #008000;">//             to be in the middle of the parent element</span>
<span style="color: #008000;">// mouseleave: Hide the child menuItemBig</span>
<span style="color: #008000;">//</span>
<span style="color: #0000ff;">function</span> setOnHoverForMenuItems(items)
{
  jQuery(items)
  .each
  (
    <span style="color: #0000ff;">function</span> ()
    {
      jQuery(<span style="color: #0000ff;">this</span>).mouseenter
      (
        <span style="color: #0000ff;">function</span>()
        {
          <span style="color: #008000;">//Why the positioning?  I wanted the child div to show up in the</span>
          <span style="color: #008000;">// middle of the parent div which is done by putting the child's left side</span>
          <span style="color: #008000;">// to half of the width of the parent over from the parent's left side</span>
          <span style="color: #0000ff;">var</span> parentPosition = jQuery(<span style="color: #0000ff;">this</span>).position();
          <span style="color: #0000ff;">var</span> bigItems = jQuery(<span style="color: #0000ff;">this</span>).children(<span style="color: #800000;">".menuItemBig"</span>);
          bigItems.css({ left: parentPosition.left - (jQuery(<span style="color: #0000ff;">this</span>).width() /2), top: parentPosition.top + 10  });
          bigItems.show();
        }
      );

      jQuery(<span style="color: #0000ff;">this</span>).mouseleave
      (
        <span style="color: #0000ff;">function</span>()
        {
          jQuery(<span style="color: #0000ff;">this</span>).children(<span style="color: #800000;">".menuItemBig"</span>).hide();
        }
      );
    }
  );
}</pre>
<p>Why not hover? *EDIT* It should be hover.  Turns out an issue I was having with hover was not actually an issue with it&#8230;  *END EDIT*</p>
<p>The other method I added was a simple one:</p>
<pre><span style="color: #008000;">//</span>
<span style="color: #008000;">// Used to find any element of menuItemBig</span>
<span style="color: #008000;">//</span>
<span style="color: #0000ff;">function</span> hideAllBigItems(bigItemParentItems)
{
  jQuery(bigItemParentItems).children(<span style="color: #800000;">".menuItemBig"</span>).hide();
}</pre>
<p>And where did I use these? I appended them to the setChildrenDivs method:</p>
<pre><span style="color: #0000ff;">function</span> setChildrenDivs(mainHolder)
{
  <span style="color: #0000ff;">var</span> menuItems = getMenuItems(mainHolder);

  <span style="color: #0000ff;">for</span> (var loopCounter = 0; loopCounter &lt; menuItems.length; loopCounter++)
  {
    <span style="color: #0000ff;">if</span>(loopCounter &gt; maximumToShow - 1)
    {
      jQuery(menuItems[loopCounter]).hide();
    }
  }

  setPager(jQuery(mainHolder).children(<span style="color: #800000;">".leftPager"</span>), getLastVisible, getNextInLineBack);
  setPager(jQuery(mainHolder).children(<span style="color: #800000;">".rightPager"</span>),getFirstVisible, getNextInLineFront);
  <span style="color: #ff0000;">setOnHoverForMenuItems(menuItems);</span>
  <span style="color: #ff0000;">hideAllBigItems(menuItems);</span>
}</pre>
<p>So in all, this didn&#8217;t take much at all, thanks to mouseleave. Next up&#8230; not sure. No idea if I will take this any further.</p>
]]></content:encoded>
			<wfw:commentRss>http://byatool.com/ui/jquery-slide-menu-with-pop-up-divs-yay/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.Net MVC HtmlHelper Method for Creating Buttons With Forms and Optional Images: Part 1</title>
		<link>http://byatool.com/mvc/asp-net-mvc-htmlhelper-method-for-creating-buttons-with-forms-and-optional-images-part-1/</link>
		<comments>http://byatool.com/mvc/asp-net-mvc-htmlhelper-method-for-creating-buttons-with-forms-and-optional-images-part-1/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 18:01:55 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[MVC]]></category>
		<category><![CDATA[Dynamic Controls]]></category>

		<guid isPermaLink="false">http://byatool.com/?p=842</guid>
		<description><![CDATA[Straight from the &#8220;I made this and maybe you can find a use for it&#8221; bin, here is one of two ways I create image buttons. Why would you care? I have no idea, but two of the catches that comes with buttons is they have to be wrapped in a form and the fact [...]]]></description>
			<content:encoded><![CDATA[<p>Straight from the &#8220;I made this and maybe you can find a use for it&#8221; bin, here is one of two ways I create image buttons. Why would you care? I have no idea, but two of the catches that comes with buttons is they have to be wrapped in a form and the fact you have to, far as I know, <a href="http://byatool.com/index.php/utilities/asp-net-mvc-button-post-is-losing-querystring-values-and-getting-paramters-from-a-url/">add hidden value inputs to the form</a> to carry over the values from a url (Action of the form).  This take care of both, can ya&#8217; belee it?</p>
<p>This guy takes in a url (ie you already know what it should be, say from pre determined redirect value), breaks down the url to get the request parameters to make hidden inputs, and adds the button. Now I went with the image being a style for the button instead of passing in a location for the image itself, mostly because I find that to be easier to handle from a design perspective since it&#8217;s possible that particular image might be used a lot on a site. Seems easier, if you need to change the image, to change one css class then to have to search and replace a million image urls.  But what do I know?  No seriously, what do I know? </p>
<pre><span style="color: #0000ff;">public</span> <span style="color: #0000ff;">static</span> <span style="color: #008080;">String</span> OptionalImageButton(<span style="color: #0000ff;">this</span> <span style="color: #008080;">HtmlHelper</span> helper, <span style="color: #008080;">String</span> returnUrl, <span style="color: #008080;">Boolean</span> viewAsImage, <span style="color: #008080;">FormMethod</span> formMethod, <span style="color: #008080;">String</span> buttonText, <span style="color: #008080;">String</span> formClass, <span style="color: #008080;">String</span> imageClass, <span style="color: #008080;">String</span> buttonClass)
{
  <span style="color: #008080;">StringBuilder</span> html = <span style="color: #0000ff;">new</span> <span style="color: #008080;">StringBuilder</span>();
  <span style="color: #008000;">//Create the form along with the formMethod passed in</span>
  html.Append(<span style="color: #800000;">"&lt;form action=\"" + returnUrl + "\" class=\"" + formClass + "\" method=\"" + formMethod + "\"&gt; "</span>);

  <span style="color: #008000;">//This is the method</span> <a href="http://byatool.com/index.php/utilities/asp-net-mvc-button-post-is-losing-querystring-values-and-getting-paramters-from-a-url/">from this post</a><span style="color: #008000;">, it just give me all the hidden inputs from a url</span><span style="color: #008000;">
</span>  html.Append(<span style="color: #008080;">MvcMethods</span>.CreateHiddenValuesFromUrl(returnUrl));
  <span style="color: #008000;">//This is where you might hate me.  Instead of having an image for the button
</span>  <span style="color: #008000;">//I am using a css class to hold the image.  Just a choice, makes it easier
</span>  <span style="color: #008000;">//in my opinion</span>
  <span style="color: #0000ff;">if</span> (viewAsImage)
  {
    html.Append(<span style="color: #800000;">"&lt;input type=\"submit\" value=\"\" class=\"" + imageClass + "\" /&gt;"</span>);
  }
  <span style="color: #0000ff;">else
</span>  {
    <span style="color: #008000;">//If no image, then just put a text button.</span>
    html.Append(<span style="color: #800000;">"&lt;input type=\"submit\" value=\"" + buttonText + "\" class=\"" + buttonClass + " \" &gt;&lt;/input&gt;"</span>);
  }

  <span style="color: #008000;">//End the form</span>
  html.Append(<span style="color: #800000;">"&lt;/form&gt;"</span>);

  <span style="color: #0000ff;">return</span> html.ToString();
}</pre>
<p>You might notice the FormClass parameter, or maybe you didn&#8217;t because you can&#8217;t read.  If that&#8217;s the case, then we&#8217;re both wasting time.  However, if you did notice then you might find it odd.  As it is, a form has to be inline in order to show buttons next to each other. After all, by default a form is a block element like a div.  Therefore, the form itself will need a class or the style set.   Now I could default this to inline, but for the sake of giving power to the programmer, it&#8217;s left as a parameter. After all, maybe not all buttons should be inline.</p>
<p>And usage:</p>
<pre>  Html.OptionalImageButton(Model.ReturnUrl, Model.UserShowImages, <span style="color: #800000;">"Return"</span>, <span style="color: #800000;">"inline"</span>, <span style="color: #800000;">"returnButton"</span>, <span style="color: #800000;">"button080SmallTextAction"</span>)</pre>
<p>Pretty easy to use and clean&#8230; well clean for MVC at least. Next MVC post I&#8217;ll show the route driven version of this &#8220;control&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://byatool.com/mvc/asp-net-mvc-htmlhelper-method-for-creating-buttons-with-forms-and-optional-images-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft Charting Controls: Adding Charts Dynamically</title>
		<link>http://byatool.com/ui/microsoft-charting-controls-adding-dynamically/</link>
		<comments>http://byatool.com/ui/microsoft-charting-controls-adding-dynamically/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 21:31:18 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[UI]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[Charting]]></category>
		<category><![CDATA[Dynamic]]></category>
		<category><![CDATA[Dynamic Controls]]></category>

		<guid isPermaLink="false">http://byatool.com/?p=122</guid>
		<description><![CDATA[So this is kind of repost as I had already posted this at StackOverflow but I thought it might have some merit here. Whatever. Charts are hot right now so I&#8217;m going to push the damned bandwagon. You don&#8217;t like it? Well then go do something to yourself that you would consider rude for me [...]]]></description>
			<content:encoded><![CDATA[<p>So this is kind of repost as I had already posted this at <a href="http://www.stackoverflow.com">StackOverflow</a> but I thought it might have some merit here. Whatever. Charts are hot right now so I&#8217;m going to push the damned bandwagon. You don&#8217;t like it? Well then go do something to yourself that you would consider rude for me to suggest it. Anyways, this might have been overkill but hey, that&#8217;s me.</p>
<pre lang="csharp">
protected void Page_Load(object sender, EventArgs e)
{
Bench benchList;
FoodIntake foodIntakeList;
Panel panelChartHolder;

panelChartHolder = new Panel();
Controls.Add(panelChartHolder);

benchList = Bench.GetAll();
AddNewCharts(benchList, panelChartHolder, GetBenchXValue, GetBenchYValue);

foodIntakeList = FoodIntake.GetAll();
AddNewCharts(foodIntakeList, panelChartHolder, GetFoodIntakeXValue, GetFoodIntakeYValue);
}
</pre>
<p>Ok so this first part is simple. Create a panel to hold the charts you are adding, get the lists you want represented by the charts and call the method to create the charts.</p>
<pre>  <span style="color: #0000ff;">private</span> <span style="color: #0000ff;">void</span> AddNewCharts(T[] listToAdd, <span style="color: #33cccc;">Panel</span> panelToAddTo,
     <span style="color: #33cccc;">Func</span>&lt;T, <span style="color: #33cccc;">DateTime</span>&gt; xMethod, <span style="color: #33cccc;">Func</span>&lt;T, <span style="color: #33cccc;">Int32</span>&gt;)
  {

    <span style="color: #33cccc;">ChartArea</span> mainArea;
    <span style="color: #33cccc;">Chart</span> mainChart;
    <span style="color: #33cccc;">Series</span> mainSeries;

    mainChart = <span style="color: #0000ff;">new</span> <span style="color: #33cccc;">Chart</span>();
    mainSeries = <span style="color: #0000ff;">new</span> <span style="color: #33cccc;">Series</span>(<span style="color: #ff0000;">"MainSeries"</span>);

    <span style="color: #0000ff;">for</span> (<span style="color: #33cccc;">Int32</span> loopCounter = 0; loopCounter &lt; listToAdd.Length; loopCounter++)
    {
      mainSeries.Points.AddXY(xMethod(listToAdd[loopCounter]),
        yMethod(listToAdd[loopCounter]));
    }

    mainChart.Series.Add(mainSeries);
    mainArea = <span style="color: #0000ff;">new</span> <span style="color: #33cccc;">ChartArea</span>(<span style="color: #ff0000;">"MainArea"</span>);
    mainChart.ChartAreas.Add(mainArea);

    panelToAddTo.Controls.Add(mainChart);
  }</pre>
<p>As you can see, I just created a new chart, added a series to it, and added a ChartArea to it. Next part is pretty much just looping through the collection and adding each item in it to the list itself. It uses the passed in delegate methods (Func) to get the X and Y values.</p>
<p>Last part holds the four methods responsible for getting the X and Y values from the two lists. Basically I did this to allow the chart creating method to be a generic as possible. Might be overkill.</p>
<pre>  <span style="color: #0000ff;">private</span> <span style="color: #33cccc;">DateTime</span> GetBenchXValue(Bench currentBench)
  {
    <span style="color: #0000ff;">return</span> currentBench.DateLifted;
  }

  <span style="color: #0000ff;">private</span> <span style="color: #33cccc;">Int32</span> GetBenchYValue(Bench currentBench)
  {
    <span style="color: #0000ff;">return</span> currentBench.BenchAmount;
  }

  <span style="color: #0000ff;">private</span> <span style="color: #33cccc;">DateTime</span> GetFoodIntakeXValue(FoodIntake currentIntake)
  {
    <span style="color: #0000ff;">return</span> currentIntake.DateEaten;
  }

  <span style="color: #0000ff;">private</span> <span style="color: #33cccc;">Int32</span> GetFoodIntakeYValue(FoodIntake currentIntake)
  {
    <span style="color: #0000ff;">return</span> currentIntake.Calories;
  }</pre>
<p>And so when you run this, you will get two graphs side by side. Mind you, they will be very plain as there are million different properties that can be set to improve the look. I guess the main point of this was to show that it&#8217;s pretty easy to create graphs dynamically using any kind of object list. You know what? Screw you. This is my blog and I&#8217;ll post whatever I want to. If you don&#8217;t like that then you can just come back at a later time and read something else I post. Yeah so there.</p>
<pre>  <span style="color: #0000ff;">using</span> System;
  <span style="color: #0000ff;">using</span> System.Web.UI.DataVisualization.Charting;
  <span style="color: #0000ff;">using</span> System.Web.UI.WebControls;</pre>
]]></content:encoded>
			<wfw:commentRss>http://byatool.com/ui/microsoft-charting-controls-adding-dynamically/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft Charting Control: So easy an idiot can use it&#8230; And I have.</title>
		<link>http://byatool.com/ui/microsoft-charting-control-so-easy-an-idiot-can-use-it-and-i-have/</link>
		<comments>http://byatool.com/ui/microsoft-charting-control-so-easy-an-idiot-can-use-it-and-i-have/#comments</comments>
		<pubDate>Tue, 02 Dec 2008 15:49:58 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[UI]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[Charting]]></category>
		<category><![CDATA[Dynamic]]></category>
		<category><![CDATA[Dynamic Controls]]></category>

		<guid isPermaLink="false">http://byatool.com/?p=111</guid>
		<description><![CDATA[So just recently it was announced that there was a new charting control out for .Net/Visual Studios so I thought I would give it shot. How hard could it be? Well considering it took me 2? years to figure out my Playstation 3 had a wireless card, an uphill battle wasn&#8217;t out of the question. [...]]]></description>
			<content:encoded><![CDATA[<p>So just recently it was announced that there was a new charting control out for .Net/Visual Studios so I thought I would give it shot. How hard could it be? Well considering it took me 2? years to figure out my Playstation 3 had a wireless card, an uphill battle wasn&#8217;t out of the question.</p>
<p>So what the hell has to be done first? Well you need the 3.5 Framework (Sucks if you don&#8217;t have that) and <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=ab99342f-5d1a-413d-8319-81da479ab0d7&amp;displaylang=en" target="_blank">service pack 1</a> (Which doesn&#8217;t suck as much but still annoying. I WANT EASY THINGS).<br />
Have those? Great, way to be in the know. Now for the next step, more downloads. Here is the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=130f7986-bf49-4fe5-9ca8-910ae6ea442c&amp;DisplayLang=en" target="_self">charting install</a> and you need <a href="http://www.microsoft.com/downloads/details.aspx?familyid=1D69CE13-E1E5-4315-825C-F14D33A303E9&amp;displaylang=en" target="_blank">this too</a> to see the actual tool in your toolbox. AMAZING. Now you just have to run the installs, which oddly enough are easy to do. First time for everything.</p>
<p>So now you have them installed right? Ok well do the normal project create/startup, add a new page, and view Design. Go to the old toolbox and look under the Data tab. (Don&#8217;t ask me why it&#8217;s there because I don&#8217;t know and will be compelled to cut you.) Now under the chance you don&#8217;t see it there you either didn&#8217;t install the second download or you have to add the namespace the control falls under. No problem. Just right click the Data tab and select &#8220;Choose Items&#8221;. Now in the.Net Framework Components tab look for the Namespace &#8220;System.Web.UI.DataVisiualization.Charting&#8221; and you should see the name Chart to the right of it. Select that item.</p>
<p>Ok, so now there should be a Chart control in your ToolBox in the Data Tab. You can now drag that thing over. Now in the markup you should see:</p>
<p><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;">&lt;</span></span><span style="font-size: x-small; color: #a31515;">asp</span><span style="font-size: x-small; color: #0000ff;">:</span><span style="font-size: x-small; color: #a31515;">Chart</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">ID</span><span style="font-size: x-small; color: #0000ff;">=&#8221;Chart1&#8243;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">runat</span><span style="font-size: x-small; color: #0000ff;">=&#8221;server&#8221;&gt;</span><br />
<span style="font-size: x-small; color: #0000ff;">  &lt;</span><span style="font-size: x-small; color: #a31515;">Series</span><span style="font-size: x-small; color: #0000ff;">&gt;</span><br />
<span style="font-size: x-small; color: #0000ff;">    &lt;</span><span style="font-size: x-small; color: #a31515;">asp</span><span style="font-size: x-small; color: #0000ff;">:</span><span style="font-size: x-small; color: #a31515;">Series</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">Name</span><span style="font-size: x-small; color: #0000ff;">=&#8221;Series1&#8243;&gt;</span><span style="font-size: x-small; color: #0000ff;">&lt;/</span><span style="font-size: x-small; color: #a31515;">asp</span><span style="font-size: x-small; color: #0000ff;">:</span><span style="font-size: x-small; color: #a31515;">Series</span><span style="font-size: x-small; color: #0000ff;">&gt;</span><br />
<span style="font-size: x-small; color: #0000ff;">  &lt;/</span><span style="font-size: x-small; color: #a31515;">Series</span><span style="font-size: x-small; color: #0000ff;">&gt;</span><br />
<span style="font-size: x-small; color: #0000ff;">&lt;</span><span style="font-size: x-small; color: #a31515;">ChartAreas</span><span style="font-size: x-small; color: #0000ff;">&gt;</span><br />
<span style="font-size: x-small; color: #0000ff;">    &lt;</span><span style="font-size: x-small; color: #a31515;">asp</span><span style="font-size: x-small; color: #0000ff;">:</span><span style="font-size: x-small; color: #a31515;">ChartArea</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">Name</span><span style="font-size: x-small; color: #0000ff;">=&#8221;ChartArea1&#8243;&gt;</span><span style="font-size: x-small; color: #0000ff;">&lt;/</span><span style="font-size: x-small; color: #a31515;">asp</span><span style="font-size: x-small; color: #0000ff;">:</span><span style="font-size: x-small; color: #a31515;">ChartArea</span><span style="font-size: x-small; color: #0000ff;">&gt;</span><br />
<span style="font-size: x-small; color: #0000ff;">    &lt;/</span><span style="font-size: x-small; color: #a31515;">ChartAreas</span><span style="font-size: x-small; color: #0000ff;">&gt;</span><br />
<span style="font-size: x-small; color: #0000ff;">&lt;/</span><span style="font-size: x-small; color: #a31515;">asp</span><span style="font-size: x-small; color: #0000ff;">:</span><span style="font-size: x-small; color: #a31515;">Chart</span><span style="font-size: x-small; color: #0000ff;">&gt;</span></p>
<p>If that doesn&#8217;t excite you, then I don&#8217;t know what will. Anyhow, it&#8217;s actually very simple. Series is the line or whatever you are representing the data as and the chart area is what holds the series(s). Seems easy enough, but don&#8217;t worry, it gets easier. Now for this example I&#8217;m going to actually have two series and they are going to represent amount of weight Bench Pressed and the caloric intake for a given day. Best thing I could come up with right now since today was bench day.</p>
<p><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;">&lt;</span></span><span style="font-size: x-small; color: #a31515;">asp</span><span style="font-size: x-small; color: #0000ff;">:</span><span style="font-size: x-small; color: #a31515;">Chart</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">ID</span><span style="font-size: x-small; color: #0000ff;">=&#8221;chartMain&#8221;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">runat</span><span style="font-size: x-small; color: #0000ff;">=&#8221;server&#8221;&gt;</span><span style="font-size: x-small;"><span style="font-size: x-small;"> </span></span></p>
<p><span style="font-size: x-small; color: #0000ff;">  &lt;</span><span style="font-size: x-small; color: #a31515;">Series</span><span style="font-size: x-small; color: #0000ff;">&gt;</span><span style="font-size: x-small;"><span style="font-size: x-small;"> </span></span><br />
<span style="font-size: x-small; color: #0000ff;">    &lt;</span><span style="font-size: x-small; color: #a31515;">asp</span><span style="font-size: x-small; color: #0000ff;">:</span><span style="font-size: x-small; color: #a31515;">Series</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">Name</span><span style="font-size: x-small; color: #0000ff;">=&#8221;seriesBenchAmount&#8221;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #0000ff;">/&gt;</span><br />
<span style="font-size: x-small; color: #0000ff;">    &lt;</span><span style="font-size: x-small; color: #a31515;">asp</span><span style="font-size: x-small; color: #0000ff;">:</span><span style="font-size: x-small; color: #a31515;">Series</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">Name</span><span style="font-size: x-small; color: #0000ff;">=&#8221;seriesFoodIntake&#8221;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #0000ff;">/&gt;</span><br />
<span style="font-size: x-small; color: #0000ff;">  &lt;/</span><span style="font-size: x-small; color: #a31515;">Series</span><span style="font-size: x-small; color: #0000ff;">&gt;</span><br />
<span style="font-size: x-small; color: #0000ff;">  &lt;</span><span style="font-size: x-small; color: #a31515;">ChartAreas</span><span style="font-size: x-small; color: #0000ff;">&gt;</span><br />
<span style="font-size: x-small; color: #0000ff;">    &lt;</span><span style="font-size: x-small; color: #a31515;">asp</span><span style="font-size: x-small; color: #0000ff;">:</span><span style="font-size: x-small; color: #a31515;">ChartArea</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">Name</span><span style="font-size: x-small; color: #0000ff;">=&#8221;chartAreaMain&#8221;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #0000ff;">/&gt;</span><br />
<span style="font-size: x-small; color: #0000ff;">  &lt;/</span><span style="font-size: x-small; color: #a31515;">ChartAreas</span><span style="font-size: x-small; color: #0000ff;">&gt;</span><br />
<span style="font-size: x-small; color: #0000ff;">&lt;/</span><span style="font-size: x-small; color: #a31515;">asp</span><span style="font-size: x-small; color: #0000ff;">:</span><span style="font-size: x-small; color: #a31515;">Chart</span><span style="font-size: x-small; color: #0000ff;">&gt;</span></p>
<p>Yeah that&#8217;s pretty good. So now what I need is to throw some fake data at it, and to do that I created a Bench table and a FoodIntake table followed by using Linq To Sql to create the needed classes. When all was said and done I could easily do this:</p>
<pre>  private const String CHART_AREA_MAIN = "chartAreaMain";
  private const String SERIES_BENCH_AMOUNT = "seriesBenchAmount";
  private const String SERIES_FOOD_INTAKE = "seriesFoodIntake";

  <span style="color: #0000ff;">protected</span> <span style="color: #0000ff;">void</span> Page_Load(<span style="color: #0000ff;">object</span> sender, <span style="color: #33cccc;">EventArgs</span> e)
  {
    <span style="color: #33cccc;">Bench</span>[] benchList;
    <span style="color: #33cccc;">Series</span> currentSeries;
    <span style="color: #33cccc;">FoodIntake</span>[] foodIntakeList;

    benchList = Bench.GetAllBenches();
    currentSeries = chartMain.Series[SERIES_BENCH_AMOUNT];
    <span style="color: #0000ff;">for</span> (<span style="color: #33cccc;">Int32</span> loopCounter = 0; loopCounter &lt; benchList.Length; loopCounter++)
    {
      currentSeries.Points.AddXY(benchList[loopCounter].DateLifted,
         benchList[loopCounter].BenchAmount);
    }

    foodIntakeList = FoodIntake.GetAll();
    currentSeries = chartMain.Series[SERIES_FOOD_INTAKE];
    <span style="color: #0000ff;">for</span>(<span style="color: #33cccc;">Int32</span> loopCounter = 0; loopCounter &lt; foodIntakeList.Length; loopCounter++)
    {
      currentSeries.Points.AddXY(foodIntakeList[loopCounter].DateEaten,
          foodIntakeList[loopCounter].Calories / 10);
      }
  }</pre>
<p>Now believe it or not, that&#8217;s all you have to do to get a graph. Pretty easy to say the least. Now the graph that you get will be default everything (And in this case it gives you a bar graph) but still at least that&#8217;s something to work with. (Note that I cheated with the food intake by dividing by 10. Unfortunately the graph would look odd with a day of 3500 calories and a 325 bench.)</p>
<p>Now maybe you want this to be a line graph&#8230; Whatever can we do?</p>
<pre>protected override void CreateChildControls()
{
    base.CreateChildControls();
    <span style="color: #33cccc;">Series</span> currentSeries;
    <span style="color: #33cccc;">ChartArea</span> currentArea; 

    currentSeries = chartMain.Series[SERIES_BENCH_AMOUNT];
    currentSeries.XValueType = <span style="color: #33cccc;">ChartValueType</span>.DateTime;
    currentSeries.YValueType = <span style="color: #33cccc;">ChartValueType</span>.Int32;
    currentSeries.ChartType = <span style="color: #33cccc;">SeriesChartType</span>.Line;
    currentSeries.BorderWidth = 3; currentSeries.MarkerStyle = <span style="color: #33cccc;">MarkerStyle</span>.Square;

    currentSeries = chartMain.Series[SERIES_FOOD_INTAKE];
    currentSeries.XValueType = <span style="color: #33cccc;">ChartValueType</span>.DateTime;
    currentSeries.YValueType = <span style="color: #33cccc;">ChartValueType</span>.Int32;
    currentSeries.ChartType = <span style="color: #33cccc;">SeriesChartType</span>.Line;
    currentSeries.MarkerStyle = <span style="color: #33cccc;">MarkerStyle</span>.Circle;
    currentSeries.MarkerColor = <span style="color: #33cccc;">Color</span>.Red;
    currentSeries.BorderWidth = 3;

    currentArea = chartMain.ChartAreas[CHART_AREA_MAIN];
    currentArea.Area3DStyle.Enable3D = <span style="color: #0000ff;">false</span>;
}</pre>
<p>So what&#8217;s all this? Well this:</p>
<div id="attachment_118" class="wp-caption alignnone" style="width: 307px"><a href="http://byatool.com/wp-content/uploads/2008/12/chartplainline.jpg"><img class="size-medium wp-image-118" title="chartplainline" src="http://byatool.com/wp-content/uploads/2008/12/chartplainline.jpg" alt="I MADE THIS!!11" width="297" height="289" /></a><p class="wp-caption-text">I MADE THIS!!11</p></div>
<p>So pretty, yah? So what does it all mean?</p>
<pre>    currentSeries.XValueType = <span style="color: #33cccc;">ChartValueType</span>.DateTime;
    currentSeries.YValueType = <span style="color: #33cccc;">ChartValueType</span>.Int32;</pre>
<p>Well this is pretty simple, this merely sets the types for the X and Y axis. I told you it was simple.</p>
<pre>    currentSeries.ChartType = <span style="color: #33cccc;">SeriesChartType</span>.Line;</pre>
<p>If you can&#8217;t figure that one out, try another profession like engineering.</p>
<pre>    currentSeries.MarkerStyle = <span style="color: #33cccc;">MarkerStyle</span>.Circle;
    currentSeries.MarkerColor = <span style="color: #33cccc;">Color</span>.Red;</pre>
<p>Ok these three things are used to control how the points on the lines (Markers) actually look. Pretty self explanatory once the word &#8220;marker&#8221; is translated.</p>
<pre>    currentSeries.BorderWidth = 3;</pre>
<p>This is the thickness of the line itself.</p>
<pre>    currentArea.Area3DStyle.Enable3D = <span style="color: #0000ff;">false</span>;</pre>
<p>If you guessed this was a way to make the grid 3d, you were right on and probably able remind yourself to breathe at a maximum 3 times a day.</p>
<p>So now you are thinking you have this down to an expert level and I say,&#8221;sure why not?&#8221; &#8216;cept with a little work on the mark up I could make it look like this:</p>
<div id="attachment_119" class="wp-caption alignnone" style="width: 310px"><a href="http://byatool.com/wp-content/uploads/2008/12/chartadvancedline.jpg"><img class="size-medium wp-image-119" title="chartadvancedline" src="http://byatool.com/wp-content/uploads/2008/12/chartadvancedline-300x208.jpg" alt="OoooOooOo" width="300" height="208" /></a><p class="wp-caption-text">OoooOooOo</p></div>
<p>And just like Beloch said in Raiders of the Lost Arc before his face exploded, &#8220;It&#8217;s Bewtifewl!&#8221;</p>
<p>Now for the Usings!!11</p>
<pre>    <span style="color: #33cccc;">using</span> System;
    <span style="color: #33cccc;">using</span> System.Drawing;
    <span style="color: #33cccc;">using</span> System.Web.UI.DataVisualization.Charting;</pre>
<p>And the final markup:</p>
<p><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;">&lt;</span></span><span style="font-size: x-small; color: #a31515;">asp</span><span style="font-size: x-small; color: #0000ff;">:</span><span style="font-size: x-small; color: #a31515;">Chart</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">ID</span><span style="font-size: x-small; color: #0000ff;">=&#8221;chartMain&#8221;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">runat</span><span style="font-size: x-small; color: #0000ff;">=&#8221;server&#8221;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">Palette</span><span style="font-size: x-small; color: #0000ff;">=&#8221;EarthTones&#8221;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">BackColor</span><span style="font-size: x-small; color: #0000ff;">=&#8221;Azure&#8221;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">ImageType</span><span style="font-size: x-small; color: #0000ff;">=&#8221;Jpeg&#8221;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">ImageLocation</span><span style="font-size: x-small; color: #0000ff;">=&#8221;~/ChartImages/ChartPic_#SEQ(300,3)&#8221;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">Width</span><span style="font-size: x-small; color: #0000ff;">=&#8221;412px&#8221;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">Height</span><span style="font-size: x-small; color: #0000ff;">=&#8221;296px&#8221;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">BorderDashStyle</span><span style="font-size: x-small; color: #0000ff;">=&#8221;Solid&#8221;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">BackGradientStyle</span><span style="font-size: x-small; color: #0000ff;">=&#8221;TopBottom&#8221;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">BorderWidth</span><span style="font-size: x-small; color: #0000ff;">=&#8221;2&#8243;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">BorderColor</span><span style="font-size: x-small; color: #0000ff;">=&#8221;181, 64, 1&#8243;&gt;</span><span style="font-size: x-small;"><span style="font-size: x-small;"> </span></span><br />
<span style="font-size: x-small; color: #0000ff;">  &lt;</span><span style="font-size: x-small; color: #a31515;">series</span><span style="font-size: x-small; color: #0000ff;">&gt;</span><span style="font-size: x-small;"><span style="font-size: x-small;"> </span></span><br />
<span style="font-size: x-small; color: #0000ff;">    &lt;</span><span style="font-size: x-small; color: #a31515;">asp</span><span style="font-size: x-small; color: #0000ff;">:</span><span style="font-size: x-small; color: #a31515;">Series</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">Name</span><span style="font-size: x-small; color: #0000ff;">=&#8221;seriesBenchAmount&#8221;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">MarkerSize</span><span style="font-size: x-small; color: #0000ff;">=&#8221;3&#8243;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">BorderWidth</span><span style="font-size: x-small; color: #0000ff;">=&#8221;3&#8243;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">ShadowColor</span><span style="font-size: x-small; color: #0000ff;">=&#8221;Black&#8221;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">BorderColor</span><span style="font-size: x-small; color: #0000ff;">=&#8221;180, 26, 59, 105&#8243;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">Color</span><span style="font-size: x-small; color: #0000ff;">=&#8221;220, 65, 140, 240&#8243;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">ShadowOffset</span><span style="font-size: x-small; color: #0000ff;">=&#8221;2&#8243;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #0000ff;">/&gt;</span><span style="font-size: x-small;"><span style="font-size: x-small;"> </span></span><br />
<span style="font-size: x-small; color: #0000ff;">    &lt;</span><span style="font-size: x-small; color: #a31515;">asp</span><span style="font-size: x-small; color: #0000ff;">:</span><span style="font-size: x-small; color: #a31515;">Series</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">Name</span><span style="font-size: x-small; color: #0000ff;">=&#8221;seriesFoodIntake&#8221;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">MarkerSize</span><span style="font-size: x-small; color: #0000ff;">=&#8221;3&#8243;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">BorderWidth</span><span style="font-size: x-small; color: #0000ff;">=&#8221;3&#8243;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">ShadowColor</span><span style="font-size: x-small; color: #0000ff;">=&#8221;Black&#8221;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">BorderColor</span><span style="font-size: x-small; color: #0000ff;">=&#8221;180, 26, 59, 105&#8243;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">Color</span><span style="font-size: x-small; color: #0000ff;">=&#8221;220, 224, 64, 10&#8243;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">ShadowOffset</span><span style="font-size: x-small; color: #0000ff;">=&#8221;2&#8243;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #0000ff;">/&gt;</span><span style="font-size: x-small;"><span style="font-size: x-small;"> </span></span><br />
<span style="font-size: x-small; color: #0000ff;">  &lt;/</span><span style="font-size: x-small; color: #a31515;">series</span><span style="font-size: x-small; color: #0000ff;">&gt;</span><span style="font-size: x-small;"><span style="font-size: x-small;"></p>
<p></span></span></p>
<p><span style="font-size: x-small; color: #0000ff;">  &lt;</span><span style="font-size: x-small; color: #a31515;">chartareas</span><span style="font-size: x-small; color: #0000ff;">&gt;</span><span style="font-size: x-small;"><span style="font-size: x-small;"> </span></span><br />
<span style="font-size: x-small; color: #0000ff;">    &lt;</span><span style="font-size: x-small; color: #a31515;">asp</span><span style="font-size: x-small; color: #0000ff;">:</span><span style="font-size: x-small; color: #a31515;">ChartArea</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">Name</span><span style="font-size: x-small; color: #0000ff;">=&#8221;chartAreaMain&#8221;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">BorderColor</span><span style="font-size: x-small; color: #0000ff;">=&#8221;64, 64, 64, 64&#8243;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">BorderDashStyle</span><span style="font-size: x-small; color: #0000ff;">=&#8221;Solid&#8221;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">BackSecondaryColor</span><span style="font-size: x-small; color: #0000ff;">=&#8221;White&#8221;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">BackColor</span><span style="font-size: x-small; color: #0000ff;">=&#8221;OldLace&#8221;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">ShadowColor</span><span style="font-size: x-small; color: #0000ff;">=&#8221;Transparent&#8221;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">BackGradientStyle</span><span style="font-size: x-small; color: #0000ff;">=&#8221;TopBottom&#8221;&gt;</span><span style="font-size: x-small;"><span style="font-size: x-small;"> </span></span><br />
<span style="font-size: x-small; color: #0000ff;">      &lt;</span><span style="font-size: x-small; color: #a31515;">area3dstyle</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">Rotation</span><span style="font-size: x-small; color: #0000ff;">=&#8221;25&#8243;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">Perspective</span><span style="font-size: x-small; color: #0000ff;">=&#8221;9&#8243;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">LightStyle</span><span style="font-size: x-small; color: #0000ff;">=&#8221;Realistic&#8221;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">Inclination</span><span style="font-size: x-small; color: #0000ff;">=&#8221;40&#8243;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;"><span style="color: #0000ff;">          </span>IsRightAngleAxes</span><span style="font-size: x-small; color: #0000ff;">=&#8221;False&#8221;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">WallWidth</span><span style="font-size: x-small; color: #0000ff;">=&#8221;3&#8243;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">IsClustered</span><span style="font-size: x-small; color: #0000ff;">=&#8221;False&#8221;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #0000ff;">/&gt;</span><span style="font-size: x-small;"><span style="font-size: x-small;"> </span></span><br />
<span style="font-size: x-small; color: #0000ff;">      &lt;</span><span style="font-size: x-small; color: #a31515;">axisy</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">LineColor</span><span style="font-size: x-small; color: #0000ff;">=&#8221;64, 64, 64, 64&#8243;&gt;</span><span style="font-size: x-small;"><span style="font-size: x-small;"> </span></span><br />
<span style="font-size: x-small; color: #0000ff;">        &lt;</span><span style="font-size: x-small; color: #a31515;">LabelStyle</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">Font</span><span style="font-size: x-small; color: #0000ff;">=&#8221;Trebuchet MS, 8.25pt, style=Bold&#8221;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #0000ff;">/&gt;</span><span style="font-size: x-small;"><span style="font-size: x-small;"> </span></span><br />
<span style="font-size: x-small; color: #0000ff;">        &lt;</span><span style="font-size: x-small; color: #a31515;">MajorGrid</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">LineColor</span><span style="font-size: x-small; color: #0000ff;">=&#8221;64, 64, 64, 64&#8243;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #0000ff;">/&gt;</span><span style="font-size: x-small;"><span style="font-size: x-small;"> </span></span><br />
<span style="font-size: x-small; color: #0000ff;">      &lt;/</span><span style="font-size: x-small; color: #a31515;">axisy</span><span style="font-size: x-small; color: #0000ff;">&gt;</span><span style="font-size: x-small;"><span style="font-size: x-small;"> </span></span><br />
<span style="font-size: x-small; color: #0000ff;">      &lt;</span><span style="font-size: x-small; color: #a31515;">axisx</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">LineColor</span><span style="font-size: x-small; color: #0000ff;">=&#8221;64, 64, 64, 64&#8243;&gt;</span><span style="font-size: x-small;"><span style="font-size: x-small;"> </span></span><br />
<span style="font-size: x-small; color: #0000ff;">        &lt;</span><span style="font-size: x-small; color: #a31515;">LabelStyle</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">Font</span><span style="font-size: x-small; color: #0000ff;">=&#8221;Trebuchet MS, 8.25pt, style=Bold&#8221;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #0000ff;">/&gt;</span><span style="font-size: x-small;"><span style="font-size: x-small;"> </span></span><br />
<span style="font-size: x-small; color: #0000ff;">        &lt;</span><span style="font-size: x-small; color: #a31515;">MajorGrid</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #ff0000;">LineColor</span><span style="font-size: x-small; color: #0000ff;">=&#8221;64, 64, 64, 64&#8243;</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #0000ff;">/&gt;</span><span style="font-size: x-small;"> </span><br />
<span style="font-size: x-small; color: #0000ff;">      &lt;/</span><span style="font-size: x-small; color: #a31515;">axisx</span><span style="font-size: x-small; color: #0000ff;">&gt;</span><span style="font-size: x-small;"><span style="font-size: x-small;"> </span></span><br />
<span style="font-size: x-small; color: #0000ff;">    &lt;/</span><span style="font-size: x-small; color: #a31515;">asp</span><span style="font-size: x-small; color: #0000ff;">:</span><span style="font-size: x-small; color: #a31515;">ChartArea</span><span style="font-size: x-small; color: #0000ff;">&gt;</span><span style="font-size: x-small;"><span style="font-size: x-small;"> </span></span><br />
<span style="font-size: x-small; color: #0000ff;">  &lt;/</span><span style="font-size: x-small; color: #a31515;">chartareas</span><span style="font-size: x-small; color: #0000ff;">&gt;</span><span style="font-size: x-small;"><span style="font-size: x-small;"> </span></span><br />
<span style="font-size: x-small; color: #0000ff;">&lt;/</span><span style="font-size: x-small; color: #a31515;">asp</span><span style="font-size: x-small; color: #0000ff;">:</span><span style="font-size: x-small; color: #a31515;">Chart</span><span style="font-size: x-small; color: #0000ff;">&gt;</span></p>
]]></content:encoded>
			<wfw:commentRss>http://byatool.com/ui/microsoft-charting-control-so-easy-an-idiot-can-use-it-and-i-have/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>You can do that in Javascript: Dynamically Create Divs</title>
		<link>http://byatool.com/ui/you-can-do-that-in-javascript-part-2/</link>
		<comments>http://byatool.com/ui/you-can-do-that-in-javascript-part-2/#comments</comments>
		<pubDate>Tue, 12 Aug 2008 12:49:00 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[UI]]></category>
		<category><![CDATA[Dynamic Controls]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://rockcityghost.wordpress.com/2008/08/12/you-can-do-that-in-javascript-part-2/</guid>
		<description><![CDATA[Creating divs on the fly and assigning methods: As I have been working with Script Controls lately, I&#8217;ve been forces to learn more about javascript&#8230;. yeah I know, bleh. However, in my learnin&#8217; I&#8217;ve actually been forced to like Javascript&#8230;. yeah I know, bleh. Well one this I was doing was tranfering a front end [...]]]></description>
			<content:encoded><![CDATA[<p>Creating divs on the fly and assigning methods:</p>
<p>As I have been working with Script Controls lately, I&#8217;ve been forces to learn more about javascript&#8230;. yeah I know, bleh. However, in my learnin&#8217; I&#8217;ve actually been forced to like Javascript&#8230;. yeah I know, bleh.</p>
<p>Well one this I was doing was tranfering a front end control to a Script Control. Basically I am building an Auto Complete control that is using the Ajax.dll AjaxMethod stuff. Thus skipping the need for web services that the Ajax Control AutoComplete needs. Anyhow, the reason I am saying this is that it gets a list of Users and dynamically creates a list of divs that change color when hovered over and fill in a textbox when selected. Originally I was doing this by creating the html needed, then appending the innerHTML property on the container div.</p>
<pre><span style="color: #3333ff;">function</span> buildSelectableDiv(currentCount, innerText, textboxName, parentDiv)
{
   <span style="color: #3333ff;">var</span> defaultClass;
   <span style="color: #3333ff;">var</span> divChild;
   <span style="color: #3333ff;">var</span> divToAdd;
   <span style="color: #3333ff;">var</span> picker;

   <span style="color: #009900;">//create the parent div</span>
   divToAdd = document.createElement(<span style="color: #990000;">'div'</span>);
   <span style="color: #009900;">//set the id of the div</span>
   divToAdd.setAttribute(<span style="color: #990000;">'name'</span>, <span style="color: #990000;">'divNames'</span> + currentCount);

   <span style="color: #009900;">//Create child div</span>
   divChild = document.createElement(<span style="color: #990000;">'div'</span>);
   <span style="color: #009900;">//getting the child ready</span>
   divChild.setAttribute(<span style="color: #990000;">'name'</span>, <span style="color: #990000;">'divNamesChild'</span> + currentCount);

   <span style="color: #009900;">//Add child to new parent</span>
   divToAdd.appendChild(divChild);

   <span style="color: #3333ff;">return</span> divToAdd;
}</pre>
<p>And there you go. Creating a div and adding div to it.</p>
]]></content:encoded>
			<wfw:commentRss>http://byatool.com/ui/you-can-do-that-in-javascript-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

