186
Table of Contents Introduction INTRODUCTION ..................................................................................................................................... 3 ABOUT THIS MANUAL........................................................................................................................... 4 OBTAINING TECHNICAL SUPPORT..................................................................................................... 4 INTEGRATING CHART FX..................................................................................................................... 6 THE CHART FX SAMPLES .................................................................................................................... 9 THE CHART FX OLE SERVER ............................................................................................................ 13 CHART FX INTERNET EDITION COMPATIBILITY NOTES ............................................................... 17 Chapter 1. Chart FX Basics CREATING A CHART ........................................................................................................................... 21 SETTING PROPERTIES AT DESIGN TIME ........................................................................................ 21 SETTING PROPERTIES AT RUN TIME.... .......................................................................................... 22 OBJECT ORIENTED PROGRAMMING AND COM SUPPORT........................................................... 23 THE CHART FX WIZARDS .................................................................................................................. 24 Chapter 2. Passing Data to Chart FX INTRODUCTION ................................................................................................................................... 29 PASSING DATA USING THE API ......................................................................................... 30 UNKNOWN NUMBER OF POINTS .................................................................................................... 32 HIDDEN POINTS ........................................................................................................................... 32 CHANGING EXISTING VALUES ....................................................................................................... 33 PREVENTING SCREEN FLICKERING................................................................................................ 33 CONTROLLING THE SCROLLBAR.................................................................................................... 34 THE CHART FX DATA PROVIDERS ................................................................................................... 35 DATABINDING ...................................................................................................................................... 37 CONNECTING TO ADO RESULTSETS .............................................................................................. 40 READING DATA FROM ARRAYS........................................................................................................ 41 READING DATA FROM COLLECTIONS ............................................................................................. 43 READING DATA FROM TEXT FILES .................................................................................................. 45 Chart FX Programmer’s Guide Table of Contents

Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

Table of Contents

Introduction

INTRODUCTION.....................................................................................................................................3

ABOUT THIS MANUAL...........................................................................................................................4

OBTAINING TECHNICAL SUPPORT.....................................................................................................4

INTEGRATING CHART FX.....................................................................................................................6

THE CHART FX SAMPLES ....................................................................................................................9

THE CHART FX OLE SERVER............................................................................................................13

CHART FX INTERNET EDITION COMPATIBILITY NOTES ...............................................................17

Chapter 1. Chart FX Basics

CREATING A CHART...........................................................................................................................21

SETTING PROPERTIES AT DESIGN TIME ........................................................................................21

SETTING PROPERTIES AT RUN TIME.... ..........................................................................................22

OBJECT ORIENTED PROGRAMMING AND COM SUPPORT...........................................................23

THE CHART FX WIZARDS ..................................................................................................................24

Chapter 2. Passing Data to Chart FX

INTRODUCTION...................................................................................................................................29

PASSING DATA USING THE API ......................................................................................... 30UNKNOWN NUMBER OF POINTS ....................................................................................................32HIDDEN POINTS...........................................................................................................................32CHANGING EXISTING VALUES .......................................................................................................33PREVENTING SCREEN FLICKERING................................................................................................33CONTROLLING THE SCROLLBAR....................................................................................................34

THE CHART FX DATA PROVIDERS ...................................................................................................35

DATABINDING......................................................................................................................................37

CONNECTING TO ADO RESULTSETS ..............................................................................................40

READING DATA FROM ARRAYS........................................................................................................41

READING DATA FROM COLLECTIONS .............................................................................................43

READING DATA FROM TEXT FILES ..................................................................................................45

Chart FX Programmer’s Guide

Table of Contents

Page 2: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

Table of Contents

Chapter 3. Working with Axes

INTRODUCTION...................................................................................................................................49

THE AXIS OBJECT...............................................................................................................................50

AXIS FORMATTING .............................................................................................................................51

AXIS LABELING....................................................................................................................................52

AXIS SCROLLING ................................................................................................................................54

GRIDLINES & TICKMARKS .................................................................................................................56

Chapter 4. Working with Chart FX colors

COLOR TYPES.....................................................................................................................................61

CHANGING DEFAULT COLORS .........................................................................................................61

COLOR PALETTE.................................................................................................................................62

ASSIGNING INDIVIDUAL COLORS TO MARKERS............................................................................63

CHANGING BACKGROUND COLORS................................................................................................63

COLOR SCHEMES...............................................................................................................................64

PATTERNS ...........................................................................................................................................64

Chapter 5. Customizing chart markers

POINT SIZES & SHAPES.....................................................................................................................67

CONICAL & CYLINDRICAL SHAPES ..................................................................................................67

LINES STYLE & WIDTH .......................................................................................................................68

SEPARATING A PIE SLICE PROGRAMMATICALLY .........................................................................68

Page 3: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

Table of Contents

Chapter 6. 3D Effects

DISPLAYING THE CHART IN 3D MODE.............................................................................................71

ROTATING THE CHART PROGRAMMATICALLY ..............................................................................71

CLUSTER CHARTS..............................................................................................................................71

DEPTH & PERSPECTIVE ....................................................................................................................72

Chapter 7. Working with special chart types

XY PLOTS.............................................................................................................................................75PASSING DATA........................................................................................................................................................ 75FAQ........................................................................................................................................................................... 77HIGHLIGHTING POINTS IN A SCATTER CHART ................................................................................................... 78

MULTITYPE CHARTS ..........................................................................................................................79

MULTISTACKED CHARTS...................................................................................................................80

GANTT CHARTS ..................................................................................................................................81

FINANCIAL CHARTS............................................................................................................................84

SURFACE & CONTOUR PLOTS..........................................................................................................86

BUBBLE CHARTS ................................................................................................................................89

Chapter 8. Constant Lines & Color Stripes

CONSTANT LINES SAMPLE ...............................................................................................................93

COLOR STRIPES SAMPLE .................................................................................................................94

Chapter 9. Handling Files & Templates

THE IMPORT & EXPORT METHODS..................................................................................................97

CHART FX 3.0 FILTERS.......................................................................................................................98

TIPS & TRICKS.....................................................................................................................................99

Page 4: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

Table of Contents

Chapter 10. Capturing mouse events

DRAGGING MARKERS......................................................................................................................103

MENUS ON DEMAND ........................................................................................................................103

CUSTOMIZING DATATIPS ................................................................................................................103

CUSTOMIZING THE BALLOON.........................................................................................................104

TRACKING THE MOUSE ...................................................................................................................105

Chapter 11. Printing charts

PRINTING THE CHART .....................................................................................................................109

CONTROLLING PAPER ORIENTATION ...........................................................................................109

COLOR OR B&W PRINTING..............................................................................................................109

PRINTING SEVERAL CHARTS IN THE SAME PAGE ......................................................................110

PRINTER & DRIVER SELECTION.....................................................................................................111

Chapter 12. Customizing the Chart FX tools

THE CHART FX TOOLS. OVERVIEW ...............................................................................................115

CUSTOMIZING THE TOOLBAR.........................................................................................................116RELATION BETWEEN COMMANDS & TOOLBAROBJ OBJECT ..........................................................................118SHOWING/HIDING THE TOOLBAR.......................................................................................................................119POSITIONING THE TOOLBAR ..............................................................................................................................119REMOVING/HIDING BUTTONS IN THE TOOLBAR ..............................................................................................120CHANGING THE COMMAND FOR A TOOLBAR BUTTON ...................................................................................121ADDING BUTTONS IN THE TOOLBAR .................................................................................................................122CHANGING THE TOOLTIPS ..................................................................................................................................124CHANGING TOOLBAR ICONS ..............................................................................................................................125WORKING WITH SUBCOMMANDS.......................................................................................................................127WORKING WITH SELECTORS..............................................................................................................................128ADDING CUSTOM COMMANDS............................................................................................................................129CREATING & DISPLAYING YOUR OWN TOOLBAR.............................................................................................131

THE CHART FX DATA EDITOR.........................................................................................................133

THE PALETTEBAR.............................................................................................................................134

THE PATTERNBAR............................................................................................................................135

THE LEGEND BOX.............................................................................................................................136

THE SERIES LEGEND BOX ..............................................................................................................137

Page 5: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

Table of Contents

Chapter 13. Real-Time charts

OVERVIEW .........................................................................................................................................141

PASSING DATA IN REALTIME..........................................................................................................142

SCROLLING LEGENDS .....................................................................................................................144

Chapter 14. Open Painting Architecture

CUSTOMIZING CHART PAINTING. OVERVIEW..............................................................................147

CPI CONSTANTS ...............................................................................................................................148

PREPAINT SAMPLE...........................................................................................................................150

PAINTMARKER SAMPLE...................................................................................................................151

Chapter 15. Chart FX UI Cross Reference

GENERAL DIALOG.............................................................................................................................155

SERIES DIALOG.................................................................................................................................157

AXIS DIALOG......................................................................................................................................161AXIS SCALE DIALOG.............................................................................................................................................163AXIS LABELS DIALOG...........................................................................................................................................165AXIS GRIDLINES DIALOG .....................................................................................................................................166

3D EFFECTS DIALOG........................................................................................................................168

CONSTANT & STRIPES DIALOG......................................................................................................170

DATA/BEHAVIOR DIALOG ................................................................................................................172

COMMANDS DIALOG ........................................................................................................................174

EXTENSIONS DIALOG.......................................................................................................................175

Page 6: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

Table of Contents

Chapter 16. Annotation Objects

OVERVIEW .........................................................................................................................................179

ACTIVATING THE EXTENSION.........................................................................................................179

CREATING OBJECTS PROGRAMMATICALLY ................................................................................181

DEPLOYMENT ISSUES .....................................................................................................................183

Appendix A. Migration Issues

MIGRATING FROM CHART FX 3.0 ..................................................................................................187

CONVERTING PROJECT FILES .......................................................................................................187

OBSOLETE/REPLACED API..............................................................................................................188

Appendix B. Memory Requirements

CHART FX MEMORY REQUIREMENTS...........................................................................................193

Appendix C. Deployment Issues

DEPLOYING YOUR APPLICATION...................................................................................................197

Appendix D. Compatibility Issues

ACTIVEX OR DLL, WHICH ONE SHOULD YOU USE? ....................................................................201

CHART FX AND VISUAL C++ ............................................................................................................202

CHART FX & BORLAND PRODUCTS ...............................................................................................205

Appendix E. Licensing Issues

HOW DOES THE CHART FX LICENSING SCHEME WORKS .........................................................209

Index

Page 7: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

Chart FX Programmer’s Guide

Welcome to Chart FX

Topics covered in this section

IntroductionAbout this manual

Obtaining Technical SupportIntegrating Chart FX to your development tool

The Chart FX Samples repository

Page 8: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

3

Welcome!

Thank you for selecting Chart FX as your charting tool! You’ll find there’s no other chartingproduct capable of offering the flexibility and power that Chart FX provides. Chart FX is packedwith new features that will make your application more powerful than ever, for example:

Chart FX was developed using COM. This makes Chart FX easier to program since it exposesobjects that are readily accessible to and compatible with the notions of objects defined bymodern object-based languages and tools. COM will also ensure that the Chart FX API could beeasily called from any compiled or interpreted language without extra development and testingefforts. Chart FX exposes a complete object oriented API that is easier to understand andcompatible across all development tools, plus it takes advantage of visual developmentcapabilities provided by Visual Basic and other visual development tools.

Chart FX has been the preferred and leading charting component for developers since itsinception in 1993. With this new release, Chart FX not only presents the most powerful featureset, but again, we have done it without affecting the overall performance and speed that our userbase recognize and appreciate. The core components present the same memory footprint asprevious versions of Chart FX that makes it so easy to deploy and not affecting the memory orhardware requirements of your application.

Chart FX was designed with extensibility in mind, this allows powerful add-ons enhance thecapabilities of the product. Separately available extensions make Chart FX even more functionalthan ever. For example, we offer ChartFX Financial Edition as a Chart FX extension, a productspecifically designed for financial applications charting stock market data. Another good exampleis the royalty-free annotation extension that allows you and your users add floating objects on topof the chart.

Also, with Chart FX wizard’s you can create incredible charts in seconds, right out of the box! Thewizard guides you step-by-step through setting up your preferred chart and visual attributes–without writing a line of code.

The ChartFX User interface was also enhanced to accommodate newer operating systems, likeWindows 98, Windows NT 5.0 and Windows 2000. A great example is the palette bar where morethan a dozen color schemes are available so the user can change all the chart elements with justone click of the mouse.

Chart FX is renowned for its exhaustive selection of chart types. Now, we’ve gone even further byadding many more chart types like Bubble, Contour, Pyramid, Curved Area, Multistacked, XYLines, XY Area, Area spline and more!

Page 9: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

4

About this manual

This manual discusses some of the most commonly used features of Chart FX. It is not intendedto be an API Reference. If you want to refer to the Chart FX API, including Objects, Properties,Methods and Events, please refer to the “Chart FX API Guide” located in the \help directory. Thiselectronic help file provides detailed information, including syntax, samples and remarks aboutthe Chart FX API.

Also, this manual is based on sample code provided in Visual Basic 6.0 and using the Chart FXActiveX Control. If you are using other development tools that support OCX models you can stillrefer for information on general topics covered in this manual. Other specific samples for thedevelopment tool you are using that have been placed in the \samples directory.

Technical Support

ü Up-to-date information and product updates are always available on our web site athttp://support.softwarefx.com

ü If you want to contact a Chart FX representative mail to [email protected]

ü If you want to talk to a technical Support representative please call (561) 391-9494 Or refer toour web site for latest telephone number information.

Technical support will not be provided through our TollFree Number. However, if you require any assistance onLicensing and Marketing information you can call (800)392-4278

Please make sure you have your Chart FX serial number handy and the Chart FX ComponentModel and version you’re currently using.

Note

Page 10: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

5

On-Line Support (http://support.softwarefx.com)

In this site you'll find knowledgebase articles, sample code, documentation, product updates andother important technical support information. The site has been designed to let you search andfind information quickly and easily. And because it uses some of our web based products (likeWebBarFX), you are required to use this site using a Windows based system (Both, Netscapeand Internet Explorer are supported!).

support.sofwarefx.com is optimized for viewing with Microsoft Internet Explorer version 4.0 orNetscape Navigator Version 4.0 or later at 800x600 resolution.

We would also like to remind you that this site is restricted to registered users, so if you have notyet registered your copy of Chart FX, you can do it at http://www.softwarefx.com.

We strongly encourage you to visit this site before contacting Software FX as resolutions tocommon problems are posted on a daily basis.

Page 11: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

6

Integrating Chart FX to your development tool

Please follow the instructions provided in this section to complete the Chart FX installation foryour specific Development tool.

Visual Basic (6.0)

i) Include the Chart FX 98 ActiveX in your project as follows:

- From the Project menu select Components...- Choose Chart FX 98 Control from the Controls list.

ii) Include the Chart FX header file (CFXOCX.BAS) as follows:

- From the Project menu select Add Module- Select CFXOCX.BAS located under ChartFX 98\Include from the Existing modules.

Borland Delphi (4.0) and Borland C++ Builder (4.0)

Chart FX v2.0 is OEM with Borland Delphi and Borland C++ Builder,you must uninstall the existing version before proceeding.

i) Remove previous version of Chart FX from your component library as follows:

- From the File menu select Close All- Form the Component menu select Install Packages…- Select the package called: Borland Sample Imported ActiveX Controls- Press Remove. Answer Yes upon confirmation.- Press OK

ii) Import new Chart FX 98 component as follows:

- Form the Component menu select Import ActiveX Control…- Select Chart FX 98 Control (Version 4.0) from the list- Press Install... Answer Yes upon confirmation- Select Into new package- Type CFX98AX.DPK as the File name- Type Chart FX 98 ActiveX as the Description- Press OK. Answer Yes upon confirmation.- Save changes.

Note: See appendix D for other integration issues.

MS Access (97)

i) Add Chart FX 98 ActiveX control to your form or report as follows:

- Open your form/report for design- From the Insert menu select ActiveX Control…- Resize the control to the desired size

Note

Page 12: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

7

Visual C++ (6.0)

You can include Chart FX 98 ActiveX in a dialog template from the Resource Editor as follows:

- Right-click inside the dialog and select Insert ActiveX Control…- Choose Chart FX 98 Control from the ActiveX control list- Press OK- Resize the control to the desired size

For other ways of including Chart FX 98 into your VC++ project, see appendix D.

Visual FoxPro (6.0)

i) Include the Chart FX 98 ActiveX in your form as follows:

- Insert an ActiveX Control (OleControl) in your form- Select Insert Control- Select Chart FX 98 Control from the Control Type list- Press OK- Resize the control to the desired size

- Select ChartFX Control from the Control Type list-box.- Hit OK.- Right-click on the chart and select Properties... to change chart attributes.

ii) Include the Chart FX header file in your form as follows:

- From the Form menu select Include File...- Select CFXOCX.PRG from your ChartFX 98\Include subdirectory- Add the following line at your form initialization:

SET PROCEDURE TO <ChartFX 98 Path>\INCLUDE\CFXOCX ADDITIVE

Other Tools

Follow the instructions provided by the manufacturer on how to include third party components.

Page 13: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

9

Chart FX Samples

Chart FX provides a myriad of samples that you can use as a reference when trying to use aspecific feature provided by this product. These samples will help you get started and they areincluded in the \samples directory. They were also developed using different development tools.

