Blogs

The One With

Rich Text Editor - Adding a Chart into a Document

     

Rachel already showed you what you can do (Master-Detail Mail Merge) with a generic calculated field like DOCVARIABLE. I want to take it a bit further and show you how to create a custom field.

Would you like to embed a chart into your documents? Smile

Rich Text Document with Live Chart

Field Code:

  • CHART

Switches:

  • \c – Specifies the chart type. Supported charts are bar, pie and line. If not specified defaults to pie.
  • \l – This switch determines if the chart should display a legend.
  • \w – Specifies the chart width
  • \h – Specifies the chart height
  • \d – Comma separated data points

Example:

{CHART \c pie \w 500 \h 300 \l \d "Asia|4140336501,Africa|994527534,Europe|738523843,North America|528720588,South America|385742554,Oceania|36102071,Antarctica|3687"}

Download the source code

Cheers

Azret

Published Jun 14 2011, 04:40 PM by Azret Botash (DevExpress)
Technorati tags: XtraRichEdit, v2011.1, XtraCharts
Bookmark and Share

Comments

 

Sigurd Decroos said:

Barcode support please :).

This opens so much perspectives!

June 15, 2011 11:40 AM
 

Steven Rasmussen said:

Interesting.... Is this compatible with Microsoft Word or other word editors?  

I know that MS Word can embed charts but they're typically just an Excel object being displayed in Word.  I wasn't sure if it has it's own charting engine as well.

It looks like XtraCharts is being used somehow to produce the chart here.

-Steve

June 15, 2011 1:22 PM
 

Azret Botash (DevExpress) said:

Sigurd: Sure... give me a few hours :)

June 15, 2011 2:40 PM
 

Azret Botash (DevExpress) said:

Steven: Yeap, XtraCharts are used to generate the image

June 15, 2011 2:41 PM
More from DevExpress
Live Chat
Have a pre-sales question?
Need assistance with your evaluation?
We are here to help.
Chat is one of the many ways you can contact members of the DevExpress Team. We are available Monday-Friday between 7:30am and 4:30pm Pacific Time.
If you need additional product information, require pre-sales assistance, or want help with your order, write to us at info@devexpress.com or call us at
+1 (818) 844-3383.