TeeChart for NET as static image format on Azure

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Marc
Site Admin
Site Admin
Posts: 1265
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

TeeChart for NET as static image format on Azure

Post by Marc » Mon Sep 25, 2017 11:50 am

Hi, this is a short note written in response to a recent customer request and is intended to help avoid first-time problems when publishing TeeChart for NET apps on Microsoft Azure websites.

Rendering your TeeChart.NET web project to Azure is relatively straightforward:

Creating the project
Create the ASP.NET or MVC project in the way that you normally would do. There are notes here to help: Publishing with chart render style as Javascript/HTML5
If your Chart render type is Javascript/HTML5 you need take no further action, simply publish your charting application to Azure using Visual Studio's Publish option (right mouse button on the project in Solution-Explorer to show menu, then select 'Publish'). Assuming that you already have a Microsoft Azure subscription active you will be led through the steps to publish to your application space, if not you will be prompted to set up an account.

Publishing with chart render style as an image format (PNG, JPEG, etc)
Azure Websites resist the creation of a Graphics IntPtr handle. For local servers that is no problem but blocks the rendering of the Chart on Azure when exporting static images. When using a Chart on a Webform the solution is already built in but if you manage your own image export your should change TeeChart's image buffering option.

Set the buffer to none:

Code: Select all

tChart.Chart.Graphics3D.BufferStyle = Steema.TeeChart.Drawing.BufferStyle.None;
Buffering, used principally to avoid flickering on fast moving Windows housed charts, isn't a requirement when rendering a static image, so this will not adversely affect the performance of your application.

You can now publish your charting application to Azure using Visual Studio's Publish option (right mouse button on the project in Solution-Explorer to show menu, then select 'Publish'). Assuming that you already have a Microsoft Azure subscription active you will be led through the steps to publish to your application space, if not you will be prompted to set up an account.

Post Reply