If you don’t find samples in your specific development tools,please refer to our support site (http://support.softwarefx.com)as we post additional samples that were not included in thepackage)

The following sample projects are included with Chart FX:

Colors. Introduces you to assigning colors to different chart elements.

Constants & Color Stripes. Introduces you to the API required to create and handle theseelements in the chart area.

Data Aware. Introduces you to using the Chart FX Data provider to read datafrom Arrays, collections and other sources.

Data Binding. Describes how to connect Chart FX to a ADO Data Control.Provided for Visual Basic only.

Gridlines. Introduces you to Gridlines and its different settings.

Import & Export. Introduces you to save and retrieve chart files and templates.

Labels. Describes how to assign labels to axis and markers in the chart.

Mouse. Introduces you to the different mouse related properties andevents.

Palette & Pattern. Describes and shows how to use the Chart FX Palette andPatterns.

Passing Data. Shows how you can pass data to special chart types like bubblecharts, financial charts and others.

Printing. Shows how you can use properties and methods related toprinting the charts.

RealTime. Shows how you can create realtime charts using a timer event.

Scroll. Introduces you to the scrolling capabilities of Chart FX whenhandling a large number of points.

Zoom. Shows how you can use Zoom In/Out related properties andmethods to call out special regions of the chart.

Stacked. Shows how you can create multistacked charts, where someseries are grouped and stacked accordingly.

Note

Page 14: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

10

Surface & Contour. Shows how you can pass data and assign labels to Surface andContour charts.

User Interface. Shows how you can customize the Chart FX user interface andthe way Chart FX reacts to user interaction.

XY Plots. Shows how you can pass data and display XY plots.

Page 15: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

11

Chart FX Programmer’s Guide

The Chart FX OLE Server

Topics covered in this section

Introduction

Page 16: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

13

The Chart FX OLE Server Component

Perhaps one the biggest issues faced by end users is how to take a chart that is displayed in acustom application or internet site and use it in another productivity tool such as Word, Excel andPowerPoint.

The problem is that in most cases they will be able to "export" charts as an image (Bitmap, gif,etc) which imposes major limitations when it comes to modifying the chart inside the Productivitytool.

You'll be happy to know Chart FX provides an OLE Server that allows users to display interactivecharts inside any productivity tool that works as an OLE Container. This allows users to exportcharts directly from the Chart FX 98 Toolbar and paste them into any application and continueworking with the chart as if they were included in the application.

Just imagine, while using your application, users will copy and transfer charts to any productivityapplication. Once the charts have been pasted they can still change chart attributes within theproductivity tool, the possibilities are endless!

Page 17: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

14

The Chart FX 98 OLE Server Object is a component that when added to an application that usesChart FX 98, allows your program to export active charts to desktop applications such as (but not

limited to) MS Word, MS Excel, MS PowerPoint. etc.

This component can be used in three ways:

• Through the clipboard: You can export a chart to the clipboard as an OLE Object using thetoolbar or the Export method. Then it can be pasted into any Desktop application (OLEContainer).

• Through a file: You can save the chart into a file using the toolbar or the Export method(.CHD). This file can be inserted into any OLE Document by doing: "Insert Object ..." andselecting "Create from File" or by dragging the file to a Drag-and-drop enabled container.

• By using automation, and doing these operation from your own code using the container'sAPI.

Once the Chart FX Object is inserted into a document the user can interact with it: changeproperties, save it, e-mail it, print it, etc. as depicted in the following picture:

In order for the OLE Object to be exported and viewed properly you need to have CFX4OLE.DLLregistered in your computer.

The Chart FX 98 OLE Server is not royalty free fordistribution.For redistribution rights please refer to the Chart FX 98License Agreement, or contact Software FX at (800) 392-4278 prior to redistributing this component to your users.

You can also refer to our web site at http://www.softwarefx.com/chartfx/oleserver

Note

Page 18: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

15

Chart FX Programmer’s Guide

Chart FX Internet Edition

Topics covered in this section

Compatibility Notes

Page 19: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

17

Chart FX Internet Edition Compatibility Notes

- If you bought Chart FX Internet Edition read this carefully, if not please disregard this page -

Because Chart FX Internet Edition shares the same API as Chart FX we include this manual aspart of the Chart FX Internet Edition package. We do this so you can have documentation aboutthe objects, properties and methods you can use in your ASP scripts. However, some of thetopics or API calls covered in this manual do not apply to Chart FX Internet Edition and thereforemust not be used with that product.

As a rule of thumb, you should avoid using any API that require client-side scripting or code thatmust be present at the browser level. In other words, properties or methods that are not usedinside the ASP will not work in some browsers and you will lose the Chart FX Internet Editionbrowser independence capability.

For example, Chart FX provides events that you can capture to alter or customize the way ChartFX respond to user interaction. These events are fired at the browser level and will require you tohave client-side VB scripting on your HTML pages. Although this will work on Internet Explorerbrowsers, it will not work on Netscape browsers, so if you rely on browser independence youshould stay away from processing events when using Chart FX Internet Edition.

In most cases, Chart FX Internet Edition provides alternative ways of providing this functionality.These have been documented in the Chart FX Internet Edition manual.

About Chart FX constant definitions

Throughout this manual we refer to constants you must use with the different properties objectsand methods the Chart FX API provides. When using Chart FX Internet Edition, you must beaware that these constants are defined in a separate include file that you must use with your ASPpages. If you fail to include this file, you will not be able to reference these constants and yourASP scripts will be cryptic and difficult to maintain. You can include this file in the header of yourasp pages as follows:

<!-- Include this file so we can use all the ChartFX constants --><!-- #include virtual="/Include/CfxIE.inc" -->

Page 20: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

19

Chart FX Programmer’s Guide

Chart FX Basics

Topics covered in this section

Creating a ChartObject Oriented Programming and COM Support

The Chart FX Wizards

Page 21: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

21

Creating a chart

In order to create a chart with Chart FX you must have the control properly registered in yourdevelopment system (Registry).

Because Chart FX is supported by a variety of tools, you must refer to your development toolmanual (or help files) for support on ActiveX Controls. If you’re using the Chart FX DLLcomponent, please refer to the DLL section later in this manual. You may also refer to “IntegratingChart FX to your development tool” chapter in previous pages of this manual.

In most visual development tools, however, the process of creating a chart is just as simple asselecting the Chart FX Icon in the application’s toolbox and drawing the bounding rectanglecontaining the chart. After that, Chart FX will create a sample 3D bar chart with random datavalues so you can actually start customizing how the chart looks. After you are satisfied how thechart looks you can populate it with real data values.

The Chart’s Name

When you create a chart, by default Chart FX will name it as ChartFX1, ChartFX2, etc. You canalways change these names by modifying the “Name” property in the property list when theappropriate chart is selectedThis name is really important because it is a unique identifier that will allow you to controlproperties for the different charts you have created (usually when setting properties at run time).

Setting Properties at Design Time.

Whenever you include a chart in yourapplication or web page, you want thatchart to provide information (data) withcertain characteristics or visualattributes. You can achieve this byhandling properties and methodssupported by the component. Chart FXis no exception to this rule.

Chart FX provides property pages thatallow visual access to the API. In ChartFX you may right click the chart andselect “Properties” to access theProperty pages or use the properties listto set different visual attributes to thechart.

Setting properties at design time is convenient, fast and easy plus it will reduce the coding timeand efforts dramatically. Most of Chart FX visual attributes can be changed at design time.

Page 22: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

22

However, some properties are not available at design time since they are inherently run-timeproperties that depend on the data displayed by the chart at a particular time in your applicationexecution. Therefore, you may be required to set additional properties at run time, depending onwhat you want to achieve.

In any case, we strongly recommend you carefully review the API provided by Chart FX as it maycontain important objects, properties, methods and events you may want to use in yourapplication.

Setting properties at run time

Setting properties at design time is a convenient and easy way to customize charts. Sometimes,however, you want or you are forced to change things programmatically and Chart FX offers awide range of Objects, Methods & Properties you can use to change visual attributes or evennumeric data when the application is actually running.

Most Chart FX properties are available at “Design Time”. However, some of them are availableonly at run time because they are dependent on the data stored in the chart at a particular time inyour application execution.

As mentioned in previous pages, in order to set properties at run time, you will need the chart’sunique identifier (or Name) the property name, property indexes and property settings.

The property indexes and settings are constants defined (Hex or Integer Numbers) by Chart FXthat you should always use as specified in the documentation of the specific property you’reusing. In some development tools, you will need an external include file that contains theseconstant definitions. You may find it in the /include directory of the Chart FX Installation directory.

If your development tool or platform does not supportexternal include files, you still may use the Hex orInteger values associated with those constants whensetting properties at run time. The Chart FX Help filedoes provide these numbers or you may locate them inAppendix A of this manual.

Some properties may require indexes and settings while others may take only settings. In anycase, you should follow the specifications provided in the help file for the property you want towork with.

OO Programming & COM Support

Note

Page 23: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

23

Chart FX 98 goes one step further as it is based completely on COM (Component Object Model)and its API exposes "objects" that are easier to access and to program. While other ActiveXcontrols provide properties and methods that are difficult to recognize and deal with, Chart FX 98provides a very accessible API that will allow you to accelerate the development process andreduce the learning curve dramatically.

Chart FX 98 exposes objects representing each element of the chart (like axis, series, toolbar,etc.) that you can easily recognize and each of these objects provide properties and methodsrelated to it. For example, If you want to change the color of a particular series, you'll access theSeries object and the Color property for that object, as follows:

ChartFX1.Series(0).Color = RGB(128,255,0)

When used in conjunction with certaindevelopment tools (e.g. Visual Basic), ChartFX 98 complies with the statement builderwhich will make the API even moreaccessible as properties and methods relatedto a particular object will be exposed as youtype the statement in the VB editor asdepicted in figure shown.

Chart FX 98 is also able to provide additional services without compromising the performance ofyour application. For example, Annotation objects support is provided as a COM interface whichallows you to decide if you want to deploy this service or not. This capability is extremelyimportant for Chart FX 98 as it will not affect the performance of your application with servicesyou don't ultimately want as part of your application.

Chart FX 98 can extend its capabilities and features without changing the core component. Forexample, Software FX offers Chart FX Financial Edition for Financial charting that you can use bysimply installing an additional COM interface, at that point Chart FX 98 detects its presence andmakes it available for special financial charts.

Many developers have asked about the possibility of adding chart types or special features inChart FX that are not commercially viable –or features that very few people will take advantageof-, this usually represents technical problems as it is practically impossible and very costly tomaintain different versions of a commercial product like Chart FX.

With the help of COM, Chart FX 98 now allows the possibility of adding specific functionalitywithout changing the Chart FX 98 core files. If you're interested in a specific feature or chart typenot currently supported by Chart FX, please contact us at [email protected].

Wizards: Making it easier to configure the chart.

Page 24: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

24

As an added feature for developers, Chart FX 98 provides wizards that allow you to easilycustomize general settings in the chart without additional programming efforts. When you createa chart the Chart FX 98 Wizard Manager will automatically pop-up presenting the differentwizards available in Chart FX 98. You may run a wizard or cancel to continue with yourdevelopment.

The wizards are usually self-explanatory and walk you through a series of steps (in the form ofdialog boxes) in order to accomplish a complex task in Chart FX 98, without the need ofreferencing the Chart FX 98 API.

The Chart FX 98 Wizard Manager looks like:

For example, the “Chart Appearance Wizard” lets you set up different charts and looks withoutwriting one single line of code.

Disabling/Enabling Chart FX Wizards.

You may disable wizards by disabling the “Show this dialog when a chart is created” checkbox,when this is done, the wizard manager will not pop-up automatically and if you want to access thewizards again, you must right-click the chart and select the “Wizards” option. At this point youmay choose if you want to enable the wizard manager at chart creation time or just run aparticular wizard.

Page 25: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

25

Wizards as an educational tool.

After running a particularwizard a final dialog will bepresented with the propertiesand methods from the ChartFX 98 API used by the wizardto achieve the desired effect.

Although the code presentedhas already been set to thechart, you can use it as aneducational tool or paste it inyour code to achieve thesame effect , for example,when a user presses a button.

Page 26: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

27

Chart FX Programmer’s Guide

Passing Data to Chart FX

Topics covered in this section

IntroductionPassing Data Using the API

The Chart FX Data ProvidersData Binding (ADO)

Reading Data from ArraysReading Data from Collections

Reading Data from Text Files

Page 27: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

29

Passing Data to Chart FX 98.

One of the greatest improvements in Chart FX 98 is the ability to read or pass data from anysource, including data controls, text files, arrays, collections and through the API provided byChart FX.

An interesting point to mention is that all the code required to read data from these sources hasbeen isolated in an additional COM interface (or Cfx4Data.DLL) allowing Software FX and third-party developers to easily build additional "Chart FX 98 Data Providers".

Although this requires an additional DLL to be deployed as part of your application, it allows ChartFX 98 to provide easy integration of new data sources. For example, Software FX is currentlybuilding a Data provider that allows Chart FX 98 to read data from popular grid controls fromthird-party vendors.

In Chart FX 98 there's no need to loop through data points to populate the charts, if you have apreviously filled data array, just pass it to Chart FX and have the chart filled with data with as littleas one line of code. Or if you drop an ADO Data control in your form just set a property in ChartFX 98 that will allow the chart to take information from the data control directly.

The following topics are covered in this section:

Passing Data using the ChartFX API

Understanding & Integrating a Chart FX 98 Data Provider

Databinding (ADO and OleDB)

Passing Data from Arrays

Passing Data from Collections

Reading Data from Text files

Page 28: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

30

Passing Data using the Chart FX API

Passing numeric values using the Chart FX API is as simple as opening a communicationchannel using the OpenDataEX Method, setting the values and then closing the communicationchannel using the CloseData Method. If your development tool does not support pointer passing,Chart FX will require point by point passing using the API through any loop command (while, for,etc.) supported in your development environment.

In this section will explain how to pass numericalinformation to Chart FX, if you want to set legends andother text information to the chart, please refer to laterchapters in this help file.

This section also describes how to pass information to the majority of chart types provided byChart FX. If you're creating special chart types, such as financial, scatter and other, please referto later chapters in this document, as additional properties need to be set to create these chartsappropriately.

Passing Data using the ValueEX property

Sometimes the easiest or most convenient way to pass numerical data to Chart FX is to use theValueEX property which allows you to set the numerical value for a point in a particular series inthe chart. If you want to set points to the entire chart, you can loop through the points and use theValueEX property as follows:

‘Open the communication channelChartFX1.OpenDataEX COD_VALUES,2,6For (i=0 to 1)

For (j=0 to 5)‘Assign the values to the series selectedChartFX1.ValueEX(i,j) = Rnd * 100

Next jNext i‘Close the communication channelChartFX1.CloseData COD_VALUES

Note

Page 29: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

31

Passing Data Using the Series Object

Also, Chart FX provides a Series object which allows you to set everything related to the series ofthe chart including data, legends and visual attributes like colors, chart types among others. Tointroduce data in the chart you need to use the YValue property of the selected series.Sometimes working with the Series object is more convenient as your code will be easier todebug.

For example, if you need to create a chart with 2 series and 6 points. (Assuming the data israndom for each series.)

‘Open the communication channelChartFX1.OpenDataEX COD_VALUES,2,6For (i=0 to 1)

For (j=0 to 5)‘Assign the values to the series selectedChartFX1.Series(i).YValue(j) = Rnd * 100

Next jNext I‘Close the communication channelChartFX1.CloseData COD_VALUES

Frequently asked questions:

What if I don't know the total number of points?

How do I feed hidden or invisible points?

Once the chart contains data, how do I change existing values?

When I change values at realtime, will the chart produce screen flickering?

How can I control scrolling?

Page 30: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

32

Unknown Number of Points (Passing Data)

You probably noticed in the previous sample that we opened the communications channel with aknown number of points. However, knowing the number of points that are to be feed to the chartsometimes is not possible and you'll end up in a situation where you don't know how to set thethird parameter in the OpendataEX Method.

For example, if you’re retrieving values from a database according to end users requests it will beimpractical to fetch all records and count them just to know the value Chart FX needs to open thecommunications channel.

The OpenDataEx method supports a setting called COD_UNKNOWN which will force Chart FX toallocate memory dynamically as you pass numeric values to it. The following code shows youhow to use the COD_UNKNOWN setting appropriately:

ChartFX1.OpenDataEx COD_VALUES, 1, COD_UNKNOWNj=0While Fetching Records

ChartFX1.Series(0).YValue(j) = Field1j=j+1

NextChartFX1.CloseData COD_VALUES

Note: Please notice that COD_UNKNOWN is valid only for an unknown number of points. Thenumber of series in the chart must be preset when calling the OpendataEX method.

Hidden Points (Passing Data)

Another interesting feature of Chart FX isthe ability to create hidden points in thechart. Although Chart FX forces the sameamount of points per series, you mayspecify hidden points to create the illusion ofsome invisible points in the chart.

All you need to do to create hidden point is to assign the CHART_HIDDEN constant when usingthe YValue or ValueEX Property to assign the numeric value to a point.

ChartFX1.Series(2).YValue(3) = CHART_HIDDEN

Page 31: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

33

Changing Existing Values in the Chart (Passing Data)

If you already populated the chart and all you want is change individual values, you may do sowithout sending all the data again. The OpenDataEx Method supports a setting calledCOD_UNCHANGE that will cause the data memory to remain intact, yet allowing you to changevalues in the chart.

For example, if you want to change programmatically the numeric value for point No. 4 in theThird Series your code should look like:

ChartFX1.OpenDataEX COD_VALUES, COD_UNCHANGE, COD_UNCHANGEChartFX1.ValueEx(2,3) = 560ChartFX1.CloseData COD_VALUES

Preventing screen flickering (Passing Data)

Some applications need the charts to be updated constantly, because of a change in the datacontained in the chart or because new data needs to be plotted. Some samples are: StockMarket, Medical and Industrial charts.

When the data is updated or added constantly, we call it a real-time Chart. These charts usespecial routines to avoid screen flickering when repainting the chart on screen.

A real-time chart is created and handle the same way as any other chart, except how you passdata to it.

If you are just changing existing values in a chart on a real-time basis, you can use theCOD_SMOOTH constant in the CloseData method. This constant will enable Chart FX to repaintthe chart using a BitBlitz technique that will prevent a screen flickering when updating the chart.For example, if you are using a timer to change existing values in a chart on a real-time basis,you can write the following code in the timer event to change an existing value in the chart andrepaint the chart smoothly once the value is changed:

ChartFX1.OpenDataEX COD_VALUES, COD_UNCHANGE, COD_UNCHANGE‘Generate a random Value between 0-100ChartFX1.Series(2).YValue(3) = Rnd * 100ChartFX1.CloseData COD_VALUES Or COD_SMOOTH

Please note the COD_SMOOTH constant in the CloseData method and how it has been includedwith a bitwise OR with the COD_VALUES constant.

The COD_SMOOTH constant in the CloseData Method actually forces Chart FX to use a BitBlitztechnique when repainting the chart. If you always want to enable this feature, you may do so byusing the TypeEx property, as follows:

ChartFX1.TypeEx = ChartFX1.TypeEx Or CTE_SMOOTH

If on the other hand you are adding new values to the chart, you’ll need to use specialproperties and constants to make the chart scroll automatically when new points areadded to the chart. So, Please refer to "Real-time charts" chapter later in this help file formore information on scrolling real-time charts.

Scroll Bar Controlling (Passing Data)

Page 32: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

34

Question #1: How can I force Chart FX to display all points in one screen (No scroll bar)?

Although there’s not available space, you can force Chart FX to get rid off the scroll bar, byhandling the Scrollable property as follows:

ChartFX1.Scrollable = FALSE

Or you could use the PixPerUnit property of the Axis object to set the number of pixels per unit inthe selected axis as zero, thus eliminating the scrollbar. For example:

ChartFX1.Axis(AXIS_X).PixPerUnit = 0

Question #2: If I add more points to an existent chart how can I position the scroll bar atthe end to see the last data point?

Chart FX provides the Scroll Method which will allow you to control the scroll bar position, sowhen you add new points to the chart the latest data entered will be visible. For example, if youwant to position the scroll at the end of the chart your code should look like:

ChartFX1.Scroll 7,0

Important Note: BAR and CURVE charts do not scroll immediately they need you to UPDATE thescroll position by calling the Scroll method twice.

Question #3: How can I specify how many points I see per screen?

For this purpose, ChartFX 98 provides a property called PixPerUnit that gives you the ability tocontrol how many pixels each tick mark takes in an axis. This way, you can easily control howmany points you'll see per screen and if the chart is scrollable or not. However, because thePixPerUnit property should be set according to the scale in the axis, sometimes it is difficult tocalculate and set the appropriate PixPerUnit value to achieve the desired result. Therefore, ChartFX provides a method called SetScrollView that allows you to easily specify the amount of pointsyou want to see per screen by giving easy-to-understand parameters, this method will set theappropriate PixPerUnit.

Question #4: How can I synchronize scrolling in two or more charts?

Whenever the end user scrolls a chart an event called UserScroll will be posted to yourapplication with information on where the scroll is positioned. You can use this information to setthe scroll bar position using the Scroll method for the rest of the charts.

Chart FX 98 Data Providers

Page 33: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

35

Chart FX 98 was designed with extensibility in mind. The perfect example is the ChartFX 98extensions where Software FX or third party developers may add functional modules to theproduct without affecting the core.

Introducing the Chart FX 98 Data Providers.

Another interesting area where Chart FX can be extendedis the Chart FX Data providers. Many developers asked usto make ChartFX capable of retrieving data from previouslyfilled arrays without the need of looping through the arrays.Other asked about the possibility of reading data fromcollections and many asked about the possibility ofinterfacing ChartFX with popular grid controls from thirdparty vendors.

As you can imagine, there are many sources where a chart can take information from. It will beimpossible for Software FX to modify the Chart FX source code so it can read information from allthese sources and other proprietary sources developers may have.

Therefore, Chart FX 98 was designed with extensibility in mind where a Data Provider is a COMinterface that knows how to read information from the data source and knows how to make thisdata available in a comprehensive format for Chart FX. Think of it as a bridge between your datasource and Chart FX 98.

The Chart FX Default Data Provider (Cfx4Data.DLL)

When you install ChartFX 98 a Default Data provider will also be installed. This data providerallows you to read information from arrays, collections, text files and databases (using ADO andOleDB). In the following pages we will show you how you can use this data provider to readinformation and populate the chart from any of these sources.

How to integrate Cfx4Data.dll and other Data providers in your project?

Because data providers are COM interfaces you can integrate them to your project and createobjects with references included in the COM interface, as depicted in the following figure:

Page 34: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

36

The Default ChartFX 98 Data provider can be integrated into your project by selecting the DataProvider Type Library. From the project references

By including this reference as part of your VB project, you can create objects supported by thedata provider and use properties the data provider exposes depending on the data source to beread. Please refer to later topics in this section for more information on how to use theCfx4Data.dll objects with different data sources.

In other development tools, you may need to create the objects using the CreateObject functionwith the progID of the data provider you are using.

Bridging the gap between Chart FX and the Data Provider

We mentioned that the data provider exposes properties that allows you to read information froma particular data source. For example, if you use the object that allows you to read informationfrom text files, the object exposes a property called File, that you can set to the path and filenameof where to take information from.

Once the Data Provider is in possession of the data; you need a mechanism that allows ChartFXto read the information from the data provider. This mechanism is a property supported by ChartFX called GetExternalData that allows Chart FX to read the numerical data the data providercontains.

In the following pages we will show you how to use the default data provider in Chart FX(Cfx4Data.dll) to read information from arrays, collections, text files and databases.

Databinding with Data Controls

Microsoft ADO Data Control 6.0 (Visual Basic 6.0)

In most cases, You'll want populate the chart with information coming from a database. ChartFX98 supports databinding with all data controls supported in Visual Basic 6.0.

Page 35: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

37

Important Note:

It is important to mention that databinding is provided through the ChartFX 98 Default Dataprovider, so if you use databound charts you must be careful when you deploy your application asadditional files and registration processes will be required to properly run your application on theclient's machine.

Once you have setup the ADO Control on your form (please refer to VB documentation), You canset the AdoSource Property in the Chart FX 98 with the name of the appropriate ADO Control, asdepicted in the following figure:

Figure 1. Once you have setup the data controls parameters, click the chart and select the data control'sname in the AdoSource Property

Important Note:If you are using VB 5.0 or below, or the Data Control you're using is not the "Microsoft ADO DataControl 6.0 (OleDB)", the property you must use to bind ChartFX to the data control isDataSource and not AdoSource.

The way Chart FX interprets the SQL Statement.

Chart FX will apply default rules to construct the chart when linked to a Data control. These rulesare somehow intelligent in picking the information from the database and assign the legends to it,so if you send a SELECT statement, Chart FX will create the chart series and point legendsautomatically. These rules are:

• Series Legends will be taken from the numerical field names

Page 36: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

38

• All numerical columns will be plotted as different series and all string and/or date columnswill be plotted as point legends (joined by the ‘-’ character).

• All string and numerical fields specified in the SELECT statement will be plot.

How to change the default behavior for databound charts?

To change the data binding default behavior Chart FX contains properties that allow you tochange this method of plotting the data values. These properties are only available and can beset at run time.

DataStyle Property

When having different string or date fields Chart FX will construct a long string with every stringand date field to assign to every legend point in the chart. If you want to avoid this behavior justturn OFF the appropriate constants using the DataStyle property. For example, if you want toforce Chart FX not to use field names as series legends and use date fields as point legends, youshould use the DataStyle property as follows:

ChartFX1.DataStyle = CHART_DS_USEDATEASLEG And Not CHART_DS_SERLEGEND

DataType Property:

Array property indicates the type of every field in the SELECT statement.

This property is very useful when you want to control how Chart FX retrieves and display theinformation from the database. For example in a 5 field SELECT statement such as:

"Select year,sales,projected, returns, name from PRODSALES where prodid = 1234"

The default behavior is that Chart FX will plot the year as another series since it is a number fieldand therefore it will be placed in the chart. Now, if the chart you want to make is one with the xaxis containing the year and plot the sales and projected sales in a different series without usingthe return and name fields you will fill the DataType array as follows:

‘ 1st we have to convert year field in a string to be selected as a xaxis legend.ChartFX1.DataType(0) = CDT_LABEL‘Then assigned the CDT_NUMBER constant to the numeric fieldsChartFX1.DataType(1) = CDT_VALUEChartFX1.DataType(2) = CDT_VALUE‘Finally, assign CDT_NOTUSED to those fields we don’t want to plot.ChartFX1.DataType(3) = CDT_NOTUSEDChartFX1.DataType(4) = CDT_NOTUSED

Important Note:The DataStyle and Datatype properties must be set before assigning the ADO resultset to thedata control. If you created the SQL Statement at design-time, these properties must be set in theForm_Load event.

Page 37: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

39

Connecting to ADO resultsets

Some developers do not use data controls to connect to databases but create the ADOconnection and resultsets directly in code. For these people, the Chart FX Data provider supportsa property called "ResultSet" which will read the information from an ADO resultset.Because the Ado connectivity is provided through the Chart FX Default data provider, you mustalso create the appropriate objects and instantiate the data provider in the code.

For example, the following code creates an Ado resultset and assigns it to a chart:

Page 38: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

40

'Create variables for ADO Connection and ResultsetDim Conn As New ADODB.ConnectionDim RS As ADODB.Recordset

'Create variable to hold the Chart FX Default Data providerDim CfxData As Object

'Open the DSNConn.Open "CfxData"

'Execute SQL and obtain resultsetSet RS = Conn.Execute("SELECT * FROM Types")

'Create Ado object from the Chart FX ResultsetSet CfxData = CreateObject("CfxData.Ado")

'Assign the resultset to the ChartFX Data ProviderCfxData.ResultSet = RS

'Let Chart FX take information from the data providerChartFX1.GetExternalData CfxData

Important Note:Please refer to previous pages for more information on how Chart FX Interprets the SQLstatement and the way you can change this behavior by using the DataType and DataStyleproperties.

Connecting to BDE Cursors

If you are using a Borland Tool (Delphi, C++ Builder) you are probably working with a BDEcompatible database.

Chart FX 98 is able to read data from a BDE cursor using the GetExternalData method asfollows:

ChartFX1.GetExternalData("CfxData.BDE",LongInt(hCursor));

Important Note: The hCursor can be obtained from a TBDEDataSet.Handle

Reading Data from Arrays

In many situations, the data to populate is contained in a memory array. Although you can usethe ChartFX API to loop through array elements, read and populate the chart, you can letChartFX handle that job.

This feature is supported by the ChartFX default Data provider (Cfx4Data.DLL) and all you needis to reference an object and the GetExternalData property in ChartFX as follows:

Reading Data from Arrays (Using Project References)

Page 39: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

41

If you are using Visual Basic is easier to include the Chart FX Data provider as a reference inyour project and create an array object. By doing this, the object will expose all propertiescontained and your code will be easier to read, maintain and debug. In order to include the ChartFX Data provider as a reference, you select the Project - References menu option and check theCfxData Type Library, as depicted in the following figure:

Once the CfxData Type library has been referenced in your project you can use the followingcode to pass a previously filled array to Chart FX :

'Create the Chart FX Data provider arrayDim CfxArray As CfxDataArray

'nValues and nLegend are previously filled arraysDim nValues(10) As IntegerDim nLegend(10) As Variant

'Add the nValues and nLegend arrays to the data providerCfxArray.AddArray nValuesCfxArray.AddArray nLegend

'Let Chart FX take the information from the data providerChartFX1.GetExternalData CfxArray

Please note that you can pass arrays filled with Numerical Data and String or Dates that will betaken as legends in the chart. In this particular sample there are 2 arrays, one containing thenumerical data to be contained in the chart and the other containing legends for each point in thenValues array. If you were to pass an additional numerical array (e.g nValues2) ChartFX willcreate a chart with two series. This means, there's no limitation as to the amount of arrays youcan pass using this technique.

However, you can not pass multidimensional arrays to Chart FX. This means, if you createa matrix or a multidimensional array as nData(10,10) Chart FX will not know how toprocess this information. An error will occur.

Rading Data from Arrays (Using CreateObject)

Page 40: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

42

If you instead want to use the CreateObject function to reference the ChartFX Data Provider youmay do it by using the progId of the Chart FX Data provider as follows:

'Create a variable to contain the Chart FX Data providerDim CfxArray As Object'nValues and nLegend are previously filled arraysDim nValues(10) As IntegerDim nLegend(10) As Variant'Use the CreateObject function to reference the Chart FX Data ProviderSet CfxArray = CreateObject("CfxData.Array")

'Add the nValues and nLegend arrays to the data providerCfxArray.AddArray nValuesCfxArray.AddArray nLegend

'Let Chart FX take the information from the data providerChartFX1.GetExternalData CfxArray

Reading Data from Collections

Collections provide a more powerful way to store data as they don't have a fixed size (efficientmemory handling) and can grow accordingly (flexibility). Many developers use collections insteadof arrays as it is a more flexible and efficient way to handle data. The ChartFX default Dataprovider can also read information from VB collections exactly the same way reading data fromarrays is supported. Please refer to the VB documentation for more information on how to handlecollections in VB.This feature is supported by the ChartFX default Data provider (Cfx4Data.DLL) and all you needis to reference an object and the GetExternalData property in ChartFX as follows:

Reading Data from Collections (Using Project References)

Page 41: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

43

If you are using Visual Basic is easier to include the Chart FX Data provider as a reference inyour project and create an array object. By doing this, the object will expose all propertiescontained and your code will be easier to read, maintain and debug. In order to include the ChartFX Data provider as a reference, you select the Project - References menu option and check theCfxData Type Library, as depicted in the following figure: Once the CfxData Type library has been referenced in your project you can use the followingcode to pass a previously filled collection to Chart FX :

'Create the Chart FX Data provider arrayDim CfxArray As CfxDataArray'nValues and nLegend are previously filled collectionsDim nValues As New CollectionDim nLegend As New Collection'Add the nValues and nLegend arrays to the data providerCfxArray.AddArray nValuesCfxArray.AddArray nLegend'Let Chart FX take the information from the data providerChartFX1.GetExternalData CfxArray

Page 42: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

44

Please note that you can pass collections filled with Numerical Data and String or Dates that willbe taken as legends in the chart. In this particular sample there are 2 collections, one containingthe numerical data to be contained in the chart and the other containing legends for each point inthe nValues collection. If you were to pass an additional numerical collection (e.g nValues2)ChartFX will create a chart with two series. This means, there's no limitation as to the amount ofcollections you can pass using this technique.

Reading Data from Collections (Using CreateObject)

If you instead want to use the CreateObject function to reference the ChartFX Data Provider youmay do it by using the progId of the Chart FX Data provider as follows:

'Create a variable to contain the Chart FX Data providerDim CfxArray As Object'nValues and nLegend are previously filled arraysDim nValues As New CollectionDim nLegend As New Collection'Use the CreateObject function to reference the Chart FX Data ProviderSet CfxArray = CreateObject("CfxData.Array")

'Add the nValues and nLegend arrays to the data providerCfxArray.AddArray nValuesCfxArray.AddArray nLegend

'Let Chart FX take the information from the data providerChartFX1.GetExternalData CfxArray

Because collections are of Variant Type, Chart FX will use the first element in the collection todetermine the data type stored in it. For example if you add the following elements to yourcollection:

Dim Col As New CollectionCol.Add 10.5Col.Add 12.4Col.Add "January"Col.Add "February"

Chart FX will use this collection as numerical values (series) and the third and fourth element willbe considered hidden points in that series.

Important Note:

The order you use to add the collections to the data provider is really important as you can usethe DataType property to instruct Chart FX to manipulate the collections differently. For example,you can use the DataType property to instruct Chart FX to use a particular numerical collection aslegends in the chart.

Page 43: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

45

Reading Data from Text files

Chart FX 98 can also read information stored in text files. Both Tab separated values (TSV) andComma separated values (CSV) are valid and can be accessed by Chart FXThis feature is supported by the ChartFX default Data provider (Cfx4Data.DLL) and all you needis to reference an object and the GetExternalData property in ChartFX as follows:

Reading Data from Text files (Using Project References)If you are using Visual Basic is easier to include the Chart FX Data provider as a reference inyour project and create a CfxDataFile object. By doing this, the object will expose all propertiescontained and your code will be easier to read, maintain and debug. In order to include the ChartFX Data provider as a reference, you select the Project - References menu option and check theChart FX 98 Data provider, as depicted in the following figure:

Once the ChartFX 98 Data Provider has been referenced in your project you can use thefollowing code to read data from a text file :

'Create the Chart FX Data provider (using the CfxDataFile object)Dim CfxFile As CfxDataFile

'Load the file pointed by the eFile variable (includes path)CfxFile.FileName = eFile

'Let Chart FX take the information from the data providerChartFX1.GetExternalData CfxFile

Page 44: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

46

The text file you will generate depends on the actual data you want Chart FX to take. You cangenerate a text file with just numerical information or with labels that ChartFX will use to assignlegends.

In any case, the format of the text file must follow these guidelines:

1. There are as many columns as series in the chart.2. There are as many rows as points per series in the chart.3. A tab or a comma must separate columns.4. Each rows ends in a carriage return.5. No empty lines are allowed after the last row of data.6. Series Legends will be taken from Column headings.7. Point legends (x-axis legends) will be taken from Row headings.

For example, creating a text file that Chart FX will use to:

Plot numerical data only:10 2015 802 204 1007 35

Plot numerical data with Point legends:Jan 10 20Feb 15 80March 2 20Apr 4 100May 7 35

Plot numerical data with series legends:Sales Projected10 2015 802 204 1007 35

Plot numerical data with both legends:Sales Projected

Jan 10 20Feb 15 80March 2 20Apr 4 100May 7 35

Please note there’s a tab character in the first cell to make the "Sales" label go as a heading forthe first column.

Page 45: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

47

Chart FX Programmer’s Guide

Working with Axes

Topics covered in this section

IntroductionThe Axis ObjectAxis Formatting

Axis LabelingAxis Scrolling

Gridlines & Tickmarks

Page 46: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

49

Working with Axes. Overview

One of the most important improvements in Chart FX 98 is its axis handling. With the Axis object(and its properties) you'll be able to control settings like scale, gridlines, tickmarks, labels andmajor & minor units among others.

It's important to be aware that Chart FX 98 supports three different axes: The main Y Axis, theSecondary Y axis and the X-Axis, illustrated in the following figure:

Normally, the X-axis is a categorical axis (although it can also be a numerical axis in XY Plots)and the Y axes are numerical axis that you can independently control through different propertiesavailable in the axis object.

One of the major advantages in Chart FX 98 numerical axis handling is the introduction of majorand minor units which will allow you to control gridlines, tick marks and labels associated with theaxis. For example, you could have a chart where the primary Y axis ranges from 0-100, the labelsare position every 25 with a cross tick mark and gridlines position every 12.5 units, as depicted inthe following figure.

Page 47: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

50

Working with Axis Object

All the properties used for axis handling have been wrapped in the Axis object. This object willmake your code easier to maintain and debug, while making the properties more accessible toyou.

The Axis Object receives as a parameter any of the 3 axes supported by Chart FX: The X Axis,The Primary Y axis and the Secondary Y axis, followed by the property or method you want toinvoke and the setting for that particular property. For example, if you want to set the Maximumfor the Primary Y Axis to 200, your code should look like:

ChartFX1.Axis(AXIS_Y).Max = 200

How to assign series to the Primary or Secondary Y axis?

Because this depends on the amount of series you have in a chart, assigning different series toany of the Y axis (Primary or Secondary) is a property supported by the Series object through theYAxis property. By default, Chart FX will assign all available series to the Primary Y Axis. In somecases it will be impractical to use the primary Y axis for all series, as they may have completelydifferent scales and a particular series will not be visible in the chart.

For example, if you a two series chart where the first series ranges between 1-100 and thesecond series ranges between 10000-20000 the first series will not be visible because the scalechosen by Chart FX will be between 0 - 20000 making all values between 0-100 invisible to theeye. In this case, you may want to assign the second series to the secondary Y axis and assign acompletely different scale by accessing the YAxis property in the Series Object as follows:

ChartFX1.Series(1).YAxis = AXIS_Y2

In the following pages you'll learn how to handle independent scales, gridlines and differentsettings for a particular axis.

A word of caution when handling objects.

The amount of sub-objects you reference may affect the performance of your application.Therefore, if your code contains many settings to a particular axis, you can use alternativemethods to optimize your code such as assigning to a variable the Axis object and the assignproperties to that variable as follows:

Set YAxis=ChartFX1.Axis(AXIS_Y)'Then you use the YAxis variable to access and set all propertiesYAxis.Max = 100YAxis.Min = 1YAxis.GridColor = RGB(255,128,0)

This way of setting properties is more efficient as your application does not need to solve the Axisobject every time you are setting any of its properties.

Page 48: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

51

Axis Formatting

Formatting a numerical axis is as simple of setting any of the pre-defined axis formats in Chart FX98 using the Format property supported by the Axis object. For example, if you want scientificnotation in the primary y axis, your code should look like:

ChartFX1.Axis(AXIS_Y).Format = AF_SCIENTIFIC

Please make sure you check the Format property for more information on any pre-definedformats supported by ChartFX 98.

User-Defined Formats

Because Chart FX supports dates as well as numbers in a particular axis, you can define yourown formats by creating a mask that will instruct Chart FX how to format and display labels in theselected axis. For example, if you set dates for the x-axis you may create the following customformat:

ChartFX1.Axis(AXIS_X).Format = "Ddd-MMM-yy"

Page 49: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

52

Axis Labeling

Labeling a Categorical Axis

In most cases you will want to label a categorical axis (or x-axis), since the Y axis displaynumbers according to the scale chosen (by you or ChartFX) for that numerical axis. By default, acategorical axis (x-axis) is labeled with tag numbers (0,1,2,3...) and you may want to change thatto improve the chart's readability.

For example if you have 12 tick marks in the x axis and you want to label them with the month ofthe year, you may use Label the property with the appropriate index to label every tick mark, asfollows:

ChartFX1.Axis(AXIS_X).Label(0) = "January"ChartFX1.Axis(AXIS_X).Label(1) = "February"ChartFX1.Axis(AXIS_X).Label(2) = "March"...

This will display the appropriate labels on each tick mark in the x-axis.

Frequency and Label styles.

When there are too many labels in an axis (or too many points in a chart) they will not fit to thespace alloted to them. This will make the chart difficult to read. In this case you may want ChartFX to label certain amount of points or change the way the axis displays these labels. Here aresome tips:

To make the Chart label every ten points (Use the LabelValue property)ChartFX1.Axis(AXIS_X).LabelValue = 10

To make the labels vertical (use the LabelAngle property)ChartFX1.Axis(AXIS_X).LabelAngle = 90

To make the labels staggered (use the Style property)ChartFX1.Axis(AXIS_X).Style = AS_2LEVELS

Another interesting tip when handling labels is to use the Axis object Step and MinorStepproperties. Because each label will appear on the major step only, you can control the way labelsare displayed by properly setting these properties. This technique is fully explained in the"GridLines & Tick Marks" section later in this chapter.

Page 50: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

53

Custom labeling on numerical axes.

Assigning custom labels to an axis is as simple as using the Label property supported by the AxisObject. However, there's a trick to using custom labels on numerical axes, and it's better toexplain it in a real case scenario. For example, if you Primary Y axis ranges between 0 - 100 witha step of 20. In this case you'll end up with a chart with 6 tick marks in the y axis(0,20,40,60,80,100).

Let's suppose this chart is used to display "customer satisfaction" ratings where;

0 = Very poor20 = Poor40 = Average60 = Good80 = Very Good100 = Excellent

The Y axis, although is a numerical axis, should display these labels. And you must use thefollowing code to let the Y axis display those labels:

ChartFX1.Axis(AXIS_Y).Label(0) = "Very Poor"ChartFX1.Axis(AXIS_Y).Label(1) = "Poor"ChartFX1.Axis(AXIS_Y).Label(2) = "Average"ChartFX1.Axis(AXIS_Y).Label(3) = "Good"ChartFX1.Axis(AXIS_Y).Label(4) = "Very Good"ChartFX1.Axis(AXIS_Y).Label(5) = "Excellent"

However, because the Y axis is a numerical axis, the index specified in the Label property doesnot truly identifies where the label should be placed. The LabelValue property allows you tospecify where those labels should be placed in a numerical axis, so if you specify a LabelValue of20 as follows:

ChartFX1.Axis(AXIS_Y).LabelValue = 20

Each label will be placed exactly where you want them as depicted in the following figure:

Page 51: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

54

Axis Scrolling

When displaying charts that contain a large number of points, the most useful tool for the user isthe scrollbar. This tool allows them to see through portions of data without affecting the chart'sreadability. In Chart FX 98, both the Primary Y Axis and the X Axis can be setup to display ascroll bar that will help you setup a readable chart that your users will appreciate.

Important Note: Chart FX 98 does not support scrolling in the secondary Y Axis.

The PixPerUnit property allows you to specify the amount of physical pixels each tick mark willoccupy in the chart. For example if you have labeled the x-axis with long strings you mayincrease the size of each tick mark so each label may be visible.

The PixPerUnit property is very useful when you want to create a scroll bar associated with theselected axis or to increase the separation between tick marks. Its effect varies depending on thetype of axis that is applied to, as follows:

Categorical Axis

When you set a PixPerUnit to a categorical axis (e.g. X Axis) the value is an integer that will setthe separation (physical distance measured in pixels) between major tick marks.The default PixPerUnit value for the X-axis (when categorical) is 30 pixels.

You may want to change the PixPerUnit value for a categorical axis when:

1) The labels associated with the chart are too long and do not fit in the allotted space. In thisparticular case the PixPerUnit should be increased. What will happen is that if all points do not fitin one screen a scroll bar will be shown. This scenario requires the Scrollable Property to be setto TRUE.

