<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://wbex.ru/index.php?action=history&amp;feed=atom&amp;title=JavaScript_DHTML%2FGUI_Components%2FChart</id>
		<title>JavaScript DHTML/GUI Components/Chart - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://wbex.ru/index.php?action=history&amp;feed=atom&amp;title=JavaScript_DHTML%2FGUI_Components%2FChart"/>
		<link rel="alternate" type="text/html" href="http://wbex.ru/index.php?title=JavaScript_DHTML/GUI_Components/Chart&amp;action=history"/>
		<updated>2026-04-04T20:37:31Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://wbex.ru/index.php?title=JavaScript_DHTML/GUI_Components/Chart&amp;diff=4098&amp;oldid=prev</id>
		<title> в 10:00, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://wbex.ru/index.php?title=JavaScript_DHTML/GUI_Components/Chart&amp;diff=4098&amp;oldid=prev"/>
				<updated>2010-05-26T10:00:42Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 10:00, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://wbex.ru/index.php?title=JavaScript_DHTML/GUI_Components/Chart&amp;diff=4099&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://wbex.ru/index.php?title=JavaScript_DHTML/GUI_Components/Chart&amp;diff=4099&amp;oldid=prev"/>
				<updated>2010-05-26T07:43:36Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Javascript bar chart ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
/*&lt;br /&gt;
Examples From&lt;br /&gt;
JavaScript: The Definitive Guide, Fourth Edition&lt;br /&gt;
Legal matters: these files were created by David Flanagan, and are&lt;br /&gt;
Copyright (c) 2001 by David Flanagan.  You may use, study, modify, and&lt;br /&gt;
distribute them for any purpose.  Please note that these examples are&lt;br /&gt;
provided &amp;quot;as-is&amp;quot; and come with no warranty of any kind.&lt;br /&gt;
David Flanagan&lt;br /&gt;
*/&lt;br /&gt;
/**&lt;br /&gt;
 * BarChart.js:&lt;br /&gt;
 * This file defines makeBarChart(), a function that creates a bar chart to&lt;br /&gt;
 * display the numbers from the data[] array. The chart is a block element&lt;br /&gt;
 * inserted at the current end of the document.  The overall size of the chart &lt;br /&gt;
 * is specified by the optional width and height arguments, which include the&lt;br /&gt;
 * space required for the chart borders and internal padding.  The optional&lt;br /&gt;
 * barcolor argument specifies the color of the bars. The function returns the&lt;br /&gt;
 * chart element it creates, so the caller can further manipulate it by&lt;br /&gt;
 * setting a margin size, for example.&lt;br /&gt;
 * &lt;br /&gt;
 * Import this function into an HTML file with code like this:&lt;br /&gt;
 *    &amp;lt;script src=&amp;quot;BarChart.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
 * Use this function in an HTML file with code like this:&lt;br /&gt;
 *    &amp;lt;script&amp;gt;makeBarChart([1,4,9,16,25], 300, 150, &amp;quot;yellow&amp;quot;);&amp;lt;/script&amp;gt;&lt;br /&gt;
 **/&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;HTML&amp;gt; &lt;br /&gt;
