@ajnewton1 I had a peek in the eXist-db at your XQuery generating one of those troubled bar graphs, and I think I've spotted the stacking problem. Here's a snip of your code generating a couple of bars on the "Comparison Between the Amount of Time each Gender Was Quoted" graph:
Here's what I see, and I'm taking my time reading the variables:
1) I'm not sure how you're determining the value of "y" for each rectangle--it seems like you're doing the stacking by hand? (It's more robust code to write out the variables that are doing the stacking so we can see what's what--use XQuery as your calculator.)
2) Earlier in your XQuery, here's how you've defined these variables:
What that tells me is: the $articles variable represents a TOTAL COUNT of all the quotes that have an @sex attribute. I have a couple of questions about this:
If <quote> has an @sex, is it only ever "m" or "f" in value? (If that's the case, the total count for quote should not exceed the total count of males vs. females. If I remember right, though, you had some quotes where the sex was undetermined/indeterminate. They just shouldn't be so extensive as they're appearing in the long black rectangles on the graph, right?)
Are there any <quote> elements missing the @sex attribute? (If so, are they not being counted?)
OK, if we know that $articles (and $ERarticles and other variables like it) represent a TOTAL, that total already contains the male and female quotes. So when you go to stack your bar graphs, this one should not be sitting on top of the others. It should be the first bar you draw and it should extend from 0,0 up to the total. (That's something I'd want to double-check to be sure is happening.)
If each of your bars superimposes over the others, the bars for males and females need to properly stack, and...I think the problem is that the male bar isn't sitting on top of the female bar, but is being obscured under it. If the bars are being plotted from 0,0 upward, you want to set the value of the female count + the male count to determine how high the male bar sits.
Let's tinker with the variables this morning and see if we can make the stacking work and the code more robust and easier to read.
@ajnewton1 I had a peek in the eXist-db at your XQuery generating one of those troubled bar graphs, and I think I've spotted the stacking problem. Here's a snip of your code generating a couple of bars on the "Comparison Between the Amount of Time each Gender Was Quoted" graph:
Here's what I see, and I'm taking my time reading the variables: 1) I'm not sure how you're determining the value of "y" for each rectangle--it seems like you're doing the stacking by hand? (It's more robust code to write out the variables that are doing the stacking so we can see what's what--use XQuery as your calculator.) 2) Earlier in your XQuery, here's how you've defined these variables:
What that tells me is: the
$articles
variable represents a TOTAL COUNT of all the quotes that have an@sex
attribute. I have a couple of questions about this:<quote>
has an@sex
, is it only ever "m" or "f" in value? (If that's the case, the total count for quote should not exceed the total count of males vs. females. If I remember right, though, you had some quotes where the sex was undetermined/indeterminate. They just shouldn't be so extensive as they're appearing in the long black rectangles on the graph, right?)<quote>
elements missing the@sex
attribute? (If so, are they not being counted?)OK, if we know that
$articles
(and$ERarticles
and other variables like it) represent a TOTAL, that total already contains the male and female quotes. So when you go to stack your bar graphs, this one should not be sitting on top of the others. It should be the first bar you draw and it should extend from 0,0 up to the total. (That's something I'd want to double-check to be sure is happening.)If each of your bars superimposes over the others, the bars for males and females need to properly stack, and...I think the problem is that the male bar isn't sitting on top of the female bar, but is being obscured under it. If the bars are being plotted from 0,0 upward, you want to set the value of the female count + the male count to determine how high the male bar sits.
Let's tinker with the variables this morning and see if we can make the stacking work and the code more robust and easier to read.