2) You want to fit more points in one screen. In this particular case the PixPerUnit should bedecreased. You must be careful with Labels associated with each tick mark if the PixPerUnit istoo small.

3) You want to view a specific amount of points per screen. In this particular case we recommendthe use of the SetScrollView Method as it will allow you to set these values without anycalculations on your part.

4) If you don't want to show a scroll bar, you may set the PixPerUnit to zero (0). This will removethe scroll bar and Chart FX will set the appropriate PixPerUnit to fit all values in one screen.

Numerical Axis

When applied to a numerical axis (e.g. Y Axis), the PixPerUnit property is very useful to display ascroll bar and allow users to scroll through data without affecting the scale (Min,Max, Step) of theaxis.Because a numerical axis can be displayed in different units (currency, scientific, date, etc) issometimes difficult to imagine what a PixPerUnit measures. This concept is even more complexwhen we take into consideration that a numerical axis ranges in different values (millions,thousands, fractions, etc).

When applied to a numerical axis, the PixPerUnit value is no longer an integer. The general ruleof thumb is to take the size allotted to the chart (in pixels) divide it by the Maximum in the numeric

Page 52: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

55

axis and then divide that number by the number of pages you want the scroll bar to have.

For example, if you have a 400 pixels chart that ranges between Min=0 and Max=1 million andyou want to create a scroll bar that contains 5 pages, the PixPerUnit should be set to:

PixPerUnit = (400/1000000)*5 = 0.00008, this means there are 0.00008 pixels per unit in the yaxis.

On the other hand, if the same chart would have ranged between 0 and 1, the PixPerUnit settingmust be calculated as follows:

PixPerUnit = (400/1)*5 = 80

Setting the PixPerUnit to zero(0) will remove the scroll bar and let Chart FX calculate theappropriate PixPerUnit value.

If the Scrollable Property is set to FALSE, the PixPerUnit will not have any effect on theaxis. So please make sure the Scrollable property is set to TRUE when using the PixPerUnitproperty.

If you want to view a specific section of the numerical axis, we recommend the use of theSetScrollView Method as it will allow you to set these values without any calculations on yourpart. For example, you can invoke the SetScrollView method as follows:

ChartFX1.Axis(AXIS_Y).SetScrollView 0,200000

The ZoomIn method is also provided so you can control what portion of the chart you want toview.

Page 53: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

56

Gridlines & Tickmarks

Some people make use of gridlines and tick mark to improve the chart's readability. With ChartFX 98 you can control major and minor units, gridlines and tick marks independently. This allowsthe user to easily detect when a particular value plots in a certain value or range.

The axis object provides several independent properties that allow you to set almost anyparameters to gridlines and tickmarks in any axes of the chart. However, it is important tounderstand how gridlines and a tick marks relate to major and minor units in the chart, asidentified in the following picture:

Controlling Major Unit Gridlines and Tickmarks

The important thing to mention is that axis labels are placed in the major unit controlled by theStep property. The major tick mark is controlled by the Tickmark property and the major unitgridline is controlled by the Grid, GridStyle and GridColor Properties.

In the figure shown above is easy to identify a step of 10, with tickmarks placed outside the axisand Dash-Dotted blue gridlines. This can be achieved with the following code:

ChartFX1.Axis(AXIS_Y).Step = 10ChartFX1.Axis(AXIS_Y).Grid = TRUEChartFX1.Axis(AXIS_Y).TickMark = TS_OUTSIDEChartFX1.Axis(AXIS_Y).GridStyle = CHART_DASHDOTChartFX1.Axis(AXIS_Y).GridColor = RGB(0,0,128)

Controlling Minor Unit Gridlines and Tickmarks

Page 54: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

57

When you set a minor unit using the MinorStep properties, labels will not be shown in this locationbut gridlines and tickmarks can be set. For example in the figure shown above the MinorStepproperty has been to 5 with Minor Tickmarks shown as a cross and a solid Purple gridlineassociated with the minor unit, this can be achieved with the following code:

ChartFX1.Axis(AXIS_Y).MinorStep = 5ChartFX1.Axis(AXIS_Y).MinorGrid = TRUEChartFX1.Axis(AXIS_Y).MinorTickMark = TS_CROSSChartFX1.Axis(AXIS_Y).MinorGridStyle = CHART_SOLIDChartFX1.Axis(AXIS_Y).MinorGridColor = RGB(128,128,255)

Important Note:Because of limitations in the Windows API (Windows 95 and Windows 98), you can not creategridlines with different styles and widths. This limitation does not occur in Windows NT 4.0 orlater. Therefore, if you want to create a grid line with a special style (dot, dash, etc) the widthmust be always 1 pixel.

Interlaced Grids

In some cases interlaced gridlines are very useful to improve the chart's readability, as depictedin the following figure:

To achieve this effect you need to set the GridColor and the RGB2DBk properties (RGB3DBk ifthe chart is in 3D mode) with the color you want, plus set the Style property supported in the Axisobject as follows:

ChartFX1.Axis(AXIS_Y).GridColor = RGB(255,255,0)ChartFX1.Axis(AXIS_Y).RGB2DBK = RGB(0,255,255)ChartFX1.Axis(AXIS_Y).Style = AS_INTERLACED

Page 55: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

59

Chart FX Programmer’s Guide

Working with Chart FX Colors

Topics covered in this section

Color typesAssigning Colors

Color Palettes & SchemesBackground colors

Patterns

Page 56: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

61

Handling Colors

What kind of colors can I assign to the different markers and elements in the chart?

Normally, you would use the RGB macro with any property that assigns and handles a particularelement’s color in the chart, as follows:

ChartFX1.RGBBk = RGB(255,0,255)

If you are using Chart FX palettes and you want to use a particular color in the palette, you couldreference it by using the CHART_PALETTE constant plus the index of the color you want to use.For example, if you want to assign the tenth color in the current palette to the background you willset the RGBBk property as follows:

ChartFX1.RGBBk = CHART_PALETTECOLOR Or 10

Some developers want their applications to be system aware. This means, whenever the userchanges the Windows Color schemes, their application accommodates the new system colors. AllChart FX properties related to colors can also be set to system colors. For example, In VisualBasic, you would set the RGBBK property to set the chart’s background to a system color asfollows:

ChartFX1.RGBBk = vbInfoBackground

Important Note: If you are not using VB, you can assign a system color, as follows:

ChartFX.RgbBk = CHART_SYSCOLOR or Index

where index is GetSyscolor Windows API call.

Changing the default colors selected by Chart FX

When you create any type of chart, Chart FX will select from a default palette of solid colors.These colors can be changed to fit your specific needs. Colors are usually associated with Series,so if you have three series in the chart each one will have its own color. For example, If you havea three series bar chart, and you want to change default colors selected by Chart FX, You mustfirst open a communication channel with the OpenDataEx method with the COD_COLORSconstant and use the Color Property as follows:

Chart1.OpenDataEx COD_COLORS, 3, 0‘Then, you can change the colors of the series with the "Color"propertyChart1.Color(0) = RGB(128,255,0)Chart1.Color(1) = RGB(0,0,128)Chart1.Color(2) = RGB(128,128,255)‘Finally close the communications channel for colorsChart1.CloseData COD_COLORS

Page 57: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

62

The Series Object also provides a Color property that you can use to change colors associatedwith each series in the chart. For example, the following code will provide the exact same resultsas the code shown above:

Chart1.OpenDataEx COD_COLORS, 3, 0‘Then, you can change the colors of the series with the "Color"propertyChart1.Series(0).Color = RGB(128,255,0)Chart1.Series(1).Color = RGB(0,0,128)Chart1.Series(2).Color = RGB(128,128,255)‘Finally close the communications channel for colorsChart1.CloseData COD_COLORS

Changing the default color palette.

Another interesting way to change colors in Chart FX is to use the Palette Property where allseries and different objects (like backgrounds, gridlines, etc) will follow a pre-defined colorpalette. By default, Chart FX provides over a dozen pre-defined color-palettes. For example, ifyou want the chart to be displayed using the "Dark Pastels" palette, your code should look like:

ChartFX1.Palette = "Dark Pastels"

Important Note:The Chart FX 98 palettes are deployed as a registry entry on the client machine, so if you use thisproperty in your application, you must make sure the palettes are properly deployed andregistered in the client machine. For more information please refer to the "Deployment Issues"topic.

Page 58: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

63

Assigning individual colors to markers

In some cases, you don’t want colors associated by series, you want to be able to assign colorsindividually by marker. For example, if you have a bar chart and you want bars with negativevalues to be red and bars with positive values to be blue, the code shown above will not do thetrick for you because each color is associated with an entire series instead of an specific marker.In order to associate colors by marker, all you need to do is use the MultipleColors property.When turned on this property will force Chart FX to paint markers with different colors, even ifthey belong to the same series.

For example if you want to assign red to those bars with negative values and blue with valuesgreater than zero, your code should look like:

‘First Turn on the MultipleColors propertyChart1.MultipleColors = TRUE

‘Then open the comm. channel with COD_COLORS.Chart1.OpenDataEx COD_COLORS,2,0‘Obtain the total number of pointsnTotalPoints=Chart1.nValues‘Finally assign colors depending on their value using the ColorPropertyfor j=0 to (nValues-1)

if (Chart1.Value(j) <0) ThenChart1.Color(j) = RGB(0,0,255) elseChart1.Color(j) = RGB(255,0,0)End If

Next jChart1.CloseData COD_COLORS

Changing the background colors of the chart

Chart FX provides three properties that allows you to change the background colors of the chart.These colors can be changed by the end user by dragging a color from the palette bar located inthe Chart FX ToolBar to any portion of the background. These properties are:

RGBBk: Specifies the color for the background surrounding the chart.RGB2DBk: Specifies the color for the 2D charts background. This color is used to fill theinternal rectangle (surrounded by the AXIS) where the chart is contained.RGB3DBk: Specifies the color for 3D charts background. This color is used to fill the 3Dwall that encloses the chart.

For example, if you want to change the color of the 3D wall in a chart to be blue, your codeshould look like:

Chart1.RGB3DBk = RGB(0,0,255)

Important Note:CHART_TRANSPARENT constant can be set to make a transparent 3D background. Forexample, if you’re placing a bitmap underneath (BkPicture) the chart you may want to use thetransparent background feature as follows:

Chart1.RGBBK = CHART_TRANSPARENT

Page 59: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

64

Color SchemesAnother interesting Chart FX feature related to colors is Color Schemes. This feature allows youto change from Solid, Colored Patterns and Black & White patterns. This feature is very useful isyour application needs to display markers with patterns to improve readability of the chart.

This feature is accessible from Chart FX end user Interface. From the options dialog, and whenyou show the patternbar as another tool in your chart window.

The property is called Scheme and it allows you to select from CHART_CSSOLID (Solid Colors),CHART_CSBWPATTERN (B&W patterns) or CHART_CSPATTERN (Colored Patterns).Forexample if you want to use the Colored pattern Scheme your code should look like:

Chart1.Scheme = CHART_CSPATTERN

When you’re using colored patterns you may set either the foreground or background color of thepattern. The foreground color takes the setting from the Color property previously explained andthe background color of the pattern can be set using the "BkColor" property.

These pattern colors can also be changed from the Chart FX User Interface as follows:

Foreground: Drag a color to the marker.Background: Drag a color to the marker while pressing the Shift key

PatternsChart FX provides default patterns that you (or your end users) can use to assign to the differentseries of a chart. The only way to see these patterns is to show the Patternbar in the Chart. To dothis, you use the PatternBar property as follows:

Chart1.PatternBar = TRUE

When you show the PatternBar your users may Drag&Drop a pattern to any series in the chartand Chart FX will automatically apply such pattern, changing to a colored pattern scheme.You can also set patterns programmatically with the Pattern property, as follows:

Chart1.Pattern(1) = 2

Where 1 represent the series index you want to assign the pattern to and 2 represents theposition of the pattern in the pattern bar.

2D Colored LinesIn a 2D Line Chart, Chart FX will paint connecting lines in black, if you want you can instructChart FX to paint lines in the same colors as point markers, you do this using the Border propertyas follows:

Chart1.Border = FALSE

Note: When setting the border property to FALSE the color used by the 2D line is the onecontrolled by the BorderColor Property

Legend Background ColorsWhen you decide to show any of the Legend windows (Series or Points Legend) your end userscan easily change the background color of the legends by dragging a color to a backgroundportion of that window. If you want to do this programmatically, you must use the BkColorproperty of the respective object. For example, if you want to change the Series Legendbackground color to Green:

ChartFX1.SerLegBoxObj.BkColor = RGB(0,128,0)

Page 60: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

65

Chart FX Programmer’s Guide

Customizing chart markers

Topics covered in this section

Point Size & ShapesConical & Cylindrical Shapes

Marker VolumeLines Style & Width

Page 61: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

67

Markers

Controlling the Point Size and Shape.

When you create charts that display connecting points (line, scatter, curve, polar, etc) you maychange the size of this marker with the MarkerSize property as follows (The setting for thisproperty must be between 1 and 20, the default ):

ChartFX1.MarkerSize = 6

The shape of the marker is controlled by the MarkerShape property. For example if you want toassign a triangle as a marker shape programatically, your code should look like:

ChartFX1.MarkerShape = MK_TRIANGLE

You may also get rid off the point markers as follows:

ChartFX1.MarkerShape = MK_NONE

Setting Individual Marker Sizes and Shapes

All properties related to markers are also exposed by the Series Object. this will allow you to setindividual settings to the different series contained in the chart. For example, if you have a twoseries chart you may choose to show triangles in the first series and no point markers in thesecond series, as follows:

ChartFX1.Series(0).MarkerShape = MK_NONEChartFX1.Series(1).MarkerShape = MK_TRIANGLE

Conic and Cylindrical shapes.

Chart FX can transform bars , cubes or Hi-Lo-Close charts to conical and cylindrical shapes. Youcan do this for all or individual series. This means, you can have a bar combined with a conicalshape if you decided to do it that way.

The property associated with conical and cylindrical shapes is CylSides. This property ispresented as a general property and is also exposed by the Series Object. This allows you to setglobal changes (all series) or to a particular series in the chart.

This property setting should be a positive (cylindrical) or negative (conical) value of the number ofsides you want the shape to be. For example if you have a two series bar chart, and you want thefirst series to be an octagon cylindrical shape and the second series to be and hexagon baseconical shape, your code should look like:

Chart1.Series(0).CylSides = 8Chart1.Series(1).CylSides = -6

Controlling the Marker Volume

Page 62: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

68

When you create a bar chart, the marker (or bar) will occupy only a percentage of the spaceallotted (this is the space between tick marks). The Property is called Volume and you can set itas follows:

Chart1.MarkerVolume = 100

Setting Lines style and width.

When you use charts that have a line associated with markers (such as line, spline, polar, etc)you can control the style and width for each line independently using the LineStyle and LineWidthproperties.

Again, these properties are exposed by the Series Object as well so you are able to set themglobally (all series) or for individual series in the chart.

Note: When using line styles different than CHART_SOLID, the width must be 1 pixel. Thislimitation is imposed in Windows 95/98 only. Windows NT does support different line styles andwidths.

For example, if you have a 2D line chart an you want to set the style of all series to be dotted,your code should look like:

ChartFX1.LineStyle = CHART_DOT

On the other hand, if you have a 2 series chart and you want the first series to display a dottedline while the second series shows a dashed line, you can use the same properties exposed bythe series object as follows:

ChartFX1.Series(0).LineStyle = CHART_DOTChartFX1.Series(1).LineStyle = CHART_DASHED

Separating a Pie slice programmatically.

If you are plotting a Pie chart and you want to separate a slice programmatically (e.g. Yourapplication always chooses the biggest pie slice and separates it a little bit from the rest), you cando it through the SeparateSlice Property.

This property takes the index of the slice (point) you want to separate and receives the separationdistance measured from the center of the pie and expressed in radius percentage. For examplesetting this property to 100 will make the vertex of the slice to be on the edge of the pie, asfollows:

Chart1.SeparateSlice(1) = 100

Page 63: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

69

Chart FX Programmer’s Guide

3D Effects

Topics covered in this section

Displaying the chart in 3D ModeRotating the Chart

Clustered ChartsPerspective

3D Depth

Page 64: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

71

3D Effects

Displaying the Chart in 3D mode.

To display the chart in 3D you must use the Chart3D property as follows;

ChartFX1.Chart3D = TRUE

Once you have set this property you can start using different 3D settings like Rotation, Cluster,Perspective, etc.

Rotating the chart programmatically.

Although Chart FX provides your end users the most advanced way of rotating charts, you maywant to set 3D angles programmatically. You may use this option to rotate the chart on a realtimebasis (with a timer) for presentation purposes.

In order to rotate a chart programmatically, you must use two Properties: the View3D, AngleX andAngleY properties

First you set the View3D property to TRUE.

Chart1.View3D = TRUE

Then you set the 3D Angles as follows:

Chart1.AngleX = 45Chart1.AngleY = 60

Note: X axis rotation angle, Must be in [0, 90] U [270, 360) and Y axis rotation angle. Must be in[0, 360).

Setting 3D Wall Width.

Every 3D chart is enclosed in a 3D wall, and its width is controllable through the WallWidthProperty. The default width is 8 pixels. If you want to make the 3D wall flat, you can set it to 1 asfollows:

Chart1.WallWidth = 1

Cluster Charts

When displaying a clustered chart, each series will have its own position in the z axis. Thismeans, if you have a 3 series chart and this property is turned on, each data series will occupyone row of data and there will be 3 rows (z-axis clusters) in the chart. To make a 3D chartclustered use the Cluster property as follows:

ChartFX1.Cluster = TRUE

AREA charts are always clustered as there is no way to paint different series side by side. On theother hand, if you have a BAR chart, it is possible to paint bars side-by-side and not clustered inthe z-axis.

Setting the chart Perspective

Page 65: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

72

The perspective value specifies the ratio of the front of the chart to the back of the chart. It rangesfrom 0 (default) degrees to 100 degrees. The Perspective property allows you to set this value,For example to set a perspective of 50%, you need to set the Perspective property as follows:

ChartFX1.Perspective = 50

Important Note: In order to apply a perspective the chart must be in 3D (Chart3D property) andthe View3D and Cluster properties must be turned on.

Controlling the 3D Depth

The value is a percentage of the marker's width (the distance between two consecutive points inthe X-Axis). For example;

100% means the marker will have a depth equals to its width.200% means the marker will have a depth double than its width.The property that controls this setting is called View3DDepth

Page 66: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

73

Chart FX Programmer’s Guide

Working with special Chart Types

Topics covered in this section

XY PlotsMultiType Charts

MultiStacked ChartsGantt Charts

Financial ChartsSurface & Contour Plots

Bubble Charts

Page 67: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

75

XY Plots

An XY Plot is a chart that shows the relationship or degree of relationship between numericvalues in several series, or plot two group of numbers as one series of x-y coordinates.

Because each point in an XY Plot is defined by two coordinates (x, y) , you must make additionalcalls to be able to pass numeric data accordingly.

Passing Data to a scatter plot with the ValueEx and XValueEx properties.

The only special case when passing data to an XY Plot is you’re going to make two OpenDataEXmethod calls (one with COD_VALUES or y coordinate and another one with COD_XVALUES or xcoordinate) and finally use the "ValueEx" property to assign the appropriate y values and the"XValueEx" property to assign the x values of each point in the chart. The source code shouldlook as follows:

' Open the VALUES channel specifying "nSeries" Series and "nPoints"PointsChartFX1.OpenDataEx COD_VALUES,nSeries,nPointsChartFX1.OpenDataEx COD_XVALUES,nSeries,nPoints' Code to set the dataFor i = 0 To nSeries-1

