Jump to content
Software FX Community

Basic C# coding example


Aps.com
 Share

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...