<?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>OmegaBundle &#8211; Xojo Programming Blog</title>
	<atom:link href="https://blog.xojo.com/tag/omegabundle/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.xojo.com</link>
	<description>Blog about the Xojo programming language and IDE</description>
	<lastBuildDate>Tue, 18 Apr 2023 17:57:50 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Heatmaps with the Monkeybread ChartDirector Plugin</title>
		<link>https://blog.xojo.com/2021/07/13/heatmaps-with-monkeybread-chartdirector-plugin/</link>
		
		<dc:creator><![CDATA[Stefanie Juchmes]]></dc:creator>
		<pubDate>Tue, 13 Jul 2021 15:00:00 +0000</pubDate>
				<category><![CDATA[Guest Post]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[XDC]]></category>
		<category><![CDATA[Charts]]></category>
		<category><![CDATA[Monkeybread Software]]></category>
		<category><![CDATA[OmegaBundle]]></category>
		<category><![CDATA[Third Party]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=8804</guid>

					<description><![CDATA[In this blog post I want to show you how to build a heatmap as a representative for other diagrams. In order to complete this project you'll the MBS Xojo ChartDirector Plugin, conveniently included in the Omegabundle. A heat map is a grid of fields...]]></description>
										<content:encoded><![CDATA[
<p>In this blog post I want to show you how to build a heatmap. In order to complete this project you&#8217;ll need the <a href="https://www.xojo.com/store/addons/MBS.php">MBS Xojo ChartDirector Plugin</a>, conveniently included in the <a href="http://omegabundle.net/">Omegabundle</a> right now.</p>



<p>A heatmap is a grid of fields that can have different sizes and colors. Heatmaps are often used to analyze website user behavior. Each area is assigned a color, and heat maps let you see the high and the low of that area. They often look like the image of a thermal camera, which is where the name comes from. Of course, a heatmap can also be used for displaying different temperatures, as its name so aptly describes. In this example we want to do that. We have the monthly mean temperature for a city for the last 10 years and we want to display this temperature by colors in a heatmap. </p>



<h2 class="wp-block-heading">The Data</h2>



<p>To do this, we first create an array in which we write the years we have and an array with the individual month names: The information in these arrays will be needed later for the labelling of the axes. </p>



<p>In order to be able to display values in a diagram, we want to write the values into a single array with all the months following with their values. We will combine the values as follow:&nbsp;</p>



<pre class="wp-block-preformatted">Array( Jan ( 0 ) … Jan ( 9 ) , Feb ( 0 ) … Feb ( 9 ) , Mar ( 0 ) … , … Dec ( 9 ) )</pre>



<p>We start with the January values and append the other months behind it. We can highlight special parts of the heatmap by adding a star, a polygon or a cross of any color to the area.&nbsp;</p>



<h2 class="wp-block-heading">Creating the Heatmap</h2>



<p>Now we come to the creation of the actual diagram. We create an area 600 x 500 pixels in size; on this area we will later draw our chart and the legend. To do this, we create an instance of the class&nbsp;<a href="https://www.monkeybreadsoftware.net/class-cdxychartmbs.shtml">CDXYChartMBS</a>&nbsp;and pass the size in the parameters.&nbsp;</p>



<pre class="wp-block-preformatted">Dim c As New CDXYChartMBS(600, 500)</pre>



<p>Above the chart, with addTitle, we can add a title that describes our chart. Our chart should be on an area of 400 x 400 pixels and have a distance of 80 pixels from the top edge. The background color, as well as the grid color is transparent.&nbsp;</p>



<pre class="wp-block-preformatted">Dim p As CDPlotAreaMBS = c.setPlotArea(80, 80, 400, 400, -1, -1, CDBaseChartMBS.kTransparent, CDBaseChartMBS.kTransparent)</pre>



<p>Now our symbol for minimum temperature is added. The minimum temperature is a small circle in a light blue color. In the addScatterLayer method we first specify the X and Y coordinate arrays as parameters then the title that will later be displayed in the legend next to the diagram and the shape of the symbol. Here we use PolygonShape. The number in the brackets behind the shape indicates the number of sides of the polygon. If this is 0, we see a circle. Then in the parameters follows the size of the symbol and the color. The structure is the same for other marks.</p>



<pre class="wp-block-preformatted">Call c.addScatterLayer(symbolX, symbolY, "Min value", CDBaseChartMBS.PolygonShape(0), 15, &amp;hc6e2ff)</pre>



<p>Now we create the heatmap with the method addDiscreteHeatMapLayer. It should have a size of 10 x 12 cells. 10 cells on the x axis and 12 cells on the y axis. In the parameters we first specify the array with the data and then the amount of cells on the x axis. For this we have to determined the array size of the array of the years. The cell amount for y axis is automatically determined from the amount of data. </p>



<pre class="wp-block-preformatted">Dim layer As CDDiscreteHeatMapLayerMBS = c.addDiscreteHeatMapLayer(zData, xLabels_size)</pre>



<p>We now set the labels for the axes. With the method setLabels we specify the text. With the method xAxis.setLabelStyle we specify the font and the font color. The label should be rotated by 90 degrees on the x axis so that it is easier to read. With setLabelOffset we set the distance of the text to the grid border. With a value of 0, the text would be on the left or upper edges of the cell and not in the middle. With setXAxisOnTop we indicate that the text of the x axis should be above the diagram. </p>



<p>The setting of the y axis labels is similar</p>



<pre class="wp-block-preformatted">Call c.xAxis.setLabels(xLabels) 
Call c.xAxis.setLabelStyle("Arial Bold", 10, CDBaseChartMBS.kTextColor, 90) c.xAxis.setColors(CDBaseChartMBS.kTransparent, CDBaseChartMBS.kTextColor) 
c.xAxis.setLabelOffset(0.25) 
c.setXAxisOnTop 

Call c.yAxis.setLabels(yLabels) 
Call c.yAxis.setLabelStyle("Arial Bold", 10) c.yAxis.setColors(CDBaseChartMBS.kTransparent, CDBaseChartMBS.kTextColor) 
c.yAxis.setLabelOffset(0.25) 
c.yAxis.setReverse</pre>



<p>Now we want to specify the individual colors for the value ranges. For this we create a new array. In this array we first enter the lower limit of the temperature that the color should describe, then the color value in hexadecimal followed by the uppermost value. The uppermost value is at the same time the lowermost value of the next color, so we don&#8217;t enter it twice, but give directly the next color. Our values all have a distance of 3 degrees. Afterwards we create the array colorLabels, which describes the text for our legend</p>



<pre class="wp-block-preformatted">Dim colorScale() As Double = Array(0.0, &amp;h104E8B, 0.0, &amp;h00BFFF, 3.0, &amp;h7FFFD4, 6.0, &amp;hFFFF00, 9.0, &amp;hFFC125, 12.00, &amp;hFF7F00, 15.00, &amp;hff4500, 18.00, &amp;hcd0000, 21.00,&amp;h8B0000, 21.10) 
Dim colorLabels() As String = Array("&lt;0.0", "0.0-3.0", "3.1-6.0", "6.1-9.0", "9.1-12.0", "12.1-15.0", "15.1-18.0", "18.1-21.0", „>21.0“)</pre>



<p>We then apply the colors with colorAxis.setColorScale on the layer level.</p>



<pre class="wp-block-preformatted">layer.colorAxis.setColorScale(colorScale)</pre>



<p>We place the legend 20 pixels to the right of the diagram. We use the font Arial Bold in size 10. With setKeySize we set the size of the legend boxes and with setKeySpacing the vertical distance between the individual legend entries.</p>



<pre class="wp-block-preformatted">Dim b As CDLegendBoxMBS = c.addLegend(p.getRightX + 20, p.getTopY, True, "Arial Bold", 10) 
b.setBackground(CDBaseChartMBS.kTransparent, CDBaseChartMBS.kTransparent) 
b.setKeySize(15, 15) 
b.setKeySpacing(0, 8) 
b.addText("Temp in °C“)</pre>



<p>For the colors we use a trick, we read only the colors from the array that contains the color values and the temperature ranges by looking only at every second value. With the method addKey we then add the tag with the name and the extracted color.&nbsp;</p>



<pre class="wp-block-preformatted">For i As Integer = colorLabels_size - 1 DownTo 0 
 Dim n As Integer = colorScale(i * 2 + 1) 
 b.addKey(colorLabels(i), n) 
Next</pre>



<p>With the method makeChartPicture we get our diagram as picture:</p>



<pre class="wp-block-preformatted">pic = c.makeChartPicture</pre>



<p>And you can show this picture as backdrop to better draw it with the paint event. If you use MakeChart with PDF type as parameter, you can get a PDF file to embed in a PDF page as vector graphics.</p>



<p>Then we can run the program and see our heatmap. You can then continue to work with this heatmap according to your own preferences. The final heat map looks like this:</p>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="758" src="https://blog.xojo.com/wp-content/uploads/2021/07/tempheatmap-1024x758.jpg" alt="" class="wp-image-8808" srcset="https://blog.xojo.com/wp-content/uploads/2021/07/tempheatmap-1024x758.jpg 1024w, https://blog.xojo.com/wp-content/uploads/2021/07/tempheatmap-300x222.jpg 300w, https://blog.xojo.com/wp-content/uploads/2021/07/tempheatmap-768x568.jpg 768w, https://blog.xojo.com/wp-content/uploads/2021/07/tempheatmap-1536x1136.jpg 1536w, https://blog.xojo.com/wp-content/uploads/2021/07/tempheatmap.jpg 1668w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>As I mentioned at the beginning of this post, you&#8217;ll need the <a href="https://www.monkeybreadsoftware.de/xojo/plugin-chartdirector.shtml">MBS Xojo ChartDirector Plugin</a> which you can purchase on the MonkeyBread Software website; or, at the moment, it&#8217;s included in super the <a href="http://omegabundle.net/">Omegabundle</a> deal. Besides ChartDirector, Omegabundle includes a ton of other tools for the sensational price of 399.99$. For example, you also get a DynaPDF Starter license with which you can use to write the chart into a PDF file. If you want to attend the Xojo Developer Conference 2022 in London and meet us, Omegabundle includes a discount of 100$ for the conference! Read articles from the Xdev developer magazine on the way to the conference, because it&#8217;s also included in the bundle! Have a look at the <a href="http://omegabundle.net/">Omegabundle</a>. It&#8217;s worth it. I hope you enjoy the heatmap!</p>



<p><em>Stefanie Juchmes studies computer science at the University of Bonn. She came in touch with Xojo due to the work of her brother-in-law and got a junior developer position in early 2019 at <a rel="noreferrer noopener" href="https://www.monkeybreadsoftware.de/xojo/" target="_blank">Monkeybread Software.</a> You may have also read her articles in <a rel="noreferrer noopener" href="http://www.xdevmag.com/" target="_blank">Xojo Developer Magazine</a>. </em></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>XojoTalk 022 &#8211; I Like Things That Just Work</title>
		<link>https://blog.xojo.com/2016/02/23/xojotalk-022-i-like-things-that-just-work/</link>
		
		<dc:creator><![CDATA[Paul Lefebvre]]></dc:creator>
		<pubDate>Tue, 23 Feb 2016 00:00:00 +0000</pubDate>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[XojoTalk]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[OmegaBundle]]></category>
		<category><![CDATA[Podcast]]></category>
		<guid isPermaLink="false">http://blogtemp.xojo.com/2016/02/23/xojotalk-022-i-like-things-that-just-work/</guid>

					<description><![CDATA[Paul talks with Tim Parnell about HTMLEdit, Web Studio, Answers and OmegaBundle.]]></description>
										<content:encoded><![CDATA[<p>Paul talks with <a href="https://twitter.com/timi" target="_blank">Tim Parnell</a>, creator of several Xojo add-ons and active <a href="https://forum.xojo.com/" target="_blank">Xojo forum</a> contributor.</p>
<p>To listen to this podcast, download the <a href="http://files.xojo.com/Podcasts/XojoTalk-022.mp3">mp3</a> now.</p>
<p><span id="more-362"></span></p>
<h2>Show Notes</h2>
<ul>
<li><a href="http://timi.me/">Tim Parnell web site</a></li>
<li><a href="http://nswrs.com">Answers</a></li>
<li><a href="http://htmledit.timi.me">HTML Edit</a></li>
<li><a href="http://quilljs.com/">Quill Editor</a></li>
<li><a href="https://webstudio.ws">Web Studio</a></li>
<li><a href="http://getbootstrap.com/components/">Bootstrap Controls</a></li>
<li><a href="http://www.omegabundle.net/">OmegaBundle</a></li>
</ul>
<p>Be sure to subscribe to the XojoTalk podcast for more great developer conversations!</p>
<p><!--HubSpot Call-to-Action Code --> <span id="hs-cta-wrapper-32eb9715-5c1c-45a4-9f37-717ffc906d8e" class="hs-cta-wrapper"> <span id="hs-cta-32eb9715-5c1c-45a4-9f37-717ffc906d8e" class="hs-cta-node hs-cta-32eb9715-5c1c-45a4-9f37-717ffc906d8e"><br />
<!-- [if lte IE 8]>


<div id="hs-cta-ie-element"></div>


<![endif]--> <a href="http://feeds.feedburner.com/xojotalk" target="_blank"><img decoding="async" id="hs-cta-img-32eb9715-5c1c-45a4-9f37-717ffc906d8e" class="hs-cta-img aligncenter" style="border-width: 0px;" src="https://blog.xojo.com/wp-content/uploads/2014/09/32eb9715-5c1c-45a4-9f37-717ffc906d8e.png" alt="Subscribe Podcast" width="622" height="107" /></a> </span><script src="https://js.hscta.net/cta/current.js" charset="utf-8">// <![CDATA[
<script type="text/javascript"><![CDATA[ hbspt.cta.load(608515, '32eb9715-5c1c-45a4-9f37-717ffc906d8e', {}); // ]]&gt;</script></span><br />
<!-- end HubSpot Call-to-Action Code --></p>
]]></content:encoded>
					
		
		<enclosure url="http://files.xojo.com/Podcasts/XojoTalk-022.mp3" length="10073987" type="audio/mpeg" />

			</item>
	</channel>
</rss>