For j = 0 To nPoints –1ChartFX1.ValueEX(i,j) = 'Y Coordinate ValueChartFX1.XValueEX(i,j) = 'X Coordinate valueNext j

Next i' Close the VALUES and XVALUES channelsChartFX1.CloseData COD_VALUESChartFX1.CloseData COD_XVALUES

Passing Data to a scatter plot with the Series Object.

You can also use the YValue and XValue properties in the Series object to pass data to an XYPlot.

' Open the VALUES channel specifying "nSeries" Series and "nPoints"PointsChartFX1.OpenDataEx COD_VALUES,nSeries,nPointsChartFX1.OpenDataEx COD_XVALUES,nSeries,nPoints' Code to set the dataFor i = 0 To nSeries-1

For j = 0 To nPoints –1ChartFX1.Series(i).YValue(j) = 'Y Coordinate ValueChartFX1.Series(i).XValue(j) = 'X Coordinate valueNext j

Next i' Close the VALUES and XVALUES channelsChartFX1.CloseData COD_VALUESChartFX1.CloseData COD_XVALUES

Notes:

Page 68: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

76

Chart FX does not limit the amount of Series in a scatter chart. This means, you can create ascatter chart with multiple series. Also all properties exposed by the Axis Object also apply tothis type of charts.

Please remember that in an XY Plot chart the x-axis becomes a numerical (not a categorical) axisyou can customize with the Axis Object properties. This means that instead of legends you will besetting scales, min, max and other numerical values to the x-axis.

The following chart types can handle x-values:

Lines, Curve*, Scatter, Area*, Step Lines, Surface, Bubble, Contour*, Curve Area.

* X values must be passed in ascending order.

Page 69: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

77

XY Plots. FAQ (Frequently Asked questions).

Which Chart Types are supported as XY Plots?

Although the most common use for XY Plots are Scatter (or point) charts, Chart FX allowsyou to change to the following chart types when you set data values as x,y coordinates:

Line, Curve, Area, Step Lines, Surface, Bubble, Contour & Curve Area.

This means that if you want an XY Plot to show connected lines all you need to do is changethe Gallery property to Lines.

How can I instruct a Data control or ADO that I'm creating a scatter plot?

Normally, when a chart is bound to a data control or if you use ADO (or text files) to retrievedata and populate the chart. Chart FX will assume that you want to create a regular charttype and not an XY Plot. This means that if you are connecting to a database that contains Xand Y coordinates for an XY Plot, Chart FX by default will create a chart with two seriesinstead of an XY Plot.

This default behavior can be overwrite by the DataType property. For example if you have aSQL Statement like:

SELECT YValue,XValue FROM MyTable

You can set the DataType property as follows:

ChartFX1.DataType(0) = CDT_VALUEChartFX1.DataType(1) = CDT_XVALUE

This will force Chart FX to take the information appropriately for the XYPlot..

Note: The DataType property must be set before you assign the ADO Resultset to chart.

Can I force lines to display the same color as point markers?

Yes, you may use the "TypeMask" property to force ChartFX to display lines in the samecolor of point markers instead of black, as follows:

Chart1.TypeMask = Chart1.TypeMask Or CT_COLORLINE

Can I use different point markers in a scatter plot?

Yes, please refer to the MarkerShape property supported by the Series Object.

Page 70: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

78

Can I highlight points in a scatter chart?

For example I have a certain limit I want to control and highlight points that plot above that limit.The answer to this question not only applies to scatter charts but all types of charts in Chart FX,You have several options:

Use Chart FX "Constant Lines and Color Stripes" Feature to highlight the limit or range,respectively.

Use Chart FX "Customizing Chart painting" Feature, to highlight points by enclosing in arectangle or any other similar shape.

You may change the color of the points that plot above that limit. If this is what you want, youcan force Chart FX to assign different colors for each point in the chart. The code should looklike:

‘First you must set the MultipleColors Property to indicate Chart FX that each marker (point)will have its own color. (In our case, you’ll always assign the same color and change only theones that plot above the limit).

Chart1.MultipleColors = TRUE

‘You then have to open a communications channel with COD_COLORS and the number ofcolors you’ll pass to the chart (in this case 2 colors, one for the points that plot above the limitand one for the rest of the points)

Chart1.OpenDataEx COD_COLORS, 2, 0‘Check the value of all points and assign its colors using the"Color" PropertynTotalPoints=Chart1.nValuesFor j=0 to (nValues-1)

if (Chart1.Value(j)>=MyLimit)‘Red to the points that plot above the limitChart1.Color(j) = RGB(255,0,0)else‘ Blue color to the points that plot inside the limitChart1.Color(j) = RGB(0,0,255)endif

Next jChart1.CloseData COD_COLORS

MultiType Charts

Page 71: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

79

One of the most powerful features in Chart FX is MultiType charts. They allow you to specify adifferent chart type for the series contained in a chart. Not all chart types in Chart FX can becombined to create a Multitype chart, only a subset of the chart types available in Chart FX canbe use with this option.

If you have a chart with more than one series, you can use the Gallery Property in the SeriesObject to assign a different chart type to different series in the chart. For example, if you have athree series chart and you want the first series to be bar, the second series to be curves and thethird series to be area, your code should look like:

ChartFX1.Series(0).Gallery = BARChartFX1.Series(1).Gallery = CURVEChartFX1.Series(2).Gallery = AREA

All Multitype charts provide 2D/3D support, rotation capabilities and mouse detection.Important Note: Since the MultiType property is an array of series, it has to be set after you definethe number of series in the chart using the OpenDataEX Method

It is also important to note there's a General property with the same name (Gallery) that whenused will apply the specified chart type to all series in the chart. So you must be careful toreference the series object when creating multitype charts. For example:

ChartFX1.Gallery = LINES ' Will apply lines to all series in the chartChartFX1.Series(0).Gallery = LINES will convert the first data seriesto lines.

Here's an example of you what you can achieve using MultiType charts:

Page 72: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

80

MultiStacked charts

Most charting tools allow you to stack bar and area charts in different modes. Most common areregular stack and 100% stack charts. Not only Chart FX allows you to stack charts using thesecommon methods, but you can easily achieve MultiStacked charts where different series in thechart can be presented as different groups of stacked bar or area charts.

If you want to stack all series in the chart, you can use the Stacked general property as follows:

‘ Regular stackedChartFX1.Stacked = CHART_STACKED‘ or 100% stackedChartFX1.Stacked = CHART_STACKED100

This stacked property is also exposed by the Series Object, with the difference that it will apply toa specific series in the chart. When you manipulate the Stacked property in the Series object youwill instruct Chart FX to stack that series on top of the previous one which must be of a stackedtype (area or bar). For example, the following code creates a multistacked chart with a curve ontop of the different stacked groups:

'Produce 2 bars and 1 curve ChartFX1.Series(0).Gallery = BAR ChartFX1.Series(1).Gallery = BAR ChartFX1.Series(1).Stacked = True ' On top of 0 ChartFX1.Series(2).Gallery = BAR ChartFX1.Series(3).Gallery = BAR ChartFX1.Series(3).Stacked = True ' On top of 2 ChartFX1.Series(4).Gallery = BAR ChartFX1.Series(4).Stacked = True ' On top of 3 ChartFX1.Series(5).Gallery = CURVE

' Adjust scale ChartFX1.RecalcScale

This code produces the following chart:

Page 73: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

81

Gantt Charts

Gantt charts are commonly used to track activities during time. With little code you can achieve,in Chart FX, a Gantt chart like the following:

Setting the Gantt type

The first step in creating a gantt style chart is to use the Gallery property with the GANTT charttype as follows:

ChartFX1.Gallery = GANTT

It is important to understand that when you set this style, the axis will be shifted. The x-axis(categorical) draws vertically (left side) and the y-axis (numerical) draws in the bottom of thechart. This is important to mention as all the properties that you set regarding the y axis will affectthe bottom axis and not the left side axis as you would normally expect.

Also, the GANTT type will display horizontal bars in the Plot area.

Passing Data To Gantt Charts

There are two parameters you must pass to a Gantt chart: Where the bar begins and where itends, according to the data type the y axis (bottom) has been set. This means that if you set aMin of 0 and a Max of 200 for the Y axis the bars must contain a beginning value and an endingvalue that are numbers.

On the other hand, if you set the Min and Max to be dates, the value of the bars must be set withdates so they can be represented according to the format of the y axis.

The properties involved in passing data to a Gantt chart are ValueEX and IniValueEX propertiesthat must be used in conjunction with OpenDataEX and CloseData methods.

Page 74: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

82

The following example shows how you can set values to a Gantt chart represented in a numericaly-axis. Please note how the Y axis is set with numerical values for its min and max beforesending the data to the chart.

'First set the Min and Max for the Y AxisChartFX1.Axis(AXIS_Y).Min = 0ChartFX1.Axis(AXIS_Y).Max = 200

'Then we can use the ValueEX and IniValueEX for the Gantt Chart.Let's suppose it has 3 barsChartFX1.OpenDataEX COD_VALUES,1,3ChartFX1.OpenDataEX COD_INIVALUES,1,3

ChartFX1.IniValueEX(0,0) = 10ChartFX1.ValueEX(0,0) = 30ChartFX1.IniValueEX(0,1) = 40ChartFX1.ValueEX(0,1) = 80ChartFX1.IniValueEX(0,2) = 100ChartFX1.ValueEX(0,2) = 180

ChartFX1.CloseData COD_VALUESChartFX1.CloseData COD_INIVALUES

The following example shows how you can set values to a Gantt chart represented in a dateformatted axis. Please note how dates are set for the Min and Max in the Y Axis and values setwith the ValueEX and the IniValueEX properties correspond to dates:

Dim Today As DateToday = Now()

'First set the Min and Max for the Y AxisChartFX1.Axis(AXIS_Y).Min = TodayChartFX1.Axis(AXIS_Y).Max = Today + 120 '3 months

'Then we can use the ValueEX and IniValueEX for the Gantt Chart.Let's suppose it has 3 barsChartFX1.OpenDataEX COD_VALUES,1,3ChartFX1.OpenDataEX COD_INIVALUES,1,3

ChartFX1.IniValueEX(0,0) = TodayChartFX1.ValueEX(0,0) = Today +10ChartFX1.IniValueEX(0,1) = Today + 30ChartFX1.ValueEX(0,1) = Today + 80ChartFX1.IniValueEX(0,2) = Today+90ChartFX1.ValueEX(0,2) = Today+110

ChartFX1.CloseData COD_VALUESChartFX1.CloseData COD_INIVALUES

But my axis is displayed on the bottom of the chart and I want it on top?

Page 75: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

83

In order to create the chart displayed in the figure shown above, we made use of the Chart FXSecondary Y axis capabilities where the data series was assigned to the secondary Y axis and itssettings (Min, Max, etc) while the primary Y Axis Visible property was set to false, as follows:

'First let's assign the first series to the secondary Y AxisChartFX1.Series(0).YAxis = AXIS_Y2'Then we must set the Secondary Y Axis Min, Max, Step, etc so thechart still displays the same way

'Finally the Primary Y Axis is hidden in the chartChartFX1.Axis(AXIS_Y).Visible = FALSE

Assigning Activity Labels

Activity labels are set as any other legend in the chart. Using the Legend Property or the Labelproperty in the Axis Object.

What about independent colors?

First you must set the MultipleColors Property to indicate Chart FX that each marker (point) willhave its own color.

Chart1.MultipleColors = TRUE

You then have to open a communications channel with COD_COLORS and the number of colorsyou’ll pass to the chart (in this case 2 colors, one for the bar displayed in red and the other onesin blue)

Chart1.OpenDataEx COD_COLORS, 2, 0‘Check the value of all points and assign its colors using the"Color" PropertynTotalPoints=Chart1.nValuesFor j=0 to (nValues-1)

if (Chart1.Value(j)>=MyLimit)‘Red to the points that plot above the limitChart1.Color(j) = RGB(255,0,0)else‘ Blue color to the points that plot inside the limitChart1.Color(j) = RGB(0,0,255)endif

Next jChart1.CloseData COD_COLORS

Financial Charts

Page 76: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

84

Important Note:If you are interested in Financial Charts, you may want to know Software FX provides aChart FX Financial Edition that allows for creation and handling of special Financial ChartTypes like Renko, Kagi, Money Flow, Three Line Break, among others. Please visit orweb site at http://www.softwarefx.com for more information on this special FinancialExtension for Technical Analysis.

Financial Charts

As part of the standard chart types, Chart FX provides support for three different types of financialcharts: Hi-Lo-Close, Open-Hi-Lo-Close and Candlesticks. Financial charts also provide supportfor MultiType charts, so you can plot an Open-Hi-Lo-Close combined with a line or a volume (bar)chart (Please refer to a sample later in this section).

The method of passing data to a Financial chart is exactly the same as with other charts: openinga communication channel (OpenDataEx Method), passing the numerical information and finallyclosing the communication channel.

Each marker is defined by several values. For a Hi-Lo-Close chart you’ll need three series and forOpen-Hi-Lo-Close you’ll need to set four series. Finally, you’ll need to pass special constants inthe ValueEX property to instruct Chart FX which numerical values go with the Open, Hi, Low andClose values.

The first step you need to do when plotting a financial chart is to handle the Gallery propertyeither at design or run time to specify the type of chart you’ll be handling, as follows:

ChartFX1.Gallery = HILOWCLOSE [or OPENHILOCLOSE Or CANDLESTICK]

To pass data to an Open-Hi-Lo-Close chart you must be careful to specify the appropriateconstant in the ValueEX property as follows::

' Open the VALUES channel specifying 4 Series (OPEN, HIGH,LOW andCLOSE) and "nPoints" PointsChartFX1.OpenDataEx COD_VALUES,4,nPoints' Code to set the dataFor j = 0 To nPoints –1

ChartFX1.ValueEx(OHLC_LOW,j) = Low value!ChartFX1.ValueEx(OHLC_OPEN,j) = Open value!ChartFX1.ValueEx(OHLC_CLOSE,j) = Close value!ChartFX1.ValueEx(OHLC_HIGH,j) = High value!

Next j' Close the VALUES channelChartFX1.CloseData COD_VALUES

Multitype Financial Charts

Page 77: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

85

It’s common practice to combine a financial chart with another chart (i.e. Lines or Bar) to displayother relevant information (e.g Volume Traded). The Gallery Property provided by the SeriesObject can be used to achieve this. Another Chart FX feature that can be used with combinedfinancial charts is double-y axis, because the volume traded moves in a different range of scalethan the price of a stock.

In the following sample we will create a Hi-Lo-Close chart, with a volume chart (bar) andassociating the volume series to a secondary y axis:

' Open the VALUES channel specifying 5 Series (OPEN, HIGH,LOW,CLOSE andVOLUME) and "nPoints" PointsChartFX1.OpenDataEx COD_VALUES,5,nPoints' Code to set the dataFor j = 0 To nPoints –1

‘First three series contain Hi-Lo-Close InformationChartFX1.ValueEx(OHLC_OPEN,j) = Open value!ChartFX1.ValueEx(OHLC_HIGH,j) = Hi value!ChartFX1.ValueEx(OHLC_LOW,j) = Low value!ChartFX1.ValueEx(OHLC_CLOSE,j) = Close value!‘Fifth Series contains Volume informationChartFX1.Value(4,j) = Volume Traded in day!

Next j' Close the VALUES channelChartFX1.CloseData COD_VALUES‘Now that all data is there, we use the Gallery property in the seriesobject to create a bar volumeChart1.Series(4).Gallery = BAR‘Assign the volume chart to a secondary y axisChart1.Series(4).YAxis = AXIS_Y2

Surface & Contour Charts

Other interesting chart types in Chart FX are the Contour and Surface Plots.The surface plot is usually displayed in a 3D representation. The number of series determines thewidth of the chart while the number of series determines the depth of the chart. For example if we

Page 78: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

86

want to display a 3D surface chart with 10 Points and 10 Points per series with all values set tozero, it would look like:

As depicted in the figure, you must now locate which data points you want to change in order forthe chart to start looking like a surface plot. For example if we change the value for the points andseries highlighted in the figure, the chart will look like:

In order to achieve the chart displayed in the figure shown above your code should look like:

ChartFX1.Gallery = SURFACE'Let's assign zero values to all points (Figure 1)ChartFX1.OpenDataEx COD_VALUES,10,10For i = 0 to 9

Page 79: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

87

For j = 0 to 9ChartFX1.ValueEx(i,j) = 0Next j

Next i'Now let's change Series 2, Point 2 to a value of 9ChartFX1.ValueEX(1,1) = 9'Now let's change Series 5, Point 9 to a value of 20ChartFX1.ValueEX(5,9) = 20'Now let's change Series 7, Point 5 to a value of 15ChartFX1.ValueEX(7,5) = 15ChartFX1.CloseData COD_VALUES

Handling Level Colors

One of the most important settings in a surface plot is the level of detail the chart contains bydisplaying different colors according to the value of each data point. Notice that although valueshave been set, the level of detail shown in the chart is not enough for the scale selected for the yaxis (-20,20). What we need is this surface plot to show more colors according to the height ofeach point.

To achieve this, you simply change the step of the primary Y axis to achieve the level of detailyou need in the surface plot. For example, in the figure shown above the step has been set to 10,not allowing the surface to display enough colors. However, if we change the step to 2 as follows:

ChartFX1.Axis(AXIS_Y).Step = 2

The surface plot will display more colors depending on the level of each value,

Page 80: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

88

Automatic Labeling & Scaling

Because most surface and contour chart displays levels, we have included a method that allowsyou to label points automatically according to a specific scale factor. The SetContourLabelsmethod allows you to automatically assign such legends by giving a step in Y axis units. Whenset to zero, the legends will be automatically assign with a best fit step chosen by Chart FX.

Note:When invoking this method, Chart FX will assign series legends indicating the color foreach level in the CONTOUR Plot. So be aware that any series legend you previously hadin the chart will be erased when invoking this method. This method also modifies the Stepof the primary Y axis with the step specified in this method.

When you invoke this method as follows:

ChartFX1.SetContourLabels 20

A contour chart will look like:

Page 81: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

89

Bubble Charts

Bubble charts without X CoordinateThe first type of bubble charts available in Chart FX are Bubble charts that compare a set of twovalues with one of the values specifying the size of the bubble marker.

To pass data just set a chart with two data series and set BUBBLE to the Gallery Property asfollows:

ChartFX1.Gallery = BUBBLE

ChartFX1.OpenDataEx COD_VALUES,2,5For j = 0 to 4

'Set the series that contains the y value for the bubblemarkerChartFX1.ValueEX(0,j) = 'Bubble Y Value'Set the series that contains the bubble sizeChartFX1.ValueEX(1,j) = ' Bubble Size

Next j

ChartFX1.CloseData COD_VALUES

After setting these values the bubble chart should look like:

Bubble charts with an X CoordinateThese bubble charts will compare a set of three values with one of the values specifying the sizeof the bubble marker. Basically, These bubble charts are pretty much an XY Plot, where thebubble position is defined by two coordinates (x,y) and a third coordinate that specifies the size ofthe bubble.

Page 82: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

90

To pass data you must open an additional communications channel to specify the x coordinatewith the XValueEx property, as follows:

ChartFX1.Gallery = BUBBLE

ChartFX1.OpenDataEx COD_VALUES,2,5ChartFX1.OpenDataEx COD_XVALUES,1,5For j = 0 to 4

'Set series that contains the y value for the bubble markerChartFX1.ValueEX(0,j) = 'Bubble Y Value'Set the x value for the bubble markerChartFX1.XValueEX(0,j) = 'Bubble X Value'Set the series that contains the bubble sizeChartFX1.ValueEX(1,j) = ' Bubble Size

Next j

ChartFX1.CloseData COD_VALUESChartFX1.CloseData COD_XVALUES

For these type of charts the bubble is not restricted to a specific x coordinate but can be paintedanywhere in the x-axis (numerical axis) as described in the XY Plot chapter before.

The Volume Property effectWhen creating bubble charts, you must be aware that the Volume Property has a specific effect inthe way bubble charts are displayed as the Size will be divided by the setting in the volumeproperty.For example, if the volume property is set to 50. It means that Chart FX will force the marker tooccupy 1/2 of the space allotted. When you set the bubble size to a 100, you would expect thebubble to occupy the entire space allotted, however in this case the bubble will only occupy 1/2 ofthe space allotted. Similarly, if the Volume is set to 50 and the bubble size is 50, the bubble willoccupy 1/4 of the space allotted.

Fancy Bubble ChartsIf you're creating 3D bubble charts you can set the CylSides property to achieve a fancy lightingeffect on the bubbles as shown in the following figure:

Page 83: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

91

Chart FX Programmer’s Guide

Constant Lines & Color Stripes

Topics covered in this section

Constant Lines SampleColor Stripes Sample

Page 84: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

93

Constant lines Sample

Constant lines are one of the most useful objects when it comes to highlighting information in thechart area. You may want to create a constant line to highlight limits or specific points of interestin the chart. For example, in a scientific application, you may want to use the constant line objectto highlight an alarm limit, or in a financial application you may want to use the constant line tohighlight a target price or date.

Constant lines are lines that you can draw anywhere in the chart area and they associatethemselves with a particular value in the axis that they're assigned to, as illustrated in thefollowing figure.

All Constant lines are handled by the ConstantLine object and its properties, where you can setcolor, styles and the axis the constant line is associated to.To create a constant line you don't need a whole new data series and you can also configurelabels and line styles, colors and width.

The following code creates the constant lines for the figure shown above. Please note the use ofthe OpenDataEX method to indicate the amount of constant lines to be included in the chart.

ChartFX1.OpenDataEX COD_CONSTANTS,2,0

ChartFX1.ConstantLine(0).Value = 30ChartFX1.ConstantLine(0).Color = RGB(255,0,0)ChartFX1.ConstantLine(0).Axis = AXIS_YChartFX1.ConstantLine(0).Label = "Alarm Limit 1"ChartFX1.ConstantLine(0).LineWidth = 2

ChartFX1.ConstantLine(1).Value = 8ChartFX1.ConstantLine(1).Color = RGB(0,255,0)ChartFX1.ConstantLine(1).Axis = AXIS_XChartFX1.ConstantLine(1).Label = "Limit 2"ChartFX1.ConstantLine(1).LineWidth = 3

ChartFX1.CloseData COD_CONSTANTS

Page 85: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

94

Stripes Sample

Stripes are one of the most useful objects when it comes to highlighting information in the chartarea. They allow you to highlight a range of values associated with any of the axis by drawing acolor frame in the chart background.

Stripes allow the user to easily pinpoint data that falls within a range of values associated withany of the axes. For example, in a scientific application you may want the user to recognizepoints that plot between 50 and 80 with a stripe object as depicted in the following figure:

The Stripe Object and its properties handle color stripes, where you can set color, range and theaxis the stripe is associated to.If you want to highlight a specific value instead of a range, please refer to the Constant LinesSample.

The following code creates the stripes for the figure shown above. Please note the use of theOpenDataEX method to indicate the amount of stripes to be included in the chart.

ChartFX1.OpenDataEX COD_STRIPES,2,0

ChartFX1.Stripe(0).From = 50ChartFX1.Stripe(0).To = 80ChartFX1.Stripe(0).Color = RGB(0,0,255)ChartFX1.Stripe(0).Axis = AXIS_Y

ChartFX1.Stripe(1).From = 3ChartFX1.Stripe(1).To = 5ChartFX1.Stripe(1).Color = RGB(0,255,0)ChartFX1.Stripe(1).Axis = AXIS_X

ChartFX1.CloseData COD_STRIPES

Page 86: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

95

Chart FX Programmer’s Guide

Handling Files & Templates

Topics covered in this section

The Import & Export MethodsTips & Tricks

Page 87: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

97

Import & Export Methods

Chart FX provides two important methods (Import and Export) that enables you (or your endusers) to save chart files, images and data in a variety of formats.

There’s also another type of files in Chart FX called "Chart Templates" that allows you to save theappearance (Colors, Chart Types and Styles, Visible Tools, etc) of the chart in a file so you canlater on apply it to other charts and save a lot of time from coding all these changes to individualcharts.

Note:Templates save all the information that is not data related. this means, It will not save thevalues, number of series or points, or any other property related to this data, such asMultiType settings and Min, Max values in the chart axes.

The Export MethodThis method is used to export the chart data and/or properties to the clipboard , to a file or a OLEstream using different formats. It's syntax is as follows:

ChartName.Export (Format,vFile) where,

ChartName is the chart name.

Format is any of the following:

CHART_DATA: Exports data using a Tab Separated Values format (TSV)CHART_BITMAP: Exports the chart Windows BitmapCHART_METAFILE: Exports the chart Windows MetafileCHART_CFXOLEFILE: Export the chart using a OLE Compound Document format.CHART_CFXOLETEMPLATE: Export the chart's visual attributes (without data) using a OLECompound Document format.

vFileis a variant type that specifies where is the chart going to be export (Clipboard, File or Handle).The value of vFile depends on the used format:To export to the clipboard, vFile must be an empty string (or NULL).To export to a file, vFile must contain the file name including the path.

To export to a file using a handle, vFile contains a file handle from a previously opened file usingthe _CreateFile function, the file must be open and ready to receive the data (must be open forWRITE and the file cursor updated, sometimes a Flush is necessary). Exporting the chart to anopen file is useful when you need to save the chart inside one of your proprietary files, in otherwords, it allows you to save the chart and any other data into the same file.

The chart can also be exported to a OLE Stream, this is particularly useful if you want to save thechart in a database.

The Import Method

Page 88: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

98

This method is used to import a chart previously saved with the Export Method. It's syntax is asfollows:ChartName.Import (Format,vFile) where,

ChartName is the chart name.Format is any of the following:

CHART_CFXOLEFILE: Imports a previously saved chart using the OLE Compound Documentformat.CHART_CFXOLETEMPLATE: Imports a previously saved chart template using the OLECompound Document format.

vFileis a variant type that contains the file name (including path).

Chart FX 3.0 Filters

If your application relies on previously saved chart files with Chart FX 3.0, you'll need to deployand register Cfx4Filters.dll. This is a special COM interface that provides backward compatibilitywith Chart FX 3.0 files.

This file (Cfx4Filters.dll) is provided as part of the original ChartFX 98 installation.

This COM interface does not expose any API but it is necessary if you are required to load ChartFX 3.0 files in an application that uses Chart FX 98.

Tips & Tricks. Chart FX Files

Page 89: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

99

How do I control what is saved in a Chart FX 98 File?

Whether if you are saving chart files or templates, you can control what is saved on the file bymanipulating the FileMask Property.

This is a mask property that allows you to specify which visual attributes you want the chart file tosave when you invoke the Export Method. By default, this property is set to save all visualattributes including the data (for CHART_CFXOLEFILE) and all visual attributes with no data (forCHART_CFXOLETEMPLATE). However, if you want to save everything but the titles in the chart,you will set this property before invoking the Export method as follows:

