Jump to content
Software FX Community

Basic C# coding example


Aps.com

Recommended Posts

I am just attempting to us ChartFX and I would appreciated if someone would provide a basic C# coding example of creating a chart object, setting up the object with heigth, width, (whatever is required) and then rendering the object out to an html page, it can be an image if necessary I just need to drop it on the html page.

any simple example would be greatly appreciated.

Link to comment
Share on other sites

thanks for that example it help greatly.  I have another question though as I go through some of the documentation for ChartFX I see some examples that show

 Label1.Text=char1.RenderControl();

where it would appear you can assign the chart output to a label location or local variable, however when I attempt to do the same as the documented examples it raises an error.  Is it possible to assign the chart output to a variable or some other control?

Link to comment
Share on other sites

I don't know which sample you are referring to but his code is incorrect (the sample is incorrect).

RenderControl writes to an HtmlTextWriter object the output tag of the chart, so for example, if the chart is being rendered as an image, the chart will write something like this to the HtmlTextWriter:

<img src="<source for the image>"/>

Notice that the image itself is not written to the HtmlWriter, the contents of the image are kept in the server and a reference to it is put in the HTML.

For more control on where the tag is written to and the image is written to you can use the RenderToStream method. Documentation for RenderToStream as well as sample code can be found here:

http://support.softwarefx.com/onlinedoc/cfxnet70/cfxmaps/chart_rendertostream.htm

And also in the installed help files.

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...