&amp;lt;HEAD&amp;gt; &lt;br /&gt;
&amp;lt;TITLE&amp;gt;JavaScript Bar chart&amp;lt;/TITLE&amp;gt;&lt;br /&gt;
&amp;lt;SCRIPT LANGUAGE=&amp;quot;JavaScript&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
function makeBarChart(data, width, height, barcolor) {&lt;br /&gt;
    // Provide default values for the optional arguments&lt;br /&gt;
    if (!width) width = 500;&lt;br /&gt;
    if (!height) height = 350;&lt;br /&gt;
    if (!barcolor) barcolor = &amp;quot;blue&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    // The width and height arguments specify the overall size of the&lt;br /&gt;
    // generated chart. We have to subtract the border and padding&lt;br /&gt;
    // sizes from this to get the size of the element we create.&lt;br /&gt;
    width -= 24;  // subtract 10px padding and 2px border left and right&lt;br /&gt;
    height -= 14; // Subtract 10px top padding and 2px top and bottom border&lt;br /&gt;
    // Now create an element to hold the chart.  Note that we make the chart&lt;br /&gt;
    // relatively positioned so that can have absolutely positioned children,&lt;br /&gt;
    // but it still appears in the normal element flow.&lt;br /&gt;
    var chart = document.createElement(&amp;quot;DIV&amp;quot;);&lt;br /&gt;
    chart.style.position = &amp;quot;relative&amp;quot;;          // Set relative positioning&lt;br /&gt;
    chart.style.width = width + &amp;quot;px&amp;quot;;           // Set the chart width&lt;br /&gt;
    chart.style.height = height + &amp;quot;px&amp;quot;;         // Set the chart height&lt;br /&gt;
    chart.style.border = &amp;quot;solid black 2px&amp;quot;;     // Give it a border&lt;br /&gt;
    chart.style.paddingLeft = &amp;quot;10px&amp;quot;;           // Add padding on the left&lt;br /&gt;
    chart.style.paddingRight = &amp;quot;10px&amp;quot;;          // and on the right&lt;br /&gt;
    chart.style.paddingTop = &amp;quot;10px&amp;quot;;            // and on the top&lt;br /&gt;
    chart.style.paddingBottom = &amp;quot;0px&amp;quot;;          // but not on the bottom&lt;br /&gt;
    chart.style.backgroundColor = &amp;quot;white&amp;quot;;      // Make chart background white&lt;br /&gt;
    // Compute the width of each bar&lt;br /&gt;
    var barwidth = Math.floor(width/data.length);&lt;br /&gt;
    // Find largest number in data[].  Note clever use of Function.apply()&lt;br /&gt;
    var maxdata = Math.max.apply(this, data);&lt;br /&gt;
    // The scaling factor for the chart: scale*data[i] gives height of a bar&lt;br /&gt;
    var scale = height/maxdata;&lt;br /&gt;
    // Now loop through the data array and create a bar for each datum&lt;br /&gt;
    for(var i = 0; i &amp;lt; data.length; i++) {&lt;br /&gt;
        var bar = document.createElement(&amp;quot;div&amp;quot;); // Create div for bar&lt;br /&gt;
        var barheight = data[i] * scale;         // Compute height of bar&lt;br /&gt;
        bar.style.position = &amp;quot;absolute&amp;quot;;         // Set bar position and size&lt;br /&gt;
        bar.style.left = (barwidth*i+1+10)+&amp;quot;px&amp;quot;; // Add bar border &amp;amp; chart pad&lt;br /&gt;
        bar.style.top = height-barheight+10+&amp;quot;px&amp;quot;;// Add chart padding&lt;br /&gt;
        bar.style.width = (barwidth-2) + &amp;quot;px&amp;quot;;   // -2 for the bar border&lt;br /&gt;
        bar.style.height = (barheight-1) + &amp;quot;px&amp;quot;; // -1 for the bar top border&lt;br /&gt;
        bar.style.border = &amp;quot;solid black 1px&amp;quot;;    // Bar border style&lt;br /&gt;
        bar.style.backgroundColor = barcolor;    // Bar color&lt;br /&gt;
        bar.style.fontSize = &amp;quot;1px&amp;quot;;              // IE bug workaround&lt;br /&gt;
        chart.appendChild(bar);                  // Add bar to chart&lt;br /&gt;
    }&lt;br /&gt;
    // Now add the chart we&amp;quot;ve built to the document body&lt;br /&gt;
    document.body.appendChild(chart);&lt;br /&gt;
    // Finally, return the chart element so the caller can manipulate it&lt;br /&gt;
    return chart;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/SCRIPT&amp;gt;&lt;br /&gt;
&amp;lt;/HEAD&amp;gt; &lt;br /&gt;
&amp;lt;BODY&amp;gt; &lt;br /&gt;
&amp;lt;script&amp;gt;makeBarChart([1,4,9,16,25], 300, 150, &amp;quot;yellow&amp;quot;);&amp;lt;/SCRIPT&amp;gt;&lt;br /&gt;
&amp;lt;/BODY&amp;gt; &lt;br /&gt;
&amp;lt;/HTML&amp;gt;&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
         &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==jqchart==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;A href=&amp;quot;http://www.wbex.ru/Code/JavaScriptDownload/jqchart.zip&amp;quot;&amp;gt;jqchart.zip( 86 k)&amp;lt;/a&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1. &lt;br /&gt;
&amp;lt;A href=&amp;quot;/Code/JavaScript/GUI-Components/Javascriptbarchart.htm&amp;quot;&amp;gt;Javascript bar chart &amp;lt;/a&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>