Free Republic
Browse · Search
General/Chat
Topics · Post Article

To: Ray76
Here is another way to make a bar chart

Bar Graph Title

  A   44.52  12.49%  
  B   33.05   9.28%  
  C   28.65   8.04%  
  D   27.23   7.64%  
  E   26.97   7.57%  
  F   25.78   7.23%  
  G   23.21   6.51%  

This method uses table cells filled with a clear image. The color of each bar is determined by the background color of the cell, not by the color of an image. The cell contains the clear image, the image width is stretched to the width specified on the img tag, which causes the table cell to expand to fit the image.

There's a little more setup involved than in the first method, for example in order for each bar to have a unique length each row in the chart must be it's own table, but it's worth the effort.

82 posted on 09/07/2016 4:54:13 PM PDT by Ray76 (Americanism, not globalism, will be our credo!)
[ Post Reply | Private Reply | To 81 | View Replies ]


To: Ray76
September 2016
Sun Mon Tue Wed Thu Fri Sat
        1 2 3
4 5 6
this and that
7 8 9 10
11 12 13 14 15
this, that, and the other thing
16 17
18 19 20
High Point, NC; Kenansville, NC
21 22 23 24
25 26 27 28 29 30  

86 posted on 09/20/2016 4:48:20 AM PDT by Ray76
[ Post Reply | Private Reply | To 82 | View Replies ]

To: Ray76
More fun with bar charts. This is the easiest so far.

A single bar

  A       50    50%    

<td height="6px" bgcolor="red" width="100"><font size="1px">&nbsp;</font></td>

Set the width equal to the desired percentage. 100 for 100% 30 for 30%, etc. Choose a color.

 


A single bar, reduced height

  B   33.05   9.28%  
 


A stacked bar

  C   33.05   9.28%  
   


Here's how:

   <!-- Bar Chart Element -->
   <table>
       <tbody cellpadding="0" cellspacing="0">
           <tr>
               <!-- Labels -->
               <td><tt>&nbsp;&nbsp;C&nbsp;&nbsp;&nbsp;33.05&nbsp;&nbsp;&nbsp;9.28%&nbsp;&nbsp;</tt></td>
               <!-- spacing -->
               <td></td>
               <!-- Stacked Bar -->
               <table cellpadding="0" cellspacing="0">
                   <tr>
                       <!-- Bar 1 -->
                       <td height="6px" bgcolor="green" width="30"><font size="1px">&nbsp;</font></td>
                       <!-- Bar 2 -->
                       <td height="6px" bgcolor="blue" width="70"><font size="1px">&nbsp;</font></td>
                   </tr>
               </table>
           </tr>
       </tbody>
   </table>

116 posted on 03/27/2017 9:18:48 PM PDT by Ray76 (DRAIN THE SWAMP)
[ Post Reply | Private Reply | To 82 | View Replies ]

Free Republic
Browse · Search
General/Chat
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson