Can I have a hidden "other" value to affect percen
Posted: Sat Jan 15, 2005 3:20 am
Hi. I'm using TeeChart 6.
In my app, I've got a bunch of records with values. For sake of example, let's say there are 5 records, with labels and values like this:
"First", 1
"Second", 2
"Third", 3
"Fourth", 4
"Fifth", 5
I'm generating an HTML page which contains a chart of the first 3 records, along with a table showing all 5 of the records.
The problem is that the chart only knows about the first 3 records, so its percentage calculations are off. It only sees a total of 6 for the entire series of 3 values (ie, 1+2+3=6), but the true total for my entire data set is 15 (ie, 1+2+3+4+5=15). The chart shows the percentages for the (first three) data points as 16.7% (ie, 1/6), 33.3% (ie, 2/6), and 50% (ie, 3/6). But the actual percentage points that I'd like to show (so that they match the table) are 6.7% (1/15), 13.3% (2/15), and 20% (3/15).
Of course, in my actual application is number of records is usually well over 50 (and could be in the hundreds), and the number of data points charted is usually 10 or 25. So simply adding all data points to the chart is not a solution. Also, I'd like to avoid adding one more data point for this "other" value (because I'm assuming that it would be visible and will screw up the chart for my purposes).
Instead, is it possible to define an "extra" or "other" value for a series, which is not charted? In my example above, I would set the series "other" value to 9 (ie, 4+5=9) so as to account for the records not being charted. Then the series would know that the total is actually 15 and thus the percentages would be shown correctly.
Is this possible? I've looked around for such a property but can't seem to find one. Or, is there another solution?
Thanks in advance!
Ken
In my app, I've got a bunch of records with values. For sake of example, let's say there are 5 records, with labels and values like this:
"First", 1
"Second", 2
"Third", 3
"Fourth", 4
"Fifth", 5
I'm generating an HTML page which contains a chart of the first 3 records, along with a table showing all 5 of the records.
The problem is that the chart only knows about the first 3 records, so its percentage calculations are off. It only sees a total of 6 for the entire series of 3 values (ie, 1+2+3=6), but the true total for my entire data set is 15 (ie, 1+2+3+4+5=15). The chart shows the percentages for the (first three) data points as 16.7% (ie, 1/6), 33.3% (ie, 2/6), and 50% (ie, 3/6). But the actual percentage points that I'd like to show (so that they match the table) are 6.7% (1/15), 13.3% (2/15), and 20% (3/15).
Of course, in my actual application is number of records is usually well over 50 (and could be in the hundreds), and the number of data points charted is usually 10 or 25. So simply adding all data points to the chart is not a solution. Also, I'd like to avoid adding one more data point for this "other" value (because I'm assuming that it would be visible and will screw up the chart for my purposes).
Instead, is it possible to define an "extra" or "other" value for a series, which is not charted? In my example above, I would set the series "other" value to 9 (ie, 4+5=9) so as to account for the records not being charted. Then the series would know that the total is actually 15 and thus the percentages would be shown correctly.
Is this possible? I've looked around for such a property but can't seem to find one. Or, is there another solution?
Thanks in advance!
Ken