ChartFX1.FileMask = ChartFX1.FileMask And Not FMASK_TITLES

This property is particularly useful because it allows you to customize how chart files are saved,this way you can build your own chart templates.

This property is a mask property. this means all settings represent a bit in the word that you needto turn on or off according to what you want. For this purpose you’ll use the bitwise operators(And, Or, Not, Xor) provided by your development tool.

Because it is a mask property, you must make sure you use these operators to turn on/off bitsand avoid losing previous settings to the property.

For example, if you want to turn ON the FMASK_TOOLS setting. The right way of setting thisproperty is

Chart1.FileMask = Chart1.FileMask Or FMASK_TOOLS

If you type the following code:

Chart1.FileMask = FMASK_TOOLS (WRONG!)

You’ll erase all other settings in the property causing an erratic behavior of the library whensaving files.

The bitwise operators are used as follows:

OR turn on a bit in the propertyXOR switch a bit in the propertyAND NOT turn off a bit in the property

I need to place the chart in a picture control for use in another component or application,How do I do that?

Sometimes, you'll need the chart in a picture control so other components or applications can usethem. For example, many reporting tools provide the capability of importing images from a picture

Page 90: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

100

control and this is particularly important when your application is running and a report is beinggenerated. Therefore, saving the chart to a bitmap or metafile is not useful in this situation.

Placing the chart in a picture control is as easy as invoking the GetPicture method in Chart FX.For example, if you have a Picture control named "Picture1" you can let the picture control displaythe chart with the following code:

Set Picture1.Picture = ChartFX1.GetPicture(CHART_METAFILE)

The results is depicted in the following figure:

Page 91: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

101

Chart FX Programmer’s Guide

Capturing Mouse Events

Topics covered in this section

Marker DraggingMenus on Demand

Customizing Tooltips and BalloonsTracking the mouse

Page 92: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

103

Capturing Mouse Events.

Chart FX 98 provides different properties, methods and events that allow you to control how thechart reacts to mouse interactions from the user. For example, You can customize the waytooltips are displayed, if the user is capable of dragging markers thus changing the value for aparticular point or you can add your own code when the user right clicks on a chart title. You caneven simulate mouse clicks at a particular location in the chart to see if the user is positioned overa particular element in it.

Let's start by introducing the properties provided by Chart FX 98 that will affect how the chartreacts to mouse interaction.

Marker Dragging

By default, a Chart FX chart is created with the AllowDrag property set to TRUE. This allows theend user to change the value for a particular marker by positioning the mouse over a particulardata point and dragging the marker to a desired value. Although this is a cool feature it is notuseful if you don't want the user to change the values in the chart. To prevent the user from doingthis, you may set the AllowDrag Property to FALSE as follows:

ChartFX1.AllowDrag = FALSE

Menus on Demand

Another property somehow related to mouse interaction in the chart is called MenusOnDemand.Whenever the user right-clicks a particular element in the Chart a pull-down menu will appearwith options to customize that particular element. For example, if a user right clicks on the Y Axis,a menu will appear and the user will be able to access all axis properties. Menus on demand canbe disabled by setting the MenusOnDemand property to FALSE, as follows:

ChartFX1.MenusOnDemand = FALSE

Note:If you want to customize certain options "inside" each menu that appears when the userright-clicks a particular element in the chart. Please refer to the "Customizing Tools"chapter

Customizing DataTips

By default, when the user positions the mouse over an element in the chart (Not the Toolbar) atooltip will appear with specifics about the element. Particularly important are data points thatdisplay information such as the series legend, the point legend and value inside the tooltip. Thisbehavior can be easily changed with the TipMask property, where you can specify the informationyou want inside a tooltip.

For example, if in an XY Plot you want to modify the text displayed in the tooltip with just the X &Y Coordinates of the point, you can set the TipMask property with the variables you want todisplay in the tooltip as follows:

ChartFX1.TipMask = %x%v

Page 93: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

104

This property can also be combined with custom text to provide a clearer message to the user.For example if you want the tooltip to display: "Hello I'm Point: 1 and my value is 13.5", you canset the TipMask property as follows:

ChartFX1.TipMask = "I'm point: "+"%l "+" my value is: "+"%v"

Although the TipMask property is the simplest way to customize data tips, the GetTip event isprovided so you can add context sensitive information to particular data points in the chart. Forexample, you want a particular data tip to show a specific text different than other points. Whenprocessing the GetTip event you may detect which data tip is about to be displayed and changethe message for that particular point only.

Customizing the Balloon Text

Some developers prefer the balloon instead of the tooltip when the user double-clicks a particulardata point in the chart. If you want you can intercept the LButtonDblClk event and alter the textdisplay on this balloon. Or you may want to choose to drill-down route your application to anothermodule or show another chart with more in-depth information about that point. In this case we willshow you how to change the text displayed on the balloon.

Caution: The following code must be placed in the LButtonDblClk Event

' Capturing default textsDef = ChartFX1.HText' Modify default textsFinal = "Hello Im point No: " + sDef' Setting the text to be displayedChartFX1.HText = sFinal

You may actually check the Nseries and nPoints Parameter to check on what marker the userdouble-clicked. These two parameters will contain -1 if the user did not click on a marker (i.e.chart background). For example if you want to change the balloon text only when the user clickedon the first series, you may changed the code shown above as follows:

if (nSeries=0)' Capturing default textsDef = ChartFX1.HText' Modify default textsFinal = "Hello Im point No: " + sDef' Setting the text to be displayedChartFX1.HText = sFinalEnd If

Other mouse related events

Just as the LButtonDblClk event, Chart FX 98 provides several mouse events that allow you tocustomize how the chart reacts to mouse interaction coming from the user, they are:LButtonDown, lButtonUp, RButtonDown, RbuttonUp, RButtonDblClk. You may process theseevents to add specific functionality in your application.

Tracking the Mouse

Page 94: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

105

Sometimes you may need to track mouse movements in the chart area and detect where themouse pointer is positioned and at which element in the mouse is pointing. In order to achievemouse tracking you must first use the TypeMask property to instruct ChartFX you want to receivemouse movements in the chart area as follows:

ChartFX1.TypeMask = ChartFX1.TypeMask Or CT_TRACKMOUSE

Once the CT_TRACKMOUSE has been included in the TypeMask property you can use theMouseMoving event in conjunction with the HitTest method to determine where the mousepointer is located and to which chart element is pointing at. For example, if you add the followingcode to the MouseMoving event, you can check for the return value on the HitTest method andeasily determine the chart element the mouse in pointing at:

Private Sub ChartFX1_MouseMoving(ByVal X As Integer, ByVal Y AsInteger, nRes As Integer)Dim nHit As CfxHitTest

nHit = ChartFX1.HitTest(X, Y, nSeries, nPoint)

' Please refer to the HitTest method for more information onreturn values

End Sub

Page 95: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

107

Chart FX Programmer’s Guide

Printing Charts

Topics covered in this section

Printing the chartControlling Paper Orientation

B&W or Color printingTips & Tricks

Page 96: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

109

Printing Charts. Overview

Among the different objects exposed by the Chart FX 98 API is the Printer object. This objectallows you to set printer attributes before actually printing charts from the Chart FX ToolBar orfrom code. You can control print out margins, resolution and other important chart aspects suchas colors and paper orientation.

Printing the chart

Before describing all the properties supported by the Printer Object you must know how to printthe charts. Normally, you would expect the user to print the chart using the toolbar button.However, if you want to print charts directly from your code you can do it with the PrintIt methodas follows:

ChartFX1.PrintIt 0,0

This method will print out to the default printer unless the hDC property in the printer object hasbeen changed with other installed printers.

Controlling Paper Orientation

The Orientation property allows you to set the paper orientation and you can set either Portrait orLandscape mode as follows:

ChartFX1.Printer.Orientation = ORIENTATION_LANDSCAPE , orChartFX1.Printer.Orientation = ORIENTATION_PORTRAIT

Note: All Printer object properties must be properly set before invoking the PrintIt method.

Color or B&W printing?

By default, Chart FX will detect if the default printer is a color printer. If it is the chart will print incolor, if not; Chart FX will print the chart in B&W hatched patterns. The property that controls thisbehavior is ForceColors.

The default setting of this property is FALSE. This means, Chart FX will automatically printhatched B&W patterns when the printer does not support colors, this will improve the chart'sreadability when printed.

This behavior is particularly useful, as you don't need to preset specific patterns to the series ifthe target printer is a B&W printer. Chart FX will automatically print in colors if the target printer isa color printer.

When this property is set to TRUE and the target printer is a B&W printer, the printer driver willmatch the chart colors to a specific grayscale pattern (not hatched). In some cases, the resultsare not desirable and will make the chart print out impossible to read.

Page 97: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

110

Tips & Tricks Printing ChartsImportant Note: ChartFX 98 provides a specific printing sample that will show you differenttechniques when printing charts. Please refer to the /Samples directory of your Chart FX98 installation directory.

Can I print 2 or more charts in the same page?

The Paint method is commonly used when you want to print more than one chart in a page orwhen you are working with a third party tool (e.g. Reporting Tool) that provides a Device Contextin which to place the charts.The following sample prints two charts in one page:

Sub PrintFillingPage ()Dim l, r, t, b As Integer 'left,right,top and bottomPrinter.Print ""px = Printer.TwipsPerPixelXpy = Printer.TwipsPerPixelYw = Printer.Widthh = Printer.Heightgap = 100 / pxt = gapb = ((h / 2) / py) - gapl = gapr = (w / px) - gap / 2ChartFX1.Paint Printer.hDC, l, t, r, b, CPAINT_PRINT, 0t = bb = (h / py) - gapChartFX1.Paint Printer.hDC, l, t, r, b, CPAINT_PRINT, 0Printer.EndDocEnd Sub

Page 98: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

111

How can I make the user select printers before printing the chart ?

If you want the end user to be able to use printers other than the default printers, you can use thePrinterDriver property or create an hDC with another printer information and use the hDCProperty exposed by the Printer object. Both techniques are illustrated in the following lines ofcode:

1) Using the PrinterDriver Property:

ChartFX1.Printer.PrinterDriver= "HP LaserJetIIISi,HPPCL5MS,LPT1:"

In Visual Basic, you can reference the Printer object to obtain valid settings for thisproperty. The DeviceName, DriverName and Port properties of the Printer object in VBallows you to set a valid setting for this property and at the same time selecting a differentprinter settings (that you may have setup using VB) to print the chart, as follows:

ChartFX1.Printer.PrinterDriver =Printer.DeviceName+","+Printer.DriverName+","+Printer.Port (VBonly).

To go back and print to the windows default printer you must set this property to NULL (or"") and make sure the hDC property is also set to NULL

2) Using the hDC Property

If you want, you can drop a CommonDialog object in your form and use the hDC propertyof the CommonDialog object as follows:

ChartFX1.Printer.hDC = CommonDialog1.hDC

To go back and print to the windows default printer you must set this property to NULLand make sure the PrinterDriver property is also set to NULL.

Excerpt from the VB 5 Documentation:

"The Windows operating environment manages the system display by assigning a devicecontext for the Printer object. You can use the hDC property to refer to the handle for anobject's device context. This provides a value to pass to Windows API calls.With a CommonDialog control, this property returns a device context for the printerselected in the Print dialog box when the cdlReturnDC flag is set or an informationcontext when the cdlReturnIC flag is set.Note The value of the hDC property can change while a program is running, so don'tstore the value in a variable; instead, use the hDC property each time you need it."

Although Chart FX provides a command to show the Print dialog before printing thecharts (See Toolbar and Commands), this property is very useful when your applicationpre-sets specific printer settings (using the VB Printer object) that you want allcomponents in your application to follow, so the end user does not have to select andchange the default windows printer every time a different component is printed.

Also, when you use the Chart FX Print dialog to setup specific printer changes, this dialogdisplays settings stored in the Windows default printer setting (Not the VB Printer object)so changes that you have made to the Printer object in VB will not be reflected when youshow the Chart FX Print dialog.

Page 99: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

113

Chart FX Programmer’s Guide

Customizing the Chart FX Tools

Topics covered in this section

IntroductionCustomizing the Chart FX Toolbar

The Data EditorThe PaletteBarThe PatternBarThe LegendBox

Page 100: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

115

Chart FX 98 Tools

Chart FX 98 tools are overlapped windows containing commands or information relating the chartbeing displayed. They are illustrated in the following figure:

These tools give end users the ability to interact with the chart more efficiently and accessfeatures without any additional programming efforts on your part. You, as a programmer, mayrestrict access or customize these tools as you please.

In this section you'll learn how to customize the Chart FX 98 tools and specifically the Chart FX98 Toolbar.

Page 101: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

116

The ToolBar & Menubar. Overview

One of the most useful tools in Chart FX is the toolbar, many programmers appreciate it becausethey don't need to add additional lines of code in their applications to give end users morefreedom to customize the chart.

Sometimes, customizing the toolbar becomes imperative as you don't want end users to access aparticular feature in it or you want to extend the original functionality provided by it, or you simplywant to change the tooltips the Toolbar buttons display. As a matter of fact there could bethousands of reasons why you want to modify the original Toolbar displayed by Chart FX.

In Chart FX 98, there is not just one way to access a command available in the toolbar. Forexample, to change the chart type, the end user may select the Gallery button in the Toolbar,MenuBar or right-clicking the marker and changing the gallery type, as depicted in the followingfigure:

This introduces an additional level of complexity as customizing the toolbar means customizingother tools that may display the same command as well. For example, if you don't want end usersto select an AREA chart, you may end up changing the Toolbar, the MenuBar, the right-clickmenu, or any other tool where the AREA button may appear.

For this reason, Chart FX 98 introduces the Commands object, which contains all commandsavailable in Chart FX and their definitions (picture, text, etc...) that all tools use to create anddisplay the user interface in Chart FX 98.

Another important object supported by the Chart FX 98 API is the ToolbarObj object that allowsa programmer to control toolbar positioning and removing or adding commands to the Chart FXToolbar.

Page 102: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

117

The following topics are covered in this section:

• What is the relationship between Commands and the ToolBarObj objects?

• Showing/hiding the Toolbar

• Positioning the Toolbar

• Removing or hiding Toolbar buttons

• Changing the command for a button

• Adding Toolbar Buttons

• Changing the ToolTips

• Changing Toolbar Icons

• Working with SubCommand Lists

• Working with Selectors

• Adding Custom (User) Commands

• Creating your own Toolbars

Relation between Commands & ToolbarObj objects

When customizing the Toolbar, it's really important that you understand the relationship betweenthe ToolbarObj and Commands objects.

When it comes to changing general settings in the Toolbar, like position and visibility. The

Page 103: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

118

ToolbarObj object exposes general properties that you can use to change these general visualattributes of the toolbar.

On the other hand, if you want to customize items (buttons) in the Toolbar many of the featuresyou may want to change (ToolTips, Picture, etc) are part of the Commands object as some ofthese will also be used in other tools in the Chart FX user interface. The role of the ToolbarObjobject and its properties when it comes to items in the toolbar, is just controlling the position,order and visibility of the buttons.

In the following figure, you'll see that for a particular button in the toolbar the Commands objectand not the ToolbarObj object control many of the important visible attributes like text, picture(icon), and style.

For this reason, in this section you'll see how we use the Command object and its propertiesextensively.

Page 104: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

119

Showing/Hiding the Toolbar

The ToolbarObj object exposes and property called "Visible" that allows you to show/hide theToolbar according to a boolean setting, as follows:

ChartFX1.ToolBarObj.Visible = True 'Shows the ToolbarChartFX1.ToolBarObj.Visible = False 'Hides the Toolbar

Please note that you can also use the Properties list and select the True or False setting atdesign time.

Positioning the Toolbar

The ToolbarObj object exposes several properties that allow you to position the toolbar in thechart's bounding rectangle. By default, the default position of the Toolbar is docked to the topmargin. However, by using the Docked property you can position the Toolbar anywhere in thechart.

For example, if you want to dock the ToolBar to the right margin programmatically, you can usethe Docked property as follows:

ChartFX1.ToolBarObj.Docked = TGFP_RIGHT

The Toolbar can also be positioned as a floating overlapped window that the user can movearound the desktop. This is particularly useful as it increases the charting area, but sometimesconfuses the end user so it must be used carefully. To convert the Toolbar to a floating toolprogrammatically, the Docked property must be set as follows:

ChartFX1.ToolBarObj.Docked = TGFP_FLOAT

Once you have the toolbar as floating window you can use the Left and Top properties to positionthe toolbar anywhere inside the chart area. Please be aware that, although a floating toolbar canbe moved anywhere in the desktop, these properties receive a setting in chart coordinates, so the(0,0) coordinate is in respect to the chart area.For example, to position a floating toolbar in the 15,30 coordinate, you can set the Left and Topproperties as follows:

ChartFX1.ToolBarObj.Left = 15ChartFX1.ToolBarObj.Top = 30

Page 105: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

120

Removing or hiding buttons in the Toolbar

You may want to remove buttons in the Toolbar or hide them as a result of a specific condition inyour application. For example, for one particular chart, you don't want the end user to switchbetween 2d/3d modes and therefore you may want to hide those buttons. Or if you don't want toallow users to save/open chart files you may want to remove those buttons from the Chart FXdefault toolbar.

Removing buttons

To remove items in the Toolbar, the RemoveItems method is provided so you can remove one ormore buttons in the Toolbar. When using this method, please be aware that those buttons will nolonger exists in the toolbar and all the indexes will be recalculated by Chart FX. For example, ifyou remove the first button in the toolbar with the RemoveItems method, the index of the secondbutton will become index 0, the index of the third button will become index 1, etc. To remove thefirst two buttons in the Toolbar, you may call the RemoveItems method as follows:

ChartFX1.ToolBarObj.RemoveItems 2,0

The RemoveItems method receives 2 parameters, the first parameter specifies the number ofbuttons to remove and the second parameter receives the position from where to start removingitems.

Also, be aware that separators count as additional toolbar items, so if you plan to remove severalbuttons and they are separated, you must count separators when calling the RemoveItemsmethod.

Hiding Buttons

Hiding items in the toolbar means accessing the Visible property provided by the Toolbar Itemobject. When you hide buttons in the toolbar, all indexes will be maintained, as the button will stillexists in the toolbar. Normally, hiding buttons is useful if you want to prevent the user fromaccessing that functionality as a result of a certain condition in your application. For example, fora particular chart, you don't want the end user to switch from 2D/3D mode, therefore, you maywant to hide the 3D button in the toolbar as follows:

ChartFX1.ToolBarObj(8).Visible = FALSE

Please note that the index of the button is provided without referencing the Item property. this canbe done, because the default property in the ToolBarObj object is the Item Property. This means,that the result from executing the following code will be exactly the same:

ChartFX1.ToolBarObj.Item(8) = FALSE

Page 106: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

121

Changing the command for a toolbar button

Chart FX exposes a wide variety of pre-defined commands that you can use to overwrite thefunctionality of buttons in the toolbar or to add new buttons to the toolbar that perform suchactions.

You can also assign a Custom Command to a toolbar button that you can process internally inyour application.

In this topic, we'll show you how to change the command assigned to any of the toolbar buttonswith a pre-defined Chart FX command. If you want to assign a custom command to a toolbarbutton, please refer to "Adding Custom Commands" later in this chapter.

The CommandID property allows you to easily overwrite the default action performed by a toolbarbutton with any of the pre-defined Chart FX commands. For example, the Print button in the ChartFX toolbar allows the end user to print the chart. This button does not prompt the user for a dialogwhere they can enter margins and other important print settings. Chart FX, however, provides apre-defined command that allows the user to specify these and other print settings.

In this sample we'll show you how to change the default behavior of the Print button so the usercan enter print settings before actually printing the chart.

The first thing you need to do is determine the index of the print button by counting from 0 to thebutton you want to change (including separators in the count). By doing this we can see that thePrint button is index 21 in the Chart FX Toolbar.

Next, we must locate the appropriate Chart FX command in the Chart FX pre-defined Commandslist, by doing this we know that the CFX_ID_PAGESETUP is the one that allows the end user toenter print settings.

Finally, we can use the CommandID property to change the command assigned to that button asfollows:

ChartFX1.ToolBarObj(21).CommandID = CFX_ID_PAGESETUP

Page 107: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

122

Adding buttons in the Toolbar

Sometimes, you may want to add additional buttons in the Toolbar. For this, the ToolBarObjexposes a method called AddItems, that allows you to add additional buttons to the toolbar thataccess existing Chart FX Commands or any custom command you may want to add to the ChartFX Toolbar.

In this section you will learn how to add buttons in the toolbar that access a pre-defined commandin Chart FX. If you want to add custom commands to the Chart FX Toolbar, please refer to the"Adding Custom Commands", later in this chapter.

Chart FX exposes a wide variety of pre-defined commands that you can use to overwrite thefunctionality of buttons in the toolbar or to add new buttons to the toolbar that perform suchactions.

When adding buttons to the Toolbar, please be aware that the Chart FX toolbar can handle up to32-items (including buttons and separators) so when adding buttons in the toolbar please becareful not to exceed such limit.

Let's suppose you have a chart where you don't want end users to switch among the vast array ofchart types available in Chart FX. Instead, you want them to access only Line, Area or BarCharts. To do this, you want to remove the Gallery Type from the Toolbar and add 3 additionalbuttons in the toolbar with the desired chart types, as depicted in the following figure:

The first thing you need to do is get rid of the gallery selector by using the RemoveItems method,covered in the "Removing/Hiding Toolbar items" chapter. The gallery selector is the third item inthe toolbar, so to remove it we can use the RemoveItems method as follows:

ChartFX1.ToolbarObj.RemoveItems 1,2

Now, with the Gallery selector removed from the Toolbar, we want to add 3 additional buttons inthe beginning of the toolbar with the chart types you want the user to access from the tolbar. Forthis, you can use the AddItems method as follows:

ChartFX1.ToolBarObj.AddItems 0,3

Please note that when you use the AddItems method, the indexes for other buttons in the toolbarwill be recalculated appropriately. In other words, because we have added 3 buttons at thebeginning of the toolbar, the index for the button that used to be in the first position is no longer 0but 3 and the buttons that we have added have the 0,1 and 2 index respectively.

Finally, we need to use the CommandID property to assign a pre-defined Chart FX Command tothe buttons we have added to the toolbar, as follows:

Page 108: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

123

ChartFX1.ToolBarObj(0).CommandID = CFX_ID_LINEChartFX1.ToolbarObj(1).CommandID = CFX_ID_AREAChartFX1.ToolBarObj(0).CommandID = CFX_ID_BAR

when you run this code, the Chart FX Toolbar will look like:

Important Note:

Modifying just the Toolbar is no guarantee that the end user can only switch to those 3 charttypes. The above example, shows how to use the Additems method to add buttons to the toolbar.If you really want to prevent the end user from switching to other chart types, you have to modifythe Commands list appropriately so those chart types may not be accessed from another tool inthe Chart FX UI. This topic will be covered in detail later in this section.

Page 109: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

124

Changing the ToolTips

The tooltip is a text that appears when the user positions the mouse over any button in theToolbar. This is very helpful as it informs the end user about the functionality of the button withoutactually pressing it and performs the action.

You may think this tooltip is part of the ToolBarObj. However, this text is also used in other partsof the Chart FX UI and therefore is controlled by the Commands object. This means that whenyou change the tooltip (or text) associated with a particular command, this change will beconsistent through out the Chart FX UI.

Therefore, when changing the Tooltip for a particular button in the toolbar, you must be carefulnot to assign long strings to it as this text will be used and displayed somewhere else (e.g. theChart FX MenuBar shows this text as the menu item).

In order to show tooltips the ToolTips property in the ToolBarObj object must be enabled asfollows:

ChartFX1.ToolBarObj.ToolTips = TRUE

To change the tooltip associated with a particular command, you must first locate the commandID in the Chart FX pre-defined commands list. For example, if we want to change the Tooltip forthe Gallery selector in the Chart FX Toolbar, we notice that the ID associated with the commandis CFX_ID_GALLERY. Once we have the ID we can use the Text property in the CommandsObject as follows:

ChartFX1.Commands(CFX_ID_GALLERY).Text = "Chart Types"

Once you have changed the text associated with a particular command, the Chart FX UI willreflect that change in the ToolBar, The MenuBar, The Menus-On-Demand, etc.Please remember to change the tooltips if you're localizing your application to other languages.

Page 110: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

125

Changing Toolbar Icons

The icons used in the toolbar are also used by other Chart FX tools, therefore they are controlledby the Commands object and when you change an icon for a particular command, that changewill be reflected in other tools that allow access to that command.

For example the Data Editor icon is used in the Toolbar as well as the Right click menu, whenyou change the Icon associated with the Data Editor command, both tools will reflect that change,as depicted in the following figure:

You can change the icon for a particular command by choosing a pre-defined icon from theCommands picture or by adding new icons to the Commands picture. In this topic we'll show youboth techniques:

Selecting from a predefined icon

Chart FX provides a pre-define list of 16x15 icons that you can use to easily change a defaulticon in the Chart FX user interface. To do this, you can use the Picture property in the Commandsobject. This property receives the command id (from the pre-defined commands list) and the pre-defined icon index.

The pre-defined list of icons looks like:

So to change the Data Editor icon with the 10th icon in the list the code should look as follows:

ChartFX1.Commands(CFX_ID_DATAEDITOR).Picture = 9

Adding or replacing icons in the list

Page 111: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

126

Although selecting an icon from the pre-defined list is not particularly useful (as most of them areactually used by other Chart FX commands). You can use the AddPicture or ChangePicturemethods to add or replace icons in the pre-defined list of icons, respectively.

The AddPicture method is particularly useful when you are adding custom commands to theChart FX UI. This method will append one or more icons to the pre-defined icons list that you canuse to assign to existing or new commands.

The ChangePicture method is particularly useful if you want to change icons that are currentlybeing used by Chart FX as it will allow you to replace all or part of the existing icons list.A very important issue is that each must have 16x15 pixels and if you are adding or replacingseveral icons at the same time, you must make sure there are no separation between them.

Because, both methods (AddPicture and ChangePicture) take a Picture object, you must create apicture object in your form and load the resource into that picture object.

AddPicture Sample

If you have loaded 2 new icons in a Picture object named Picture1 and you want to append suchicons in the icons list and use the first appended icon to change the icon associated with the"Data Editor" command and the second appended icon to replace the icon for the "Save Chart"command. The AddPicture icon will return the position in which the icons were appended so youcan use this as a reference when assigning the picture to the command, so your code will look asfollows:

nIndex = ChartFX1.Commands.AddPicture Picture1.PictureChartFX1.Commands(CFX_ID_DATAEDITOR).Picture = nIndexChartFX1.Commands(CFX_ID_EXPORTFILE).Picture = nIndex+1

ChangePicture Sample

If you want to replace some or all icons currently used by Chart FX you will use theChangePicture method which will replace one or more icons in the icons list. Please note thatChart FX uses icons in a particular order as depicted in the following figure:

This means, if you have loaded two Picture objects, Picture1 that contains 1 16x15 icon that willbe used to replace the 2D/3D icon and Picture2 that contains 2 icons that will be used to replacethe icons used to show/hide horizontal vertical gridlines, you must invoke the ChangePicturemethod twice, as follows:

ChartFX1.Commands.ChangePicture Picture1.Picture,4ChartFX1.Commands.ChangePicture Picture2.Picture,8

Please note in the sample shown above that index 4 (zero based) corresponds to the 2D/3Dimage icon and index 8 (zero based) corresponds to the Vertical Gridlines icon.

Page 112: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

127

Working with SubCommands

Although most buttons in the Chart FX user interface (ToolBar, MenuBar, etc) perform a specificaction when pressed, there are other buttons that when pressed present a list of subcommandswhere the user can choose from. For example, the Tools button in the Chart FX Toolbar presentanother list that allows the user to select which tools he wants to show in the chart area, asdepicted in the following figure:

These are called sub commands lists and you can create or modify existing subcommands lists inthe Chart FX user Interface. For this purpose, the Commands object exposes theSubCommandID property and the RemoveSubCommand and RemoveAllSubCommandsmethods.

Removing existing subcommands

In the figure shown above, you can see how the CFX_ID_TOOLS command present a list ofsubcommands that allow the end user to select which tools they want to show in the chart area.Let's suppose you don't want the end user to access the Data Editor from teh Toolbar, you caneasily remove the Data Editor option from the subcommand list by invoking theRemoveSubCommand method as follows:

ChartFX1.Commands(CFX_ID_TOOLS).RemoveSubCommand 2

Please note that when you remove a particular sub-command from the subcommand list, theindexes will be shifted to the actual number of subcommands available in the command. Forexample, when you remove the Data Editor sub command the Toolbar will be index 2, ThepaletteBar will become index 3 and so forth.

By removing a subcommand from the list you will also remove this option from other tools thatmay use the same command id.

Adding SubCommands to a list

To add a subcommand to a list you will use the SubCommandID property. If you are addingsubcommands to a specific command you must make sure to keep the indexes in order as non-consecutive indexes may cause unpredictable results.

This feature is particularly useful when you are working with custom commands. So please referto the "Adding Custom Commands" chapter where we show a custom command that containsseveral subcommands.

Page 113: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

128

Working with Selectors

A selector is a command that contains a list of subcommands that when pressed a list of images(icons) will be shown so the user can make a selection and when closed the selector will showthe current selection. In Chart FX, the gallery icon in the toolbar is a selector as shown in thefollowing figure:

Because a selector is a command with a list of subcommands, the API explained in the "Workingwith SubCommands" topic also applies to selectors.

The only notable difference between selectors and regular subcommand lists is that the style forthe subcommand has been set to CBIS_SELECTOR. For more information on controlling thestyle for a particular command, please refer to the Style Property in the commands object.

Page 114: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

129

Adding Custom Commands

In previous topics you learned the API provided by the ToolbarObj and Commands objects toadd, remove or modify the Chart FX pre-defined list of commands. This was useful, as you wereable to customize the default Chart FX Toolbar, by removing existing commands, changing theicons and other important aspects related to the Chart FX User Interface.

Chart FX 98 not only allows customization of the default toolbar with pre-defined Chart FXcommands, but it allows you to add custom commands that you can process internally in yourapplication.

Let's say, for example, you want to add a button in the Chart FX toolbar that when pressed loadsanother chart with new data and new visual attributes. It is clear that Chart FX will not provide thisfunctionality as a pre-defined command because it will not know how to react when end usersactually press such button. Therefore, you'll need to add a custom command that will post anevent to your application so you can add your code.

As a matter of fact, you not only can create custom buttons but groups of buttons, lists, selectorsand even new toolbars that will look seamlessly integrated to the chart displayed in yourapplication. This section explains the necessary steps to add custom commands to the Chart FXUser Interface.

Adding a custom command to the toolbar means completing its attributes in the Commandsobject and then use the properties and methods provided in the ToolBarObj object to physicallyadd (or replace) that button in the toolbar.

Please follow these steps to add a custom command to the Chart FX Toolbar:

1) Adding the Command ID to the Chart FX Commands list

The very first step to add one or more custom commands to the Chart FX UI is to add their IDs tothe Chart FX Commands list. You do this with the AddCommand method supported by theCommands object.

The ID is an integer that you will use to identify the command when the user press or interactswith it. This is a unique ID that will be associated to the custom command and no other customcommand may have the same ID. Chart FX defines its pre-defined IDs between CFX_ID_FIRST(29440) and CFX_ID_LAST (29951), so please make sure you don't use a number in this rangeas it will cause unpredictable results.

You can add a custom command with ID 4 as follows:

ChartFX1.Commands.AddCommand 4

2) Setting the visual attributes of the Custom Command

Once the Command ID has been added to the list, you must instruct Chart FX how to display thiscommand in the UI (is it a button or a list?, what icon is it going to use?, what text is it going todisplay?, is it enabled?). There is a property for each particular attribute in the commands objectas follows:

Style. The Style property allows you to tell Chart FX if the command you're adding is atwo-state button,a list, a selector or that the command belongs to a group. If you don't set

Page 115: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

130

the Style property the custom command is added as a regular button. If you want tocreate a two-state button you can set the Style property as follows:

ChartFX1.Commands(4).Style = CBIS_TWOSTATE

Please note how we use the ID assigned in step 1.

Picture. The Picture property allows you to specify the icon to be used in the button.Please note that youc an add your own buttons as described in the "Changing/Addingicons" topic.

Text. The Text property allows you to set the tooltip to be displayed or the text if thecommand is to be shown in the menubar. For example to set a new tooltip to the buttonyou can set the Text property as follows:

ChartFX1.Commands(4).Text = "New Command"

3) Adding the Custom Command to the Toolbar

To add the command id 4 to the Toolbar, you can use the AddItems method and the CommandIDproperties exposed by the ToolBarObj object, as follows:

'Let's add a new button in the 4th position of the ToolbarChartFX1.ToolBarObj.AddItems 1,3'Now let's assign the command id to added buttonChartFX1.ToolBarObj(3).CommandID = 4

4) Processing the Custom Command

Now that you have added a Custom command to the Chart FX Commands List and the buttonhas been added in the Toolbar you need a mechanism to add your custom code that processesthat particular command. The UserCommand Event is posted to your application when the userclicks or interacts with the custom command you have added. So if you want to display amessage box with the ID of the custom command when the user presses the button you willprocess the UserCommand event as follows:

Private Sub ChartFX1_UserCommand(ByVal wParam As Long, ByVal lParam AsLong, nRes As Integer)MsgBox "User Command:" + CStr(wParam)End Sub

Page 116: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

131

Creating your own Toolbar

Although we have based this entire section on the Chart FX Toolbar (ToolBarObj object), you cancreate additional toolbars that may contain Chart FX commands as well as custom commands.

This feature allows an additional level of customization as you may create for example a Toolbarthat only handles Chart FX Chart Types and another Toolbar that handles 3D effects and so forth.To create a new toolbar you can use Visual Basic's New keyword that enables implicit creation ofan object as follows:

Dim MyTool As New ToolBar

Or you can also use the CreateObject function as follows:

Set MyTool = CreateObject("SfxBar.ToolBar")

Once you have created the new Toolbar and you have its handle in variable (in this case calledMyTool). This variable inherits all the properties available in the ToolBarObj object.

An important issue when you create a Toolbar is that this Toolbar is initialized with an emptyCommands list and no buttons. Therefore, you have two options:1) Creating a new Toolbar with some of the Chart FX pre-defined commands

If the new toolbar will contain some of the Chart FX pre-defined commands, you can easily assignthe Chart FX Commands list to this new toolbar as follows:

MyTool.Commands = ChartFX1.Commands

Please note that when you assign the Chart FX commands list to the newly created toolbar, thereare still no buttons in the new Toolbar, you just specified that the list of commands is the same asChart FX.

You must then start calling the AddItems method and CommandID property to create buttons inthe newly created toolbar (MyTool), as follows:

'For example to add 3 buttons to MyToolMyTool.AddItems 3, 0'To assign the commands they will accessMyTool(0).CommandID = CFX_ID_GALLERYMyTool(1).CommandID = CFX_ID_3D'Now let's assign a custom commandMyTool(2).CommandID = 4

Please note how the MyTool object inherits the properties and methods exposed by theToolbarObj object, and the way to access them is without the Chart name.

Page 117: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

132

2) Creating a Toolbar from scratch

If the new toolbar (MyTool) will contain only custom commands as explained in the "AddingCustom Commands" section, you will use the AddComand method to create the new commandslist containing all proprietary IDs and then use the AddItems method to create toolbar items andassign with the CommandID property the IDs of the command list you have created. For example,if MyTool will only contain 2 buttons that perform a custom command, your code will look like:

'Create the Commands list from scratch by adding two new customcommandsMyTool.Commands.AddCommand 10MyTool.Commands.AddCommand 11'Set the Commands Picture with a custom image (Refer to AddingPictures)MyTool.Commands.AddPicture Picture1.Picture'Set the icon of each custom commandMyTool.Commands(10).Picture = 0MyTool.Commands(11).Picture = 1'Set the text of each custom commandMyTool.Commands(10).Text = "Command 1"MyTool.Commands(11).Text = "Command 2"' Finally Add two new buttons in the new toolbarMyTool.AddItems 2,0' Assign the CommandID to the new buttonsMyTool(0).CommandID = 10MyTool(1).CommandID = 11

Finally, you must use the AddBar method to let Chart FX know that a new toolbar exists, and usethe Visible property to show the newly created toolbar in the chart window as follows:

ChartFX1.AddBar 3,MyToolMyTool.Visible = TRUE

Please note the AddBar method receives as first parameter a unique identifier for the Toolbar youhave added to Chart FX. This ID is used when you want to obtain the handle of the newly createdToolbar by using the GetBar method or to remove the Toolbar by using the RemoveBar method.This prevents the MyTool variable to be global as you only need to remember the ID of theToolbar and later on Obtain the handle or Remove it using the GetBar and RemoveBar methods,respectively.

As with any Chart FX ID, the ID you use in the AddBar method must not be betweenCFX_ID_FIRST (29440) and CFX_ID_LAST (29951).

Page 118: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

133

DataEditor Object

Chart FX 98 provides a spreadsheet called "Data Editor" that allows users to see the datacontained in the chart in tabular format. It also allows the user to modify any legend or valuecontained in the chart (if allowed by the programmer).

As another Chart FX 98 tool, the Data Editor also allows floating and docked styles so the enduser can control the position and different styles of the Data Editor in the chart area.

The DataEditorObj object controls the Data Editor. With this object you can control the position,colors and other important aspects of this important tool in the chart. For example, if you want toshow the Data Editor and position it in the top portion of the chart, you can use the DataEditorObjas follows:

ChartFX1.DataEditorObj.Docked = TGFP_TOPChartFX1.DataEditorObj.Visible = True

Please refer to the Chart FX API electronic help file located in the \help directory of the Chart FXInstallation directory.

Page 119: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

134

PaletteBar Object

Chart FX 98 provides a tool called the PaletteBar that allows end users to Drag&Drop colors ontochart elements or change the entire chart palette from a dozen of schemes provided by Chart FX98.

As other Chart FX 98 tools, the PaletteBar can be docked to a margin or float in the chart area.The PaletteBar object support properties that allow you to configure its position and style whendisplayed in the chart area.

The PaletteBarObj object controls the Palette Bar. With this object you can control the position,and other important aspects of this important tool in the chart. For example, if you want to showthe Palette Bar and position it in the top portion of the chart, you can use the PaletteBarObj asfollows:

ChartFX1.PaletteBarObj.Docked = TGFP_TOPChartFX1.PaletteBarObj.Visible = True

Please refer to the Chart FX API electronic help file located in the \help directory of the Chart FXInstallation directory.

Page 120: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

135

PatternBar Object

Chart FX 98 provides a tool called the PatternBar that allows end users to Drag&Drop patternsonto chart elements. Patterns can be B&W or colored depending on the Scheme property setting.

As other Chart FX 98 tools, the PatternBar can be docked to a margin or float in the chart area.The Pattern object support properties that allow you to configure its position and style whendisplayed in the chart area.

The PatternBarObj object controls the Pattern Bar. With this object you can control the position,and other important aspects of this important tool in the chart. For example, if you want to showthe Pattern Bar and position it in the top portion of the chart, you can use the PatternBarObj asfollows:

ChartFX1.PatternBarObj.Docked = TGFP_TOPChartFX1.PatternBarObj.Visible = True

Please refer to the Chart FX API electronic help file located in the \help directory of the Chart FXInstallation directory.

Page 121: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

136

LegendBox Object

The Legend box object is used to display legends associated with data points (not series) and it isnecessary to improve the chart's readability in charts like PIE, DOUGHNUT and PYRAMID wherethere's no axis, but point labels are still necessary in the chart.

As with other Chart FX 98 tools, the Legend box can be docked to a margin or float in the chartarea.

If you want to show series legend in the chart area, please refer to the SerLegBox object.

The LegendBoxObj object controls the window that displays the legend values in the chart.Normally, these labels are displayed within the axis itself. However, there are chart types that donot display any axis and this window is very important to improve the chart’s readability. With thisobject you can control the position, and other important aspects of this important tool in the chart.For example, if you want to show the Legend Box for a Pie chart and position it in the right portionof the chart, you can use the LegendBoxObj as follows:

ChartFX1.LegendBoxObj.Docked = TGFP_RIGHTChartFX1.LegendBoxObj.Visible = True

Please refer to the Chart FX API electronic help file located in the \help directory of the Chart FXInstallation directory

Page 122: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

137

SerLegBox Object

The series legend can be displayed docked to any margin in the chart, or if you prefer, you canhave it as a floating window or fixed at a certain position inside the chart area. The SerLegBoxobject provides all properties related to position and style of the Series Legend in the chart area.

In multiple series chart it is customary to add a box containing descriptions for the seriesdisplayed in the Chart. If you have assigned series legend using the Series object or the SerLegproperty, you can control the Series Legend Box with the SerLegBoxObj object. With this objectyou can control the position, and other important aspects of this important tool in the chart. Forexample, if you want to show the series legend and position it in the left portion of the chart, youcan use the SerLegBoxObj as follows:

ChartFX1.SerLegBoxObj.Docked = TGFP_LEFTChartFX1.SerLegBoxObj.Visible = True

Please refer to the Chart FX API electronic help file located in the \help directory of the Chart FXInstallation directory

Page 123: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

139

Chart FX Programmer’s Guide

RealTime Charts

Topics covered in this section

OverviewPassing Data in Real-Time

Scrolling Legends

Page 124: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

141

RealTime Charts. Overview

Chart FX supports True Realtime Charting capabilities, by giving specific functions, which supportChart scrolling in a very fast painting mode (without flickering). To prevent data overflow Chart FXintroduces Real Time Charts with an specific maximum number of points which will allow thelibrary to accept up to that number and after you insert or set a new value to the chart the first setvalue is lost.

Chart FX supports two different Real Time Charts:

1) Limited Real Time: Which are charts that have a maximum values of points (previouslyallocated buffer). This type of charts are the fastest available in Chart FX, since they allocatememory only once (when you call MaxValues property). which means that the chart will have themaximum setting until it begins to lose points (i.e. setting 15 as the maximum number of pointsmeans that you will lose point 1 when passing value for point 16).

If losing previously passed points is not important we suggest you use this type of charts for RealTime purposes when having a fast data input rate.

Two variations of this kind of chart are also available in Chart FX:• Standard: When the buffer is full (You have reach the max value limit) and you insert new

point, the data will "scroll" so you will lose the first point and the nth point will become the nth-1.

• Loop Position: Same as Standard but every time you set a new value a customizablevertical line will pass through the point that is being changed "Last acquired point" whenreaching the end of the data set this Looping marker will move to the beginning

2) Unlimited Real Time Charts: These type of charts can add points to the existing ones withoutlosing any of the previous one. Also, you may choose if the chart will scroll every time it receivesa new point, so you can see the last acquired data. This is to allow you to set if the chart willautomatically scroll depending on the context of your application.

In the following pages we will cover:How to Create and pass data to a Real Time Chart?Setting the Real Time Style.Customizing the Loop Marker

Page 125: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

142

Creating and Passing data to Real Time Charts.

A sample project of a Realtime chart have beenincluded in you Chart FX samples directory (realtimesub-directory)

To create a Real Time Chart you must follow these steps: • Set the CT_EVENSPACING to the chart type using the Type property (either at design or

running time).

• Set the MaxValues property to an specific number of points if you want to create a LimitedRealTime chart (strongly suggested!).

• call the RealTimeStyle property to select the Real Time Style you want (Basically showing ornot the Loop marker and hiding the hourglass cursor).

• Open the communication channel (OpenDataEx Method) to the RealTime Chart using theCOD_ADDPOINTS combined with COD_VALUES. This will cause the pointers to the dataarray be relative to the last point added previously, so you don't have to remember neither thenumber of points the chart currently has nor the index of the last point passed.

• Set the corresponding value of the new points using an offset instead of an absolute index tothe points. These means that if you want to add two (2) new points to the chart (before theCloseData method) you must use index 0 and 1 for the point index in the Value Property.

• Call the CloseData method with a combination of COD_VALUES with any of the followingconstants:

COD_REALTIME Chart FX will not scroll to the end of the data set.COD_REALTIMESCROLL Chart FX will scroll the chart to the end of the data set.

The following sample supposes that you have a timer that calls our application with two newvalues every second, so the idea is to include these points in a chart in RealTime mode:

‘Preparing the chart to be RealTimeChart1.Type = Chart1.Type Or CT_EVENSPACING‘Setting a buffer size of 50 pointsChart1.MaxValues = 50‘Add a Loop marker and hiding the hourglass cursorChart1.RealTimeStyle = CRT_LOOPPOS Or CRT_NOWAITARROW...‘Finally when the timer calls set the new dataChart1.OpenDataEx COD_VALUES Or COD_ADDPOINTS,1,2‘Set two new points of series 1

Chart1.Value(0) = Rnd * 100Chart1.Value(1) = Rnd * 100

‘Close the channel forcing scrollChart1.CloseData COD_VALUES Or COD_REALTIMESCROLL

Note

Page 126: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

143

Setting the Real Time Style

The RealTime style refers to how the chart is going to be display in your application. Basically thetwo different settings available to this feature are showing the Loop Marker and hiding thehourglass cursor from the RealTime Chart.

The property related in the VBX model is RealTimeStyle. This property is used to get/set theRealTime style of the chart.

Setting can be a combination of:CRT_LOOPPOS Show Loop MarkerCRT_NOWAITARROW Hide HourGlass cursor

For example, To set both styles:Chart1.RealTimeStyle = CRT_LOOPPOS Or CRT_NOWAITARROW

Customizing the Loop Marker

The Loop Marker can be customized using the “ItemColor”, “ItemWidth” and “ItemStyle”properties using the CI_LOOPPOS index.

Page 127: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

144

Scrolling the X axis legends in RealTime mode.

If you’re working with a Realtime chart and also assigning legends to the points in the X axis, it isimperative that you scroll these legends in order to have your Realtime charts the appropriatelegends every time it receives new data.

In the samples subdirectory you will find a Realtimesample that scroll the legends every time the chartreceives new information.

In order to scroll the x axis legends in the DLL model you must follow these rules:

• Include in “TypeEX” property the CTE_NOLEGINVALIDATE constant.

• Open the communication channel (OpenDataEx method) in combination with theCOD_ADDPOINTS constant (you must always do this when working with RealTime charts).

• Set the value for the new point using the relative position in the Value property and haveready the legend that you want to assign to that new point.

• If you’re setting a BufferSize (Limited RealTime charts) with the MaxValues property you willneed to erase the first legend every time you receive a new point and the chart alreadycompleted its first cycle reaching the Max values limit.To erase the first legend you use theLegend property and set chr(1) to the Index 0.

• After erasing the first legend you can set the new legend (also with the Legend property)including in the Index the MaxValue-1*** (for a 50 point buffersize you will set point legendno. 49, remember that all indexes in Chart FX are zero based), and the setting containingsuch legend.

• Finally, in the CloseData Method include the COD_SCROLLLEGENDS constant to forceChart FX to scroll the legends.

• Note: scrolling legends does not apply when having the Loop marker on in your RealTimechart.

If you are not working with a buffersize assigned to yourrealtime chart (Max Values assigned) you must use theactual number of points in order to set the last pointlegend.. You can read the nValues property and set thelegend using the nValues-1 index instead of theMaxValues-1 index

Note

Note

Page 128: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

145

Chart FX Programmer’s Guide

Open Painting Architecture

Topics covered in this section

Customizing Chart Painting. OverviewCPI Constants

PrePaint samplePaintMarker Sample

Page 129: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

147

Customizing Chart Painting

In order to customize the chart painting you must be familiarizedwith the different objects in the Windows API (such as: pen andbrushes). Therefore, if you’re a novice windows developer oryou’re not familiarized in handling these objects in the Windowsenvironment we suggest you refer to the Windows 32 SDK.

When customizing the chart paint process you, as a programmer, are able to capture threedifferent events (notification messages) and different methods and properties that will allow you toplace any object in the chart window (whether it is in the chart background or on top of the chart).These objects can be fonts, rectangles, circles, arrows, bitmaps and even proprietary objects thatyou had created and know how to handle them appropriately (painting procedure) in any devicecontext.

With this open architecture Chart FX provides virtually any kind of customization that you willneed in your applications.

Due to this fact, in this section we will describe the process of customizing the chart painting withspecific samples. Nevertheless, depending on your application you may want to use themdifferently.

You will receive three different notification messages as explained in the following diagram:

PrePaint event:This event is sent before thechart is painted. Therefore, itis very useful for customizingthe chart background. If youwant place a gradientbackground or want to place aspecial picture or bitmap in thebackground chart this is theplace to do it. Although thechart is not yet painted all thecalculations for the markersand axis of the chart areavailable (CPI_*). please referto following pages.

PaintMarker event:This event is sent every time amarker is being painted. Thisevent is very useful when youwant to highlight certaininformation in your chart. Youwill be able to place any objectyou want highlighting themarker that is being painted.Also in this event all thecalculations for the markersand axis of the chart areavailable (CPI_*). Please referto the following pages for moreinformation.

PostPaint event:After the chart finishespainting another event isposted for furthercustomization. This event isvery useful when you want tomake final touches to thechart, like adding arrows,placing other fonts andgeneral make-up to the finalchart. Also in this event allcalculations for the markersand axis (CPI_*) are stillavailable. Please refer tofollowing pages for moreinformation.

Note

Page 130: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

148

Obtaining pertinent information when customizing chartpainting.

When placing your objects you may want to know the location of the different items that are to bepainted in the chart. For example, in order to highlight the point 4 in the chart you must knowwhere this point is (coordinates) in order to be able to enclose it in a rectangle. The PaintInfomethod with the appropriate CPI_* constant is used for this purpose.

CPI Constants.-

CPI_GETDC:

Description: Get the Device Context of the chart so you can paint anything on it.Important: If you are calling this info and you are not within paint events (PrePaint, PostPaint, PaintMarker) you must call the CPI_RELEASEDC when you finish using it

lSetting: Read-OnlyReturn Value: Device context (HDC)

CPI_ RELEASEDC:

Description: Release the chart device context.lSetting: hDC returned in the CPI_GETDCReturn Value: Write-Only

CPI_MARKERTOPIXEL:

Description: Transform the correspondent nSerie-nPoint to coordinates relative to the chart window.

lSetting: LOWORD = nSerieHIWORD = nPointSetting nSerie to -1 willobtain center of that marker.Return Value: LOWORD = XHIWORD =Y

CPI_POSITION

Description: Retrieves the upper-left corner of the chart.lSetting: Read-OnlyReturn Value: LOWORD = left HIWORD = topThis values are ZERO if the chart is

being painted in the screen in a standard paint event.

CPI_DIMENSION

Description: Retrieves the Width and Height of the chart (In pixels)lSetting: NONEReturn Value: LOWORD = Width HIWORD = Height

Page 131: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

149

CPI_PRINTINFO

Description: This code is used when you want to know if the chart is being printed or you want to convert a value to printer resolution.

lSetting: NONE if you only want to know if the chart is being printed or a pixel value to be converted to printer coordinates.

Return Value: LOWORD=Page being printed, 0 = not being printed. HIWORD=Converted value in printer coordinates

CPI_SCROLLINFO

Description: Retrieve the actual position of the scroll and the number of points per scroll page

lSetting: Axis IndexReturn Value: LOWORD=Actual Pos.HIWORD=Maximum.

CPI_3DINFO

Description: Retrieve the depth of each marker and total depth of the chart (Z axis dimension).

lSetting: Read-OnlyReturn Value: LOWORD = Marker DepthHIWORD = Total chart depth (Z axis)

CPI_3DTO2D

Description: Convert a coordinate from 3D to 2D.lSetting: Pointer to a CHART_P3D structureReturn Value: LOWORD = 2D X-Coordinate HIWORD = 2D Y-Coodinate

Page 132: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

150

PrePaint Event Sample

The following code places a gradient background underneath the chart by processing thePrePaint event and using the Windows API to draw the background:

The following code must be placed in the PrePaintevent. You can find a sample project containing thiscode in the samples subdirectory.

' Draw gradient backgroundhDeviceC = ChartFX1.PaintInfo(CPI_GETDC)' get the chart position (useful when printing or using chart_paint)lPos& = ChartFX1.PaintInfo(CPI_POSITION)x = CHART_LOWORD(lPos&)y = CHART_HIWORD(lPos&)hOldPen% = SelectObject(hDeviceC, GetStockObject(NULL_PEN))nHeight% = (h / 20) + 1nWidth% = (w / 20) + 1h = h + yw = w + xFor i = 0 To 9

l& = RGB(255 - (i * 20), 255 - (i * 20), 100)hBrush% = CreateSolidBrush(l&)hOldBrush% = SelectObject(hDeviceC, hBrush%)l& = Rectangle(hDeviceC, x + nWidth% * i, y + nHeight% * i, w -(nWidth% * i) + 1, h - (nHeight% * i) + 1)hOldBrush% = SelectObject(hDeviceC, hOldBrush%)hBrush% = DeleteObject(hBrush%)

Next ihOldPen% = SelectObject(hDeviceC, hOldPen%)ChartFX1.PaintInfo CPI_RELEASEDC, hDeviceC

Note

Page 133: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

151

PaintMarker Event Sample

The following code detects which points in the chart are greater than 50 and then encloses in arectangles such points:

As we mentioned, this event is very useful when you want to highlight or make-up differentmarkers (points, bars, etc.) in the chart. This event is sent every time a marker is going to bepainted, so you can retrieve important information (such as in what position the marker is beingpainted) to customize the different markers in the chart.

