开发者

How to create a blank chart in .net 4

开发者 https://www.devze.com 2023-04-03 15:57 出处:网络
I\'ve got a working chart (ASP.NET/VB.NET), over some selected periods of time it has no data, this is expected.

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

0

精彩评论

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