I've got a working chart (ASP.NET/VB.NET), over some selected periods of time it has no data, this is expected.
When I select a period of time where there is no data I get no chart displayed, just a rectangle of the background colour of the chart.
What I want is to still display the titles, x and y axes etc when there is no data,开发者_Go百科 just an empty chart.
I toyed with the idea of adding a data point outside the time scale of the chart and this worked, I then got an empty graph, but there must be a cleaner way to achieve this. Any ideas?
Thanks
Try to override or rewrite the
Chart.OnPrePaint
method then implement your custom render logic.
Reference:MSDN
精彩评论