Re: [css-d] Dynamic CSS bar graph

2006-06-19 Thread Andrew Green
On Fri, 16 Jun 2006 10:00:48 -0400, Ben Liu wrote:

 The list items have a red background color which allows the graph to
 be viewed on screen. Of course when the report is printed, if the user
 does not select print background items somewhere in their print
 dialogue boxes, they get no graph printed. Anybody know a good light-
 weight way of solving this?

In my experience, borders tend to print even when backgrounds don't.
Perhaps you could add a border to each bar, which would at least make
the bars visible in print, even if they're not exactly solid.

Cheers,
Andrew.
-- 
   ::
  article seven   Andrew Green
 automatic internet   [EMAIL PROTECTED] | www.article7.co.uk
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Dynamic CSS bar graph

2006-06-16 Thread Christian Montoya
On 6/16/06, Ben Liu [EMAIL PROTECTED] wrote:
 Hello All,

 I've developed a simple online bar graph for a client. The page
 queries a database, tallies the total number of orders coming in from
 each US state and then draws a series of bar graphs to represent the
 number of orders. The report works fine expect when the user tries to
 print it.
...
 Anybody know a good light-weight way of solving this? I was
 thinking of making the bars all divs with a fixed width and variable
 height and then putting a large foreground img into them. But wouldn't
 this cause the div to automatically expand to the full height and
 width of the img?

No, of course not... divs are not tables. By default, the img should
overflow the div, and should be visible outside of the boundaries of
the div. If you apply

overflow:hidden;

to the div, then only the parts of the img inside the div will show.

 Perhaps I could variably set image height=x within
 the img tag?

Why not just set the width and height of the image to be the same as
the div in the CSS? Then again, since this is already a visual driven
output, why not just use img's by themselves? You could do:

img {
display:block;
width:Xpx;
height:Xpx;
...
}

 Is their a CSS method to force background printing to
 on for an item?

No, and for good reason!

HIH

-- 
-- 
Christian Montoya
christianmontoya.com ... portfolio.christianmontoya.com
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Dynamic CSS bar graph

2006-06-16 Thread Ben Liu
Hi Christian,

Thanks for the help. I think I can do away with the containment div
around the bar graph img since I have another containment div already
performing some other functions. Any ideas on what is more correct:

img src=bargraph.gif height=? some variable script here ? /

-OR-

img src=bargraph.gif style=height: ? some variable script here ? /

or in other words, does the image height declaration belong in the html or css?

If it does belong in the CSS, it would have to be in-line because I
don't think there is a way to write it dynamically into an outside
linked style sheet.

- BL

On 6/16/06, Christian Montoya [EMAIL PROTECTED] wrote:
 On 6/16/06, Ben Liu [EMAIL PROTECTED] wrote:
  Hello All,
 
  I've developed a simple online bar graph for a client. The page
  queries a database, tallies the total number of orders coming in from
  each US state and then draws a series of bar graphs to represent the
  number of orders. The report works fine expect when the user tries to
  print it.
 ...
  Anybody know a good light-weight way of solving this? I was
  thinking of making the bars all divs with a fixed width and variable
  height and then putting a large foreground img into them. But wouldn't
  this cause the div to automatically expand to the full height and
  width of the img?

 No, of course not... divs are not tables. By default, the img should
 overflow the div, and should be visible outside of the boundaries of
 the div. If you apply

 overflow:hidden;

 to the div, then only the parts of the img inside the div will show.

  Perhaps I could variably set image height=x within
  the img tag?

 Why not just set the width and height of the image to be the same as
 the div in the CSS? Then again, since this is already a visual driven
 output, why not just use img's by themselves? You could do:

 img {
 display:block;
 width:Xpx;
 height:Xpx;
 ...
 }

  Is their a CSS method to force background printing to
  on for an item?

 No, and for good reason!

 HIH

 --
 --
 Christian Montoya
 christianmontoya.com ... portfolio.christianmontoya.com

__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/


Re: [css-d] Dynamic CSS bar graph

2006-06-16 Thread Christian Montoya
On 6/16/06, Ben Liu [EMAIL PROTECTED] wrote:
 Hi Christian,

 Thanks for the help. I think I can do away with the containment div
 around the bar graph img since I have another containment div already
 performing some other functions. Any ideas on what is more correct:

 img src=bargraph.gif height=? some variable script here ? /

 -OR-

 img src=bargraph.gif style=height: ? some variable script here ? /

 or in other words, does the image height declaration belong in the html or 
 css?

You are much better off doing it in the HTML. Images should, if
possible, always have height and width settings, if they are meant to
be a pixel size. They render faster when they have the dimensions in
the HTML too.

-- 
-- 
Christian Montoya
christianmontoya.com ... portfolio.christianmontoya.com
__
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/