The Chart FX Data Wizard
The Chart FX Smart Tag Wizard provides the basic datasource configuration option available to other controls in Visual Studio, so you can quickly create and/or connect to an existing database or dataset in your project.
The first step is to properly create the project’s Data Source and connect the chart to it. Like any other data aware control, Chart FX exposes the "choose data source" option that provides access to Visual Studio’s database wizard.
If you are not familiar with typed datasets, please refer to the Visual Studio documentation for more information on how to properly create and configure database objects in your project.
It is also important to mention, Chart FX provides additional methods to populate charts, these include, among others: XML files and API calls. For more information about these chart population methods please refer to later sections in this guide.
Although Visual Studio makes it simple to connect to data sources, there is still a lot of processing that needs to be done in order to make a dataset functional to a chart component. For example, if you are creating a scatter chart, you must specify and map which fields represent the x and y values or if you are charting financial data you must then map the Hi, Low and Close values to fields in your SQL statement so Chart FX can display the data appropriately.
Once you have selected a typed dataset and a query, simply select the "Adjust Data to chart" verb in the Smart Tag Wizard to properly instruct Chart FX how to process fields in the query.
The first screen in the Data Wizard allows you to filter the fields that will be actually plotted in the chart. With this screen you can actually reuse existing queries in your data source and simply select the fields you want to plot in the chart.
All numeric fields will be considered series in the chart and all text or date/time fields will be considered as x-axis labels.
The Data Wizard also allows you to set series labels and their paint order (z-order) in the chart.
The Chart FX Data Wizard also provides a powerful error detection mechanism that alerts you of any potential problems or conflicts between your query and how Chart FX will attempt to plot at run time.
The Data Wizard error detection mechanism is also interconnected with other sections of the Smart Tag Wizard. For example, if you decide to change the chart type to another gallery after setting up the Data Wizard settings, Chart FX will automatically alert you of potential problems with your application.
The most basic method of passing data to a chart using Chart FX 7 is to use a typed dataset in conjunction with the Chart FX Smart Tag Wizard at design-time. The Data Wizard provides a graphical way to extract and configure data from your project’s data source and database objects. However, sometimes this is not possible due to the nature of the data to be integrated and plotted in the chart. Some of these data sources include databases, text files, Crosstab, OLAP, XML, arrays, collections, and many others.
Passing data from databases and text files is supported by Chart FX's core, however, all the code required to read data from XML, array and collection sources has been isolated in an additional assembly (ChartFX.Data.DLL) allowing Software FX to easily build additional "Chart FX Data Providers."
By providing an additional assembly exclusively used for data, the programmer can decide when to include or exclude the assembly, thus giving control of what is to be deployed. Although data functionality requires an additional assembly to be deployed as part of your application, it allows Chart FX to provide easy integration of new data sources, e.g. Active Directory, Grids, OLAP, etc.
For internal data structures like collections and arrays there is no need to loop through data points to populate the charts. If you have a previously filled data array, just pass it to Chart FX and have the chart filled with data with as little as one line of code.
For additional information, please refer to the Chart FX 7 API and electronic documentation.
© Copyright 2000-2023 COGITO SOFTWARE CO.,LTD. All rights reserved