1

Good evening, Right now i am working with Asp.net chart control to draw bar and line chart. here i facing one problem that i can not set chart width in percentage. And after long time searching doesn't get any feasible solution. Here i set chart width in pixel for temporary purpose

<asp:Chart ID="Chart2" runat="server" Width="960px"> 

i know that chart width can't b set in % its only in pixel but however i want that my chart width should adjust as the size of browser width. So is there a feasible solution to achieve this i am eagerly waiting for reply.

Thanks a lot in advance.

Hiren Mistry
  • 23
  • 1
  • 6

1 Answers1

0

It appears that you have two options to handle this requirment:

  1. Make use of the HttpCapabilitiesBase.ScreenPixelsWidth property : http://msdn.microsoft.com/en-us/library/system.web.configuration.httpcapabilitiesbase.screenpixelswidth(v=vs.100).aspx

  2. Use jQuery to dynamically set the width.

Community
  • 1
  • 1
landsteven
  • 814
  • 8
  • 22
  • Thanks for reply it helps me in future. but right now my chart has few values so my chart looks very small on screen , so i am looking for solution that fill my chart on screen for few values. – Hiren Mistry Apr 23 '14 at 04:31