The following code must be placed in the PaintMarkerevent. You can find a sample project containing thiscode in the samples subdirectory.

ChartFX1.ThisSerie = nSerief# = ChartFX1.Value(nPoint)If f# > 50 Then

nRadio% = 3 * ChartFX1.MarkerSizel& = nRadio%l& = ChartFX1.PaintInfo(CPI_PRINTINFO, l&)If l& Then

nRadio% = CHART_HIWORD(l&)End IfhDeviceC = ChartFX1.PaintInfo(CPI_GETDC)hOldBrush% = SelectObject(hDeviceC, GetStockObject(NULL_BRUSH))i = Rectangle(hDeviceC, x - nRadio%, y - nRadio%, x + nRadio%, y+ nRadio%)hOldBrush% = SelectObject(hDeviceC, hOldBrush%)ChartFX1.PaintInfo CPI_RELEASEDC, hDeviceC

End If

Note

Page 134: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

153

Chart FX Programmer’s Guide

Chart FX UI Cross Reference

Topics covered in this section

General DialogSeries Dialog

Axis DialogAxis Scale Dialog

Axis Labels DialogAxis Gridlines Dialog

3D Effects DialogConstants & Stripes Dialog

Data/Behavior DialogCommands DialogExtensions Dialog

Page 135: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

155

General DialogThis dialog allows you to set general settings in the chart, like 3D Stacked styles, Major UnitGridlines and Colors for the chart.

1) This option allows the user to switch from 2D/3D views. You can do this programmatically:

ChartFX1.Chart3D = True / False

2) When displaying a clustered chart, each series will have its own position in the z axis. Thismeans, if you have a 3 series chart and this property is turned on, each data series will occupyone row of data and there will be 3 rows (z-axis clusters) in the chart. You can do thisprogrammatically:

ChartFX1.Cluster = True / False

3) This option allows the user to stack all series in the chart. You can do this programmatically:

ChartFX1.Stacked = True / False

Note: You can also stack series by pairs with the Stacked property provided by the Series object

4) This option allows the user to change the axis drawing style. You can do thisprogrammatically:

ChartFX1.AxesStyle = CAS_MATH (other settings are available)

Page 136: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

156

5) This option allows the user to draw vertical and/or horizontal gridlines. You can do thisprogrammatically:

ChartFX1.Grid = CHART_HORZGRID Or CHART_VERTGRID

Note: the Axis Object provides More properties related to grids

6) This option allows the user to change the entire chart palette. This will affect all elements inthe chart. You can do this programmatically:

ChartFX1.Palette = “Dark Pastels”

Note: The Chart FX 98 palettes are deployed as a registry entry on the client machine, so if youuse this property in your application, you must make sure the palettes are properly deployed andregistered in the client machine. For more information please refer to "Deployment Issues" topic

7) This option allows the user to change the color scheme for markers. You can do thisprogrammatically:

ChartFX1.Scheme = CHART_CSPATTERN

Note: This option allows the user to change from solid to hatched patterns. B&W is alsosupported.

8) This option allows the user to set a color for the chart box. This is the background where themarkers are enclosed. You can do this programmatically:

ChartFX1.RGB2dBk = RGB(255,0,255) ‘ For 2D ChartsChartFX1.RGB3DBk = RGB(255,0,0) ‘ For 3D Charts

9) This option allows the user to set a color for the background. This background is the boxwhere the chart is enclosed. You can do this programmatically:

ChartFX1.RGBBk = RGB(255,0,255)

Note: You can also assign a Background picture using the BkPicture Property.

10) This option allows the user to set a Top Title for the chart. You can do this programmatically:

ChartFX1.Title(CHART_TOPTIT) = “My Top Title”

Page 137: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

157

Series Dialog (<<All Series>> is selected)This dialog allows you to set specific settings, including visual attributes for series in the chart.When the <<All series>> is selected in the ComboBox. Settings will apply to all series in the chartand the property set is different if a specific series is selected. Therefore, we are including 2different screen shots for this particular dialog.

1) This option allows the user to change colors for series. You can do this programmatically:

ChartFX1.Color = RGB(255,0,255)

Note: You must use the OpenDataEX and CloseData methods.

2) This option allows the user to show borders for series. You can do this programmatically:

ChartFX1.Border = True/False

3) This option allows the user to change the border color. You can do this programmatically:

ChartFX1.BorderColor = RGB(255,0,255)

4) This option allows the user to change the border LineStyle. You can do this programmatically:

ChartFX1.LineStyle = CHART_DASH

Page 138: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

158

5) This option allows the user to change the border line width. You can do this programmatically:

ChartFX1.LineWidth = 3

Note: In Windows 95/98, the LineWidth may not be combined with a line style different than solid.

6) This option allows the user to change the chart type. You can do this programmatically:

ChartFX1.Gallery = AREA

7) This option allows the user to change the space allotted for each marker. You can do thisprogrammatically:

ChartFX1.Volume = 50

) This option allows the user to change the marker shape to cylinders or cones for a bar or cubechart. You can do this programmatically:

ChartFX1.CylSides = 12 (Cylindric)ChartFX1.CylSides = -12 (Conic)

8) This option allows the user to show/hide point markers on the series. You can do thisprogrammatically:

ChartFX1.PointLabels = True/False

9) This option allows the user to show/hide a particular series in the chart. Please refer to thefollowing pages for more information on how to achieve this programmatically.

Page 139: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

159

Series DialogThis dialog allows you to set specific settings, including visual attributes for series in the chart.When a particular series is selected this dialog settings will apply only to the series selected.Also, this dialog will change according to the series gallery selected. This means some of thesettings explained here may not be available to the type the series is displaying.

The main difference when a particular series is selected is that properties and methods invoked inthis dialog belong to the Series Object and not general properties of the Chart FX API.

1) This option allows the user to change colors for a specific series. You can do thisprogrammatically:

ChartFX1.Series(1).Color = RGB(255,0,255)

2) This option allows the user to show borders for series. You can do this programmatically:

ChartFX1.Series(1).Border = True/False

3) This option allows the user to change the border color. You can do this programmatically:

ChartFX1.Series(1).BorderColor = RGB(255,0,255)

4) This option allows the user to change the border LineStyle. You can do this programmatically:

ChartFX1.Series(1).LineStyle = CHART_DASH

Page 140: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

160

5) This option allows the user to change the border line width. You can do this programmatically:

ChartFX1.Series(1).LineWidth = 3

Note: In Windows 95/98, the LineWidth may not be combined with a line style different than solid.

6) This option allows the user to change the chart type for a particular series. You can achieveMultiType charts using this property. You can do this programmatically:

ChartFX1.Series(1).Gallery = AREA

7) This option allows the user to change the space allotted for each marker. You can do thisprogrammatically. This property applies to all series in the chart:

ChartFX1.Volume = 50

) This option allows the user to change the marker shape to cylinders or cones for a bar or cubechart. You can do this programmatically:

ChartFX1.Series(1).CylSides = 12 (Cylindric)ChartFX1.Series(1).CylSides = -12 (Conic)

8) This option allows the user to show/hide point markers on the series. You can do thisprogrammatically:

ChartFX1.Series(1).PointLabels = True/False

9) This option allows the user to show/hide a particular series in the chart. You can do thisprogrammatically:

ChartFX1.Series(1).Visible = True/False

Page 141: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

161

Axis DialogThis dialog allows you to manipulate axis settings, including Major Interval, Minor Intervals,Scales, Min, Max, and Gridlines & Tickmarks.

1) This option allows the user to set the Major interval for the selected axis. You can do thisprogrammatically:

ChartFX1.Axis(AXIS_Y).Step = 10

2) This option allows the user to Control the Tickmark type for the major interval. You can do thisprogrammatically:

ChartFX1.Axis(AXIS_Y).TickMark = TS_CROSS

3) This option allows the user to set the Minor Unit for the selected axis. You can do thisprogrammatically:

ChartFX1.Axis(AXIS_Y).MinorStep = 5

4) This option allows the user to show/hide a particular axis, including labels and tickmarks. Youcan do this programmatically:

ChartFX1.Axis(AXIS_Y).Style = AS_HIDE

5) This option allows the user to show/hide gridlines on the major interval. You can do thisprogrammatically:

Page 142: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

162

ChartFX1.Axis(AXIS_Y).Grid = True/False

6) This option allows the user to show/hide gridlines on the minor interval. You can do thisprogrammatically:

ChartFX1.Axis(AXIS_Y).MinorGrid = True/False

7) This option allows the user to Control the Tickmark type for the minor interval. You can do thisprogrammatically:

ChartFX1.Axis(AXIS_Y).MinorTickMark = TS_INSIDE

Page 143: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

163

Axes Scale DialogThis dialog allows you to manipulate axis Scales including, Min, Max, Logarithmic scales amongothers.

1) This option allows the user to set the minimum for the selected axis. You can do thisprogrammatically:

ChartFX1.Axis(AXIS_Y).Min = 0

2) This option allows the user to set the maximum for the selected axis. You can do thisprogrammatically:

ChartFX1.Axis(AXIS_Y).Max = 100

3) This option allows the user to set the scale unit for the selected axis. You can do thisprogrammatically:

ChartFX1.Axis(AXIS_Y).ScaleUnit = 1

4) This option allows the user to set the Axis Format. You can do this programmatically:

ChartFX1.Axis(AXIS_Y).Format = AF_DATE

5) This option allows the user to set the number of decimals for the selected axis. You can dothis programmatically:

ChartFX1.Axis(AXIS_Y).Decimals = 2

Page 144: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

164

6) This option allows the user to set logarithmic or linear scales. You can do thisprogrammatically:

ChartFX1.Axis(AXIS_Y).LogBase = 10

7) This option allows the user to set the starting point at zero. For example, if you have a barchart with a minimum value of -50 and turn on this flag the starting point will be zero and you willhave bars that go up or down, depending on their value.You can do this programmatically:

ChartFX1.Axis(AXIS_Y).Style = AS_BREAKZERO

Page 145: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

165

Axes Labels DialogThis dialog allows you to manipulate labels displayed on the axis, including Rotation, Fonts andAxis Title.

1) This option allows the user to set a rotated angle for labels in the selected axis. You can dothis programmatically:

ChartFX1.Axis(AXIS_Y).LabelAngle = 45

2) This option allows the user to set a title for the selected axis. You can do thisprogrammatically:

ChartFX1.Axis(AXIS_Y).Title = “In Millions”

3,4,5) This option allows the user to setlabel styles for the selected axis. You can dothis programmatically:

‘To hide labelsChartFX1.Axis(AXIS_Y).Style =AS_HIDETEXT

‘To make staggered labelsChartFX1.Axis(AXIS_Y).Style =AS_2LEVELS

Because it is a word property, you must make sure you usethese operators to turn on/off bits and avoid losing previoussettings to the property.The right way of setting this propertyis

Chart1.Axis(AXIS_Y).Style =Chart1.Axis(AXIS_Y).Style Or AS_ROTATETEXT(RIGHT!)

If you type the following code:

Chart1.Axis(AXIS_Y).Style = AS_ROTATETEXT(WRONG!)

Page 146: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

166

Axes GridLines DialogThis dialog allows you to customize gridlines on both the major and minor intervals.

1) This option allows the user to colors for gridlines in the selected axis. You can do thisprogrammatically:

ChartFX1.Axis(AXIS_Y).GridColor = RGB(192,192,192)

2) This option allows the user to set grid line styles in the selected axis. You can do thisprogrammatically:

ChartFX1.Axis(AXIS_Y).GridStyle = CHART_DASH

3) This option allows the user to set grid lines width in the selected axis. You can do thisprogrammatically:

ChartFX1.Axis(AXIS_Y).GridWidth = 3

4) This option allows the user to align labels with tickmarks and gridline sin the selected axis.You can do this programmatically:

ChartFX1.Axis(AXIS_Y).Style = AS_CENTERED

Page 147: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

167

5) This option allows the user to set interlaced gridlines. You can do this programmatically:

ChartFX1.Axis(AXIS_Y).Style = AS_INTERLACED

Note: The interlaced colors are achieved with the major grid lines color and the background of thechart (Rgb2DBk or RGB3DBk property).

6) This option allows the user to colors for minor gridlines in the selected axis. You can do thisprogrammatically:

ChartFX1.Axis(AXIS_Y).GridColor = RGB(192,192,192)

7) This option allows the user to set minor grid line styles in the selected axis. You can do thisprogrammatically:

ChartFX1.Axis(AXIS_Y).GridStyle = CHART_DASH

8) This option allows the user to set minor grid lines width in the selected axis. You can do thisprogrammatically:

ChartFX1.Axis(AXIS_Y).GridWidth = 3

Page 148: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

168

3D DialogThis dialog allows you to customize 3D aspects of a 3D chart.

1) Interactive drawing feature. Please refer to the AngleX and AngleY properties to do thisprogrammatically.

2) This option allows the user to enable/disable 3D view of the chart.You can do thisprogrammatically:

ChartFX1.Axis(AXIS_Y).View3D = True/False

3) This option allows the user to rotate the chart around the x axis.You can do thisprogrammatically:

ChartFX1.AngleX = 25

4) This option allows the user to rotate the chart around the y axis.You can do thisprogrammatically:

ChartFX1.AngleX = 35

5) This option allows the user to set the drawing style for the 3D markers.You can do thisprogrammatically:

ChartFX1.View3DLight = 1

Page 149: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

169

6) This option allows the user to control the chart 3D Depth.You can do this programmatically:

ChartFX1.View3DDepth = 300

7) This option allows the user to set the chart’s perspective.You can do this programmatically:

ChartFX1.Perspective = 80

Page 150: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

170

Constants & Stripes DialogThis dialog allows you to customize Constant Lines & Color Stripes in the chart. This dialog isavailable only at design time and it is not presented to the user. Constant lines are controlled bythe “ConstantLine” object and Color stripes are controlled by the “Stripe” object. In this section wewill reference only constant lines. However, you can check the API related to Color Stripes in theChart FX 98 API Guide.

Important Note:To create constant lines and color stripes you must first invoke the OpenDataEX and CloseDatamethods. For more information, please refer to the Constant Lines and Color Stripes topics inprevious pages of this manual.

1) This option allows you to set the axis associated with the Constant Line.You can do thisprogrammatically:

ChartFX1.ConstantLine(0).Axis = AXIS_Y

2) This option allows you to set the value of the Constant Line.You can do this programmatically:

ChartFX1.ConstantLine(0).Value = 30

3) This option allows you to set the style associated with the Constant Line.You can do thisprogrammatically:

ChartFX1.ConstantLine(0).Label = ‘Alarm Limit”

Page 151: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

171

4) This option allows you to set the color associated with the Constant Line.You can do thisprogrammatically:

ChartFX1.ConstantLine(0).Color = RGB(128,255,0)

5) This option allows you to set the label associated with the Constant Line.You can do thisprogrammatically:

ChartFX1.ConstantLine(0).LineStyle = CHART_DASH

6) This option allows you to set the width associated with the Constant Line.You can do thisprogrammatically:

ChartFX1.ConstantLine(0).LineWdith = 3

Page 152: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

172

Data/Behavior DialogThis dialog allows you to show tools and other important settings in the UI of the chart. Thisdialog is available only at design time and it is not presented to the user

1) This option allows you to set the number of series and values for previewing purposes only.To set actual data to the chart, please refer to the “Passing Data” chapter in previous pages ofthis manual.

2) This option allows you to select the end user tools you want to display in the chart.You can dothis programmatically:

‘ Show the ToolbarChartFX1.Toolbar = True/False‘ Show the MenuBarChartFX1.MenuBar = True/False‘Show the Series LegendChartFX1.SerLegBox = True/False‘Show the Values LegendChartFX1.LegendBox = True/False‘Show the Data EditorChartFX1.DataEditor = True/False‘Show the Palette BarChartFX1.PaletteBar = True/False‘Show the PatternBarChartFX1.PatternBar = True/False

Page 153: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

173

3) This option allows you to set how the chart reacts to user interaction.You can do thisprogrammatically:

‘Allow user to drag points with the mouseChartFX1.AllowDrag = True/False‘Allow the user to edit values in Data EditorChartFX1.AllowEdit = True/False‘Allow the user to resize the chartChartFX1.AllowResize = True/False‘Allow the user to scroll the chartChartFX1.Scrollable = True/False‘Show ToolTips when user positions the mouse over a markerChartFX1.ShowTips = True/False‘Display menus when user right clicks an elementChartFX1.ContextMenus = True/False

4) This option allows you to configure how Chart FX reacts when the user double clicks anelement in the chart.You can do this programmatically:

ChartFX1.DblClk CHART_BALLOONCLK

5) This option allows you to configure how Chart FX reacts when the user right clicks an elementin the chart.You can do this programmatically:

ChartFX1.RigClk CHART_PROPERTIESCLK

Page 154: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

174

Commands DialogThis dialog allows you to customize the Toolbar. This dialog is available only at design time and itis not presented to the user.

Important Note:Please refer to the “Customizing the Toolbar” chapter for more information on the properties andmethods you should use to customize the toolbar and other tools available in Chart FX.

Page 155: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

175

Extensions DialogThis dialog allows you enable/disable installed ChartFX 98 extensions. This dialog is availableonly at design time and it is not presented to the user.

Important Note:Chart FX provide sthe Annotation Extension free of charge. There are other Extensions that youcan purchase from Software FX. Particularly, Chart FX Financial Edition which is an extensionspecifically designed to provide financial charting capabilities.

In order to activate an extension, you must invoke the AddExtension method as follows

AnnotX= ChartFX1.AddExtension "AnnotationX.AnnList"

Another way to enable the Annotation extension is using the New Command as follows:

Set AnnotX = New AnnotationXChartFX1.AddExtension AnnotX

Important Note: The return value of the AddExtension Method is really important as you will use it tohandle objects (Add, Remove, Count, etc), so it may be a good idea to set a global variable with thisreturn value. However, if you don't like global variables or you prefer to retrieve the handle to theAnnotation Objects List. The GetExtension Method is also provided in the Chart FX 98 API.

Please refer to the Extension Documentation for more information on objects, properties andmethods supported by that extension.

For more information please refer to our web site at http://www.softwarefx.com

Page 156: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

177

Chart FX Programmer’s Guide

Annotation Objects

Topics covered in this section

OverviewActivating the Extension

Creating objects programmaticallyDeployment issues

Page 157: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

179

The Chart FX Annotation Extension.

Chart FX 98 provides an Annotation Extension that you can use to add text, arrows, differentshapes and even images that you can freely move around the chart. As a matter of fact a wholenew toolbar will be added to the chart so your users can add these shapes and rotate them,group them and even flip them around. Just take a closer look:

As with any other Chart FX extension, you must first enable the extension. You can do thisprogrammatically, by using the Design-Time properties dialog or you can add themprogrammatically in your code by invoking the AddExtension method.

To enable the annotation extension at Design Time, follow these steps:At Design Time, right click the chart and select "Properties"Select the "Extensions" TabCheck "Annotation Objects"When you run the application an additional toolbar will be added to the chart so you can addthese annotation objects. The API is now accessible in your code so you can add annotationobjects dynamically to the charts.

If you want to add the annotation extension programmatically, just use the AddExtension method,as follows:

AnnotX= ChartFX1.AddExtension "AnnotationX.AnnList"

Another way to enable the Annotation extension is using the New Command as follows:

Set AnnotX = New AnnotationXChartFX1.AddExtension AnnotX

Important Note:

Page 158: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

180

The return value of the AddExtension Method is really important as you will use it to handleobjects (Add, Remove, Count, etc), so it may be a good idea to set a global variable with thisreturn value. However, if you don't like global variables or you prefer to retrieve the handle to theAnnotation Objects List. The GetExtension Method is also provided in the Chart FX 98 API.You will invoke the AddExtension method only once (And usually in the Form_Load event).Once the annotation extension has been enabled, you can start creating objectsprogrammatically.

Page 159: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

181

Creating Annotation objects programmatically

Once the Annotation Extension has been enabled in your project, you can let your users annotatethe chart using the toolbar provided in the Annotation extension, or you may want to use thisextension to highlight markers or create annotation objects dynamically.

This guide will introduce you to the different objects available in the Annotation extension andhow you can use them programmatically in your project.The Annotation extension exposes the following objects:

AnnArc : ArcsAnnArrow : Arrows & LinesAnnBalloon : Text displayed in a BalloonAnnCircle : Circles & EllipsesAnnGroup : Groups of ObjectsAnnPicture : PicturesAnnRect : RectanglesAnnText : Text

These are objects that you can create dynamically and position them anywhere you want in thechart area.

To create one of these objects you must first create a variable containing a pointer to the objectand use properties associated with them. For example, if you want to create a circle dynamically,you must define the variable as follows:

Dim MyCircle As AnnCircle

Important Note: In order to have access to these objects you must first include references to theAnnotation Extension Type Library. You can do this by Selecting the Project Menu, click onReferences and check the Annotation extension Type Library, as depicted in the following figure:

Page 160: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

182

With this variable (MyCircle) you can add the object using the Add method with the pointerreturned by the AddExtension method, as follows:

Set MyCircle = AnnotX.Add(OBJECT_TYPE_CIRCLE)

Then you'll need to access properties that allow you to set attributes such as position, colors,among others, for the particular object you are creating. For example:

MyCircle.Top = 100MyCircle.Left = 50

Important Note:All Annotation objects, properties and methods have been documented in the AnnotationExtension Help file (located in the Chart FX /Help directory)

Page 161: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

183

Annotation Extension Deployment

ANNOTATEX.DLL IS REQUIRED!If you use the Annotation Extension as part of your application, you must make sure youredistribute and register the ANNOTATEX.DLL in the client's machine.Please refer to the Chart FX Programmer's Guide for more information on redistributing Chart FX98 and other files that may be required as part of your application.

Registering components:Most of the files used by Chart FX 98 need to be registered in order for them to work correctly.These files are "Self Register". This means that virtually any setup utility will be able to registerthem upon installation. Check your setup utility documentation for more information on this topic.If your setup utility does not include this option, you can use Microsoft's REGSVR32.EXE toregister these modules.

Page 162: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

185

Chart FX Programmer’s Guide

Appendix A. Migration Issues

Topics covered in this section

Migrating from Chart FX 3.0Converting Project FilesObsolete/Replaced API.

Page 163: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

187

Migrating from Chart FX 3.0

There are basically three (3) steps that you have to consider when migrating from Chart FX 3.0 toChart FX 98:

1.- Converting Project FilesIn order to convert your Chart FX 3.0 project files, your development tool needs to support "OLEAuto Conversion". Here are some of the tools that support this paradigm:

Visual Basic 6.0Visual C++ 6.0MS Access 97Visual FoxPro 6.0Borland Delphi 4.0 (*)Borland C++ Builder 3.0

If your tool supports this, follow this procedure:

1) Save all your project forms/dialogs using Chart FX 3.0 build 35 (version 3.0.35) orlater.2) Run "Chart FX 3.0 to 98 Conversion Utility" (Cfx3to4.exe) provided with Chart FX 98.And turn conversion ON.3) Open your project. Make some changes to the chart (e.g. change its size slightly) toensure re-saving and save your project. Do this with all the forms/dialogs that containcharts.Note: Chart FX 3.0 File Filters need to be installed in order to make this conversion

2.- Making changes to your code

Most of the old API is still provided for compatibility. However, some of the old API has beenreplaced with new, improved API. We suggest you migrate to this API as soon as possible. Thiswill help you to learn the philosophy behind the Chart FX 98 object oriented API.

Although we have tried to be compatible with Chart FX 3.0, some properties, methods and eventssimply can not be converted because an entirely different approach was taken in the new version.Check the Chart FX 98 Help file for information on obsolete properties, methods and events.

3.- Importing Chart FX 3.0 files (.CHF) and templates (.CHT)

Chart FX 98 includes a file filter library that will enable you and your users to read from Chart FX3.0 files and templates. If these filters are installed, the import method will automatically read fromthose files. Make sure to install the Chart FX 3.0 filters if you want to have this functionality.If your tool does not support ActiveX conversion, you will need to modify your forms manually sothey point to the new component.

(*) Same class name has to be given to the new component when installed into the componentlibrary. Only ActiveX projects can be converted. A VCL is not provided in Chart FX 98.

Page 164: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

188

Chart FX 3.0 Replaced/Obsolete API

The following properties and methods exist only for compatibility reasons. New programs shoulduse the new API:

OLD property/method NEW property/methodChartType GalleryMarkerVolume VolumePointType PointTypeType TypeMaskShape CylSidesPixFactor Axis(AXIS_Y).PixPerUnitFixedGap Axis(AXIS_X).PixPerUnitAngles3D AngleX, AngleYMultiType Series(i).TypeMask, Series(i).GalleryMultiShape Series(i).CylSidesMultiLineStyle Series(i).LineStyle, Series(i).LineWidthMultiYAxis Series(i).YAxisMultiPoint Series(i).MarkerShapeVertGridGap Axis(AXIS_X).StepConst ContantLine(i).ValueFixLeg ContantLine(i).Label

AdmAxis(AXIS_*),Min, Axis(AXIS_*),Max, Axis(AXIS_*).Step,Axis(AXIS_*).LogBase

DecimalsNum Axis(AXIS_*).DecimalsBarBitmap Series(i).PictureValue ValueEx, Series(i).YValueXValue XValueEx, Series(i).XValueIniValue IniValueEx, Series(i).YFromLegStyle Axis(AXIS_*).StyleConstType ConstantLine(i).StyleSetStripe Stripe(i).Color, Stripe(i).From, Stripe(i).ToAutoIncrement ValueExThisSerie ValueExThisPoint ValueExThisValue ValueExThisColor Color

Page 165: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

189

The following properties are no longer supported and its functionality has radically changed. Youcan not use these properties in Chart FX 98:

OLD property/method CommentBarHorzGapRGBBarHorzGalleryTool See ToolBar customizationCurrentAxis See ToolBar customizationCustomTool See ToolBar customizationTBBitmap See ToolBar customizationTBItemStyle See ToolBar customizationEnableTBItem See ToolBar customizationToolStyle See ToolBar customizationToolSize See ToolBar customizationToolPos See ToolBar customizationTBItemID See ToolBar customizationShowStatus Status bar no longer supportedStatusText Status bar no longer supportedSetStatusItem Status bar no longer supportedStatus Status bar no longer supported

Page 166: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

191

Chart FX Programmer’s Guide

Appendix B. MemoryRequirements

Topics covered in this section

Chart FX Memory Requirements

Page 167: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

193

Chart FX Memory Requirements

Other than the physical limitations that your computer or OS configuration may impose, Chart FX98, imposes the following limitation on the size of your data:

• The number of series is limited to 32,767 and total number of points to 2,147,483,647.This means that you can have a chart with 2,147,483,647 and one series, a chart with536,870,911 and 4 series, or any other combination.

• The size of each string (axis label, title, etc.) is limited to 255 characters.• 32,767 Labels per Label List (X-axis, Y-axis, Series Legend, etc.)

The size of ONE chart Object can be calculated as follows:

