system.tag.tagDensity for Date Range Data Density

I am using a date range control to allow users to set start and end times for a report. The report data is based upon a query of the SQL tag history using system.tag.tagHistory.
I’d like to set the data density histogram in the date range to show the density of sqltags history that is available. I was thinking to use the system.tag.tagDensity function to populate the histogram, but it gives me two columns and the data density histogram requires one column of timestamps that have data. Is there an easy way to do this?

It seems there must be a simple way to do this as it is exactly what the easy chart component is doing. However, I am finding it awkward to get a dataset of timestamps that have valid sqlTag history data for the data density property. The queryTagDensity function result includes timestamps for times that have no data and indicates them by a zero in the weight column. It would be easy to query this result for times when the weight column is 1 if this were a sql database, but it is a dataset so I don’t think I can use select statements. I can certainly write some code to test all the rows and build a dataset of timestamps, but was wondering if there is a simpler / more elegant solution.

Also, I don’t see how to control the number of rows returned by the queryTagDensity function. It would be nice if there were a rowcount argument or an ability to specify the time interval between rows.

Thanks.

Did you find a good solution to this? I am doing the exact same thing with creating a report and am thinking there must be an easy way to get the data density and I am missing it.