Line Up Data Points by Text Rather Than Order Added
Posted: Tue Nov 27, 2007 10:48 pm
I'll use an example to illustrate the problem:
Suppose I have one bar series with the names of the months for the text and the number of days in the month as the Y value (Jan=31, Feb=28, etc.). Now I want to add a series that has "sparse" data. In other words, data only for certain months (e.g. Mar=5, Aug=8). I store this data in a database and I only have rows for months with data (I do not have rows with a month and a null value, nor do I want to generate these in the query or on the client).
I would like to be able to add "sparse" data points to the 2nd series and have the points automatically line up with the matching months in the 1st series (based on the text value). So, when I add "Mar" with a Y-value of 5 to the 2nd series, it would be next to the "Mar" bar in the first series (instead of being next to the first bar). (In my case, you can assume that no series contains duplicate text values.)
Unfortunately, I currently have to add "null" data points which means I have to determine the missing data points myself.
Ideally, even the first series could be "sparse" and values would be automatically ordered/inserted along the x-axis by the text value with optional custom sort/comparison algorithm (imagine months or Roman numerals for examples of non-alphabetic textual sorting).
Suppose I have one bar series with the names of the months for the text and the number of days in the month as the Y value (Jan=31, Feb=28, etc.). Now I want to add a series that has "sparse" data. In other words, data only for certain months (e.g. Mar=5, Aug=8). I store this data in a database and I only have rows for months with data (I do not have rows with a month and a null value, nor do I want to generate these in the query or on the client).
I would like to be able to add "sparse" data points to the 2nd series and have the points automatically line up with the matching months in the 1st series (based on the text value). So, when I add "Mar" with a Y-value of 5 to the 2nd series, it would be next to the "Mar" bar in the first series (instead of being next to the first bar). (In my case, you can assume that no series contains duplicate text values.)
Unfortunately, I currently have to add "null" data points which means I have to determine the missing data points myself.
Ideally, even the first series could be "sparse" and values would be automatically ordered/inserted along the x-axis by the text value with optional custom sort/comparison algorithm (imagine months or Roman numerals for examples of non-alphabetic textual sorting).