{"id":212,"date":"2007-06-13T16:06:44","date_gmt":"2007-06-13T21:06:44","guid":{"rendered":"http:\/\/bobbeaty.com\/wp\/?p=212"},"modified":"2007-06-14T07:35:17","modified_gmt":"2007-06-14T12:35:17","slug":"adding-combo-graph-to-bkit","status":"publish","type":"post","link":"https:\/\/bobbeaty.com\/wp\/archives\/212","title":{"rendered":"Adding Combo Graph to BKit"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/bobbeaty.com\/wp\/wp-content\/uploads\/2007\/06\/combograph.png\" border=\"0\" height=\"95\" width=\"150\" alt=\"comboGraph.png\" align=\"right\" \/><\/p>\n<p>Today one of the developers wanted to add lines to the <a href=\"http:\/\/www.visual-technologies.net\/\">VantagePoint<\/a> bar graphs that I had wrapped with nice little helper classes and applets for BKit. The problem is that a bar graph can't have lines, but a <i>combo graph<\/i> can. So I added the combo graph as a type to the BKBaseGraph and the BKBaseGraphApplet. The idea is that it's very much like the bar graph - even being subclassed off it, but the way it handles the lines versus bars is to have essentially two types of variables: regular variables that are the bars, and line variables that are the lines.<\/p>\n<p>Once I figured that out, and then fixed up a few methods like <tt>getColumnHeadersOnGraph()<\/tt>, it wasn't that hard to get everything working. The subclassing was interesting in that I had to have tests for the combo graph <b>before<\/b> the bar graph as the <tt>instanceof<\/tt> would have been true for the bar graph class when I really wanted it to hold out for the combo graph. Not bad, but interesting.<\/p>\n<p>The final thing was a new applet <tt>PARAM<\/tt> tag to indicate what lines to put on the graph. I chose <tt>asline:&lt;col&gt;<\/tt> (\"as line\") so if I had columns <i>one<\/i>, <i>two<\/i>, and <i>three<\/i> as bars, and <i>four<\/i> as a line, the relevant <tt>PARAM<\/tt> tags would be:<\/p>\n<pre>\n  &lt;PARAM NAME=\"visible:one\" VALUE=\"TRUE\" \/&gt;\n  &lt;PARAM NAME=\"visible:two\" VALUE=\"TRUE\" \/&gt;\n  &lt;PARAM NAME=\"visible:three\" VALUE=\"TRUE\" \/&gt;\n  &lt;PARAM NAME=\"asline:four\" VALUE=\"TRUE\" \/&gt;\n<\/pre>\n<p>This tests out great and the line width, color, etc. all work on the line in the combo graph - as you'd expect. It's a nice little addition to the toolkit.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today one of the developers wanted to add lines to the VantagePoint bar graphs that I had wrapped with nice little helper classes and applets for BKit. The problem is that a bar graph can&#8217;t have lines, but a combo graph can. So I added the combo graph as a type to the BKBaseGraph and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-212","post","type-post","status-publish","format-standard","hentry","category-coding"],"_links":{"self":[{"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/posts\/212","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/comments?post=212"}],"version-history":[{"count":0,"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/posts\/212\/revisions"}],"wp:attachment":[{"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/media?parent=212"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/categories?post=212"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/tags?post=212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}