Question

I currently have two separated servers; an internal server with a database and an external server to which clients have access. On the internal server I want to query a database and generate a number of charts based on requests made by clients. So far I can do that, generate the charts, and using the SaveImage() function export those charts as PNG images I can send to the client server.

However, I would like to also export the tooltips generated by MSChart, so when the clients view the charts (as pre-rendered PNGs) they can also view the tooltips. I'm under the impression that the MSChart control generates those tooltips as a <map><area> which is output to the page when the charts are rendered, but is it possible to have that output to, for example, a text file, so that when I call the PNG charts I can also call and output the relevant map?

Was it helpful?

Solution

YES, it is possible, albeit indirectly, with the Serializer() function

By using Chart.Serializer.Save("filename.xml"), you can export all of the details needed to recreate a chart as an XML file. This means you don't also have to use SaveImage() to export a PNG, because when you import the XML with Chart.Serializer.Load("filename.xml") in your client-side page, you will be able to re-render the chart, tooltips and all.

If it is absolutely necessary to produce a PNG file with an associated <map><area>, you may be able to export the XML (or to a a memory stream) and then process that data to reproduce the necessary HTML and save it as plain text (eg: to a database). If the client-side server has no ASP processing capabilities, this might be a necessary extra step on the server-side application.

Thanks to Chris Zeh for the lead to the MSDN article that helped me figure out this solution.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top