开发者

Updating data values in MSChart after binding

I have a line chart that loads a set of daily values. Some days there is no data, so if I just load the set of values I have, the line chart connects the non-contiguous days with a straight line which renders the chart misleading.

I then adjusted my query to fill in the blank days with null values (using a left join) and that works fine.

The problem I'm having now is that when there is a single day that has a value, but the previous and successive days do not have values, the data is not rendered (it would be a single point). Bar charts would address that particular issue but are not appropriate for this chart.

Example:

Updating data values in MSChart after binding

If ranking was not measured on the 'gap' days except for 12/15, you would not know there was a value on 12/15.

So one way I believe I can address this is to replace the null values with a value equal to the lowest value in my dataset, which would then show neighborless days as spikes off of the bottom axis. At least I think this will work unless a better idea surfaces.

So my question is: how can I replace the null values with my MIN value after the chart has been bound (or can I bind the data to an intermediate control first to manipulate it and then bind the chart to that). I currently bind the chart to a stored procedure so while i suppose i could do the manipulation there, I suspect it would be much more complicated than iterating through the data set after it was created.

If this were a gridview, I could do it easily in the OnRowUpdating开发者_StackOverflow code, but I don't know of any equivalent for the chart control.

Any thoughts?

Thanks.


How about adding a marker to each point in the plot?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