0

I am new to web technologies. I added an asp.net chart to a website and it is working fine. In order to make it responsive I added bootstrap. The bootstrap behaves fine for buttons etc but not for chart. I am unable to size the chart. If I set the width and height on pixel size then it is not responsive. Is it possible to make the asp.net chart responsive using bootstrap. Or should I get a javascript charting library like highchart or googlecharts etc.thanks.

Dr. Mian
  • 3,334
  • 10
  • 45
  • 69

1 Answers1

1

I don't believe you can make the ASP.NET chart responsive. Since it generates images, but generates rendered from the server, it would have to make other sizing available and I don't think that it does out of the box. The best you can do is target a smaller size and get it to fit within the smallest available viewport you are targeting. This can be the problem with some of the ASP.NET controls.

Using a client-side framework that can render the graphics during the client side processing would be much better because you can usually then scale appropriately.

Brian Mains
  • 50,520
  • 35
  • 148
  • 257
  • Agreed but can you please suggest more reading about how to do the smallest available viewport. Any template or example from the web. Thanks. – Dr. Mian Jun 27 '15 at 23:25
  • The bootstrap container targets a minimum value of 768px I believe. So you could target that size since that is the minimum it restricts. Content at that time is normally in "flow" mode, so a screen that's 480px wide will just wrap the content, rather than stretch. So you have to figure out if your true "minimum" width is 480 px, 768px, or something else, and then size the control appropriately. – Brian Mains Jun 27 '15 at 23:28
  • I am aiming to show that asp.net chart on iphone4 onwards, and samsung S2 onwords. Any idea? – Dr. Mian Jun 27 '15 at 23:29
  • Yeah you may have to go as small as 460 or 480 px - but note I'd recommend having a device to test it on because I have run into nuances with different screen resolutions... – Brian Mains Jun 27 '15 at 23:31
  • If you use a client-side charting tool, you will probably have better varying resolution success... – Brian Mains Jun 27 '15 at 23:32
  • I have iphone 5s, 4 and s3. I am also checking it in google inspect. Ok so you mean to say that I keep the width of my page to 460px and keep my chart to 450 width. right? – Dr. Mian Jun 27 '15 at 23:34
  • any recommendations for client-side charting tool in asp.net? I will keep it as an option for my next update. Many thanks for your help. – Dr. Mian Jun 27 '15 at 23:37
  • Sure. I don't know a lot about the charting framework. I've used Kendo in the past; it's paid but is usually good. Anything SVG is OK. – Brian Mains Jun 28 '15 at 00:06