Global Memory:

• About 2.5 KB of core data per chart +• Eight (8) Bytes for each data point. +• Eight (8) Bytes for each data point if X-Values are used (X/Y Chart) +• Eight (8) Bytes for each data point if Ini-Values are used +• Four Bytes per color (if not using default schemes) +• 2 Bytes per pattern (if not using default schemes) +• 256 Bytes per label list (if used) + (4 + Label String + 1) * Number_Of_Elements• 28 Bytes per constant line +• 24 Bytes per color stripe

GDI Resources:

Only a few global GDI resources are created when you load Chart FX. All the rest of resourcesare created when the chart displays (paint) and destroy right after.The number of resources used in a chart varies a lot depending on the chart configuration but it isoptimized for both speed and resource consumption.

Other memory

Chart FX ActiveX control is about 530KChart FX COM DLL is about 460KSfxBar.DLL (required for both) is about 110KYou usually use either the ActiveX or the DLL not both (they are completely independent).Other DLLs like COMCAT.DLL and OLEAUT32.DLL are also required to be loaded, but these areusually loaded by the system itself or by your own application.Extensions (e.g. CFX4DATA.DLL, CFX4FILTERS.DLL, CFX4OLE.DLL, ANNOTATEX.DLL) areloaded only if they are being used.

Page 168: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

195

Chart FX Programmer’s Guide

Appendix C. Deployment Issues

Topics covered in this section

Deploying your application

Page 169: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

197

Deploying your application

Several modules compose chart FX 98. You need to redistribute those that you use. Here is thelist of redistributable files along with a rule that tells you when to redistribute them:

Program files:

SFXBAR.DLLYou must redistribute this file always. This file needs to be registered.

CFX4032.OCXRedistribute this file ONLY if you are using the ActiveX control. This file needs to be registered.

CFX4032.DLLRedistribute this file ONLY if you are using the DLL. Usually, you don't need to re-distribute thisfile if you are developing from VB, Delphi, VC++, VFP or Access. See related articles for moreinformation on when to use the DLL. This file needs to be registered.

CFX4FILTERS.DLLRedistribute this file only if you want your application to be able to read Chart FX 3.0 files. Thisfile needs to be registered.

CFX4DATA.DLLUsed when using Data Binding (DataSource property) and/or the GetExternalData method. Thisfile needs to be registered.

ANNOTATEX.DLLRedistribute this file only when you use Annotation Objects. This file needs to be registered.

CFX4OLE.DLLThis file requires a user license to run (subject to a royalty fee). Redistribute this file only if youhave purchase Chart FX 98 OLE Server licenses for each of your users. This file needs to beregistered.All program files usually go in the WINDOWS\SYSTEM (WINNT\SYSTEM32) folder. They haveto be in the same directory or in your path.

Registering components:Most of the files used by Chart FX 98 need to be registered in order for them to work correctly.These files are "Self Register". This means that virtually any setup utility will be able to registerthem upon installation. Check your setup utility documentation for more information on this topic.If your setup utility does not include this option, you can use Microsoft's REGSVR32.EXE toregister these modules.

Additional Files:PALETTES.REG: Merge this file into your client's computer registry to provide multiple colorpalettes/schemes.

Always consult your license agreement on re-distribution rights before you deploy any ofthe Chart FX files.

Page 170: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

199

Chart FX Programmer’s Guide

Appendix D. Compatibility Issues

Topics covered in this section

ActiveX or DLL. Which one should you use?Chart FX and Visual C++

Chart FX and Borland Products

Page 171: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

201

Chart FX ActiveX vs. Chart FX DLL. Which one should you use?

Chart FX 98 contains 2 Independent modules that provide similar functionality:

CFX4032.OCX (ActiveX control) and CFX4032.DLL (DLL COM Component)

While the ActiveX control provides design-time capabilities, the DLL is slightly smaller and faster.

Both DLL and ActiveX provide a similar COM interface that allows you to access all objectproperties and methods in the same way. The DLL also offers a standard (not COM-based)interface for tools that are not COM enabled and for compatibility with older versions. You mustuse the COM interface whenever possible..

As opposed to the ActiveX control, the DLL is not an OLE automation (IDispatch) object. Thisgives the DLL a higher performance since it doesn't have to do type conversions, this isparticularly important when a lot of strings (labels) are used.

The ActiveX control is recommended for most applications. Using the DLL requires moreprogramming expertise in C++ and COM (OLE). Here are some cases in which you may want touse the DLL:

- Your development tool doesn't support ActiveX controls (VC++ supports ActiveX controlsonly through MFC).

- You use a high performance development tool (e.g. VC++) and have charts with lots ofdata.

- Your application is a "batch process" that takes data and generates chart files or pictures.In other words, your application never displays the charts.

Please have in mind that what you gain in performance you may loose in ease of use.

Page 172: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

202

Chart FX & Microsoft Visual C++

There are 2 ways of importing an ActiveX control into a Visual C++ MFC application:

1) By allowing the Class Wizard to generate wrapper classes for each one of the componentscontained inside the ActiveX. This is done automatically when you assign a member variable tothe object.

2) By using the #import directive as follows:In your precompiled header (STDAFX.H)

// DEFINITION of COM wrappers#import "sfxbar.dll" no_namespace no_implementation#import "Cfx4032.ocx" no_namespace no_implementation

In your implementation (STDAFX.CPP)

// IMPLEMENTATION of COM wrappers#import "sfxbar.dll" no_namespace implementation_only#import "Cfx4032.ocx" no_namespace implementation_only

There are quite a few differences between these two approaches:

While #import uses DIRECT calls to the ActiveX component via dual interfaces, the classesgenerated by Class Wizard make the calls through the Dispatch interface only. This makes it veryinefficient since parameters have to be packed and unpacked with each call.

Class Wizard will generate a different file for each class (Interface) inside the ActiveX control. Incomplex controls (like Chart FX 98) that means a lot files added to your project which makes itvery confusing.

You can use the #import directive for any COM interface. Not only for ActiveX controls.

You can use extended COM syntax to access the object's properties and methods. For instance,using the classes generated by the Class Wizard you would do:

m_ChartFX.SetChart3D(TRUE);

Using #import, you would do:

m_pChartFX->Chart3D = TRUE;

We suggest using #import when using Chart FX 98 since it poses all these advantages. The onlycomplication of the #import approach, is that you have to map the component to a variablemanually, but don't worry, a couple of lines of code is all that is needed:Define two members in your class:

CWnd m_ChartFX; // Chart FX WindowIChartFXPtr m_pChartFX; // Chart FX Object Pointer

Page 173: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

203

Inside DoDataExchange (make sure you add this code outside the VC++ generated comments)

DDX_Control(pDX, IDC_CHART1, m_ChartFX); // Link variable to controlif (!pDX->m_bSaveAndValidate) // Link Chart FX pointer to controlwindowm_pChartFX = m_ChartFX.GetControlUnknown();

Or if you want to create your chart dynamically, you can do this instead:

m_ChartFX.CreateControl(__uuidof(ChartFX), "", WS_VISIBLE, rc, this,IDC_CHART2,NULL,<Licence String*>); // Create Control Windowm_pChartFX = m_ChartFX.GetControlUnknown(); // Attach to Chart pointer

You will use m_ChartFX when you want to use the control as a Window (e.g. to move it, re-sizeit, etc.) and you use m_pChartFX to access all the properties and methods.

* The license string is printed in your license card.

Page 174: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

204

And, If you are not using MFC:

You can still take advantage of the #import directive and Chart FX 98 COM DLL to use ChartFXalmost in the same way you use the ActiveX under MFC. Here is how:First, import Chart FX and related libraries as follows:In your precompiled header (STDAFX.H)

// DEFINITION of COM wrappers#import "sfxbar.dll" no_namespace no_implementation#import "Cfx4032.dll" no_namespace no_implementation

In your implementation (STDAFX.CPP)

// IMPLEMENTATION of COM wrappers#import "sfxbar.dll" no_namespace implementation_only#import "Cfx4032.dll" no_namespace implementation_only

In your declarations:

IChartFXPtr m_pChartFX;HWND m_hwndChartFX;

Then, you can dynamically create Chart FX objects as follows:

m_pChartFX.CreateInstance(__uuidof(ChartFX));m_pChartFX->CreateWnd((long) hwndParent,IDC_CHART1,0,0,500,500,WS_CHILD| WS_VISIBLE);m_hwndChartFX = (HWND) m_pChartFX->hWnd;

You do not need to call CreateWnd unless you want to make the chart visible and active. You cancall all the properties and methods without having a window. Batch applications and systemservices may take advantage of this feature to keep resource usage at a minimum.

Note: You need to call CoInitialize() when your application starts and CoUninitialize() when itends.

Page 175: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

205

Chart FX ActiveX and Borland products

Integrating an ActiveX control into Borland Delphi and C++ Builder is not as easy as it should be.Here are some tips that will help you get through:

Delphi 4.0

The support for ActiveX controls seems to be very complete but there are a few issues toconsider:

1) You need to remove any package containing previous versions of Chart FX. By default, apackage named "Delphi Sample Imported ActiveX Controls" contains Chart FX 2.0. Since thesource for this package is not installed, you need to remove the package as a whole. You canimport other components that are in that package by selecting "Import ActiveX Control" from the"Components" menu.

2) Import the ActiveX into a new package. This will make it easier to remove or disable it later on.

3) Because of a bug in the engine that reads the ActiveX type library and generates PASCALclasses, an extra parameter is added to each and every method. This parameter is not used soyou can eliminate it without consequences. The parameter name is retval.

This BUG is fixed in Delphi 4.0 Update #1.

Another bug in Delphi 4.0 Import Library engine: Default properties are not declared as default.This forces you to type (for example):

ChartFX1.Axis.Item[AXIS_Y].Min := 20;

Instead of just:

ChartFX1.Axis.[AXIS_Y].Min := 20;

We have already made those changes and have Pascal classes in which those parameters havebeen removed and default properties has been declared properly. You can just copy the followingfiles to your Delphi4\Imports subdirectory after following step 1 and 2. This will replace some ofthe files that were generated in step 2.

ChartFX 98\Lib\ChartFX_TLB.PASChartFX 98\Lib\SfxBar_TLB.PAS

Then remove their respective .DCU files (so they will be recompiled).

All of our samples and documentation assume that these fixes have been made.

Note: Although this solution is the easiest one, it may not work in future versions of Delphi sincethe base classes may change from one version to another. The files included were generatedusing Delphi 4.0 Build 5.37 (from the About-Box). If this doesn't do it (because you have adifferent version) repeat step 1-2 and then make the changes on the files previously mentioned.

Page 176: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

206

C++ Builder 3.0 & 4.0

There are several issues when integrating Chart FX to Borland C++ Builder 3.0. Although someof the problems have been fixed in Service Pack 1. We strongly encourage you to download thesamples we have built and the knowledgebase articles related to this tool.

For more information, please visit our support site at http://support.softwarefx.com and search forthe keyword “Borland”.

Delphi 3.0 and 2.0, C++ Builder 1.0

Enumerated types are not supported as parameters to properties and methods. The classesgenerated by the "import engine" will generate compiler errors.

As of today, Chart FX 98 is not compatible with these versions of Delphi. For updated informationon these tools please refer to our support site at http://support.softwarefx.com and search for thekeyword “Delphi”

Page 177: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

207

Chart FX Programmer’s Guide

Appendix E. Licensing Issues

Topics covered in this section

The Chart FX Licensing scheme

Page 178: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

209

Chart FX License Scheme. How does it work?

Chart FX 98 is a licensed control, this means that it can not be used to develop applicationsunless a license of the control is installed in the computer.

If you use the ActiveX control and create the charts from the IDE, this is completely transparentfor you, but why?

The answer is inside COM. Chart FX 98 supports IClassFactory2, an enhanced class factory thatprovides functionality for design-time and run-time licensing. Here is how it works:

At design time, the container (e.g. Visual Basic) creates the control using CoCreateInstance (orIClassFactory::CreateInstance) which makes Chart FX look for a license installed. If it doesn't findit, CreateInstance will fail. If it is found, it creates the control. When the container creates anexecutable (or similar binary image) it will ask Chart FX for the license string. If the license waspreviously found, Chart FX will return a valid license string which the container will save it insidethe executable.

When the program runs later on (maybe in another computer which doesn't have a Chart FXlicense), it will create the chart object using IClassFactory2::CreateInstanceLic and passes thesaved license string as a parameter. Chart FX will check that this string is a valid license string, ifit is valid, it will create the control.

But remember, all this is hidden from you if you create the Chart FX objects from the IDE. Butwhat happens if you are creating the Chart FX objects dynamically ? Well that's when all thisknowledge comes handy.

If you are using the OCX or the DLL as a COM object, you must create your Chart FX objectsusing IClassFactory2. In C++ you would do something like this:

if (SUCCEEDED(hr = CoGetClassObject(<ChartFX 98 ClassID**>,CLSCTX_INPROC_SERVER,NULL,IID_IClassFactory2,(LPVOID FAR *)&pFactory2))) {hr = pFactory2->CreateInstanceLic(NULL,NULL,IID_IUnknown,<Chart FX 98License string*>,(LPVOID FAR *) &pUnk);if (SUCCEEDED(hr))p = CChartFXDll::Create(pUnk);pFactory2->Release();}

In MFC, IClassFactory2 is encapsulated into CWnd. If you are using the ActiveX control (you cannot do this with the DLL), you can do:

CWnd m_ChartFX;m_ChartFX.CreateControl(<ChartFX 98 Class ID**>, NULL, WS_VISIBLE, rc,this, IDC_CHART1,NULL,NULL,<Chart FX 98 License string*>);

So this takes care of COM. Both the ActiveX and the DLL is used as a COM object.If you are using the DLL as a standard library (using chart_Create, chart_Send, etc.) you will notbe helped by COM but Chart FX will still require a license to run. You must call:

chart_SetLicense(<Chart FX 98 License string*>);

Before you can create any chart. Otherwise, the chart_Create function will fail.

Page 179: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

210

A valid license string is printed in your license card. It can also be obtained by runningCfx98Info.exe (About Chart FX 98)

** Chart FX 98 class ID's are:

ActiveX (OCX) :{0x608E8B11,0x3690,0x11D1,{0x8F,0xD4,0x00,0xAA,0x00,0xBD,0x09,0x1C}} //{608E8B11-3690-11D1-8FD4-00AA00BD091C}

DLL:{0xFFF90AC1,0x4659,0x11D1,{0x8F,0xD4,0x00,0xAA,0x00,0xBD,0x09,0x1C}} //{FFF90AC1-4659-11d1-8FD4-00AA00BD091C}

Page 180: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

211

Chart FX Programmer’s Guide

Index

Page 181: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

22D background color, 632D Colored Lines, 642D/3D views, 154

33D angles, 713D background color, 633D Depth, 723D Effects, 713D representation, Surface, 863D view, 1673D Wall, 71

AAccess, 6acquiring points

in Real-Time mode, 141ActiveX, 199, 208Activities, Gantt, 83AddExtension, 177add-on, 3Adm, 186ADO, 29, 37, 39, 40ADO, creating an XY Plot, 77AdoSource, 37Analysis, Technical, 84angles, 3D, 71Angles3D, 186AngleX, 167AngleY, 167ANNOTATEX.DLL, 195Annotation Extension, 177Annotation objects, creating, 179API Reference, 4API, obsolete, 185Arcs, 179Area, 77Arrays, 41arrows, 177ASP, Scripts, 17AutoIncrement, 186automation, OLE, 199Axis

custom labeling, 53Formatting, 51labeling, 52scrolling, 54User-Defined Formats, 51

axis drawing style, 154Axis Format, 162axis, showing/hiding, 160Axis, working with, 49

BB&W printing, 109

background color, 155background colors, 63Background picture, 155background, transparent, 63Balloon, 104BarBitmap, 186BarHorzGap, 187BDE Cursors, 40Binding, 9BitBlitz, 33BkColor, 64Black & White patterns, 64border, color, 156border, line style, 156border, line width, 157borders, showing, 156Borland, 203browsers, 17Bubble, 77, 89BufferSize, 144builder, 23Builder, 203button, changing behavior, 121buttons, adding to the toolbar, 122buttons, removing from toolbar, 120buttons, toolbar, 118

CC++ Builder, 6, 40, 203Candlesticks, 84Categorical Axis, 52CFX4032.DLL, 195CFX4032.OCX, 195CFX4DATA.DLL, 195CFX4FILTERS.DLL, 195CFX4OLE.DLL, 195Chart FX 3.0, migrating from, 185Chart's Name, 21ChartType, 186Circles, 179class ID's, 208Class Wizard, 200clipboard, 14, 97CloseData, 30Cluster Charts, 71clustered chart, 154CoCreateInstance, 207COD_ADDPOINTS, 142COD_REALTIME, 142COD_REALTIMESCROLL, 142Collections, reading data, 43color scheme, 155Color schemes, 64Color Stripes, 94color, dragging, 63Color, handling, 61Colored Lines, 64Colors, 9colors, assigning to markers, 63colors, background, 63COM, 3, 23, 35, 98, 199, 207

Page 182: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

215

Comma separated, 45commands, 116Common Dialog, 111compatibility, 185Compatibility, 17compatibility, backward with Chart FX 3.0, 98cones, 157Conic shapes, 67Const, 186Constant lines, 93constants, 22

CPI_, 148Constants, 9Constants Lines, 169ConstType, 186Container, OLE, 14Context, device, 110ContextMenus, 172Contour, 10, 77, 86control, picture, 100conversion, project, 185coordinates, x and y, 75CPI Constants, 148CreateWnd, 202Creating, 21CRT_LOOPPOS, 143CRT_NOWAITARROW, 143CT_EVENSPACING, 142CTE_NOLEGINVALIDATE, 144CurrentAxis, 187Cursors, BDE, 40curve, 67Curve, 77Customizing Chart Painting, 147CustomTool, 187cylinders, 157Cylindrical shapes, 67

DData Aware, 9Data Editor, 171Data Providers, 29Data, changing values, 33Data, Controls, 37Data, hidden, 32Data, Pasing using Series Object, 31Data, Passing, 9, 29Data, Passing to Gantt, 81Data, Providers, 35Data, reading from arrays, 41Data, reading from collections, 43Data, reading from text files, 45Data, scrolling, 34Data, unknown, 32databases, connecting, 40databinding, 37DataEditor, 133DataStyle, 38DataTips, 103DataType, 38, 44decimals, 162

DecimalsNum, 186default colors, 61Delphi, 6, 40, 203Deployment, 62, 195Deployment, Annotation objects, 181Depth, 72, 168Design Time, 21design-time licensing, 207Device Context, 110DeviceName, 111Dialog

3D, 167Axis, 160Axis Gridlines, 165Axis Labels, 164Axis Scale, 162commands, 173Constant Lines & Color Stripes, 169Data/Behavior, 171Extensions, 174General, 154Series, 156

Dispatch interface, 200DLL, 199, 208docked

toolbars, 119Document, OLE Compound, 97drag points, 172Dragging markers, 103Driver, printer, 111

Eedit values, 172Effects, 3D, 71Ellipses, 179EnableTBItem, 187Excel, 13Export, 9, 97extensibility, 3, 23, 35Extension, Financial Edition, 84Extensions, 174

Ffield, SQL, 38File, 97files, reading data from text, 45Filters, Chart FX 3.0, 98, 185Financial charts, 84FixedGap, 186FixLeg, 186flickering

avoiding, 141flickering, preventing, 33

Page 183: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

216

floating, toolbar, 119Fonts, 164Format, Axis, 162format, OLE Compound, 97FoxPro, 7frame, color, 94

Ggallery, 157Gallery, 79GalleryTool, 187Gantt, 81GDI Resources, 191GetExtension, 178GetExternalData, 36, 40, 41, 45Global Memory, 191grayscale, printing, 109grid, 133grid controls, 29, 35gridline, colors, 165gridlines, 49, 155Gridlines, 9, 56GridLines, 165Gridlines, interlaced, 57gridlines, showing/hiding, 161gridlines, styles, 165

Hhatched patterns, 109, 155hDC, printer, 109, 111Hex, 22Hidden Points, 32Hi-Lo-Close, 84HTML, 17

IIClassFactory2, 207icon selectors, 128Icons, changing, 125icons, toolbar, 118IDE, 207identifier, 22IDispatch, 199IDs, class, 208images, 177images, obtaining, 100Import, 9, 97Importing, Cfx 3.0 files, 185include, 17independent colors, 83indexes, 22IniValue, 186input rate

Real-Time charts, 141Integrating, 6interaction, configuring, 172interaction, mouse, 103Interface, User, 10, 171

interlaced, 166Interlaced Grids, 57Internet, Chart FX, 17invisible points, 32ItemColor, 143ItemStyle, 143ItemWidth, 143

KKagi, 84knowledgebase, 5

LLabeling, surface & contour, 88Labels, 9Labels, frequency and style, 52labels, rotating, 164LANDSCAPE, 109LButtonDblClk, 104LegendBox, 136legends

scrolling in real time mode, 144LegStyle, 186Level colors, surface, 87License, 207Licensing, 4limits, highlighting, 93line, 67Line, 77Lines, 179Lines, style & width, 68Lines, coloring, 64logarithmic, 163Logarithmic, 162Loop Marker

Real-time charts, 143Loop Position

Real-Time charts, 141

MMajor interval, 160major unit, 49, 56Manager, wizard, 24marker colors, 63Marker Volume, 68marker, dragging, 103Markers, 67MarkerVolume, 186Marketing, 4matrix, 42Max, 162MaxValues, 141, 144Memory requirements, 191MenuBar, 116, 171menus, 172Menus on Demand, 103MFC, 200Migrating, 185

Page 184: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

217

Min, 162Minor Interval, 160minor unit, 49, 56MinorStep, 52Model, Component Object, 23Money Flow, 84Mouse, 9Mouse, events, 103Mouse, tracking, 105MultiLineStyle, 186Multiple Colors, 63MultiPoint, 186MultiShape, 186MultiStacked, 80MultiType, 186MultiType charts, 79Multitype, financial charts, 85MultiYAxis, 186

Nnumerical axis, 49Numerical Axis, 54

OObject, Axis, 50Object, Data Editor, 133Object, LegendBox, 136Object, PaletteBar, 134Object, PatternBar, 135Object, Printer, 109Object, SerLegBox, 137objects, handling, 50obsolete API, 185OEM, 6OLE automation, 199OLE Compound Document, 97OLE Server, 13OLE stream, 97OleDB, 35On-Line Support, 5OOP, 23OpenDataEx, 61, 142, 144OpenDataEX, 30Open-Hi-Lo-Close, 84Orientation, paper, 109

PPainting

customizing, 147PaintMarker, 147

Sample, 151palette, 61, 155Palette, 9Palette Bar, 171palette, changing default, 62PaletteBar, 134PALETTES.REG, 195Paper orientation, printing, 109

Pattern, 9patternbar, 64PatternBar, 135, 171patterns, 155Patterns, 64patterns, hatched, 109perspective, 168Perspective, 72picture, background, 155picture, obtaining, 100Pictures, 179PIE Legends, 136Pie slice, separating, 68PixFactor, 186PixPerUnit, 34, 54Plot, contour, 88plot, surface, 86Plots, 10Plots, XY, 75point markers, 157Point Shape, 67Point Size, 67PointType, 186polar, 67Port, printer, 111PORTRAIT, 109PostPaint, 147PowerPoint, 13PrePaint, 147

Sample, 150Printer, Driver, 111Printing, 9, 109Printing, two or more charts, 110programmatically, 22Programming, OOP, 23Project, converting, 185properties indexes, 22Providers, Data, 29, 35pull-down menu, 103

RReal-time, 33RealTime, 9, 141RealTimeStyle, 142Rectangles, 179redistributing, 181, 195redistribution, 14References, 41, 43, 45references, Data Provider, 36registry, 62Registry, 21Renko, 84repainting, prevent flickering, 33reporting tools, 100Requirements, Memory, 191resize, 172resultsets, ADO, 40RGBBarHorz, 187rights, distribution, 195Rotation, 71, 167run-time licensing, 207

Page 185: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

218

SSamples, 9scale, 49Scales, 162scatter, 67, 75scheme, color, 155Schemes, color, 64scientific, 93screen flickering, preventing, 33screen, visible points, 54scroll, 172Scroll, 9Scroll, controlling, 34Scrollable, 34, 55scrolling

Real-Time, 141Scrolling

in real time mode, 144Scrolling, Axis, 54Secondary Y axis, 50, 83Selectors, 128Series Legend, 171series, color, 156series, showing & hiding, 157SerLegBox, 137Server, OLE, 13SetScrollView, 34SetStatusItem, 187SetStripe, 186SFXBAR.DLL, 195Shape, 67ShowStatus, 187Size, point, 67slice, separating, 68solid colors, 61source, data, 36spreadsheet, 133SQL statement, 40SQL Statement, 38stack, 154Stacked, 9, 80Statement, SQL, 38Status, 187StatusText, 187Step, 52stream, OLE, 97Stripes, 9, 94, 169style, lines, 68SubCommands, 127Support, 4, 5Surface, 10, 77, 86system aware colors, 61

TTab separated, 45Tab Separated Values, 97TBBitmap, 187TBItemID, 187TBItemStyle, 187Technical Analysis, 84

Technical Support, 4telephone, 4Templates, 97Text files, reading data, 45ThisColor, 186ThisPoint, 186ThisSerie, 186ThisValue, 186Three Line Break, 84Tickmark, 160tickmarks, 49Tickmarks, 56TipMask, 104Title, 155Title, axis, 164Toolbar, 171

adding custom commands, 129changing icons, 125creating your own, 131positioning, 119removing buttons, 120selectors, 128showing, 119subcommands, 127

toolbar, annotation extension, 177ToolBar, overview, 116ToolPos, 187Tools, 115ToolSize, 187ToolStyle, 187tooltips, 103ToolTips, 118, 124, 172tooltips, balloon, 104Tracking the Mouse, 105transparent, background, 63type conversions, 199type, chart, 157TypeEX, 144

UUI, 171UserScroll, 34

VValueEx, 75ValueEX, 30Values Legend, 171Values, changing, 33values, editing, 172VB scripts, 17VCL, 185VertGridGap, 186View3D, 71View3DDepth, 72Visual Basic, 6Visual C++, 7, 200Visual FoxPro, 7volume, 84Volume, marker, 68

Page 186: Chart FX Programmer’s Guide Table of Contentsex.osaka-kyoiku.ac.jp/~fujii/2015/CfxProgGuide.pdf · –without writing a line of code. The ChartFX User interface was also enhanced

219

WWall Width, 71width, lines, 68Wizard, Class MFC, 200Wizards, 24Word, 13

XX axis

scrolling in real time, 144X-axis, 49XValue, 186XValueEx, 75XY, 10, 75XY Plots, FAQ, 77

YY Axis, 49Y axis, secondary, 50, 83YValue, 31

Zz axis, 71Zoom, 9