FlexReport provides the Legacy Chart field, and it uses the C1.Win.C1Chart and C1.Win.C1Chart3D assemblies to render chart fields consisting of 2D and 3D chart types, respectively.
In order to view the Chart buttons in the Insert tab, select the check-boxes against Show "Legacy Chart" button on the INSERT tab from the FlexReportDesigner Options on the General tab.
For more information on 2DCharts and 3DCharts, see 2DChart documentation and 3DChart documentation, respectively.
The Chart Field in FlexReport allows you to insert various types of charts using Chart.Chart2DGroup.ChartType and Chart.Chart3DGroup.ChartType. The chart types that are supported in FlexReport are - Area, Bar (horizontal bars), Column (vertical columns), Doughnut, Scatter (X-Y values), Line, Pie, Step, Stock, Histogram, Radar, Polar, and 3D charts-Cone, Cylinder, and Pyramid. The chart types can be easily selected using the ChartType property in the Properties window of the FlexReportDesigner.
An Area chart draws each series as connected points of data, filled below the points. Each series is drawn on top of the preceding series.
A Bar chart or a Column chart represents each series in the form of bars of the same color and width, whose length is determined by its value. Each new series is plotted in the form of bars next to the bars of the preceding series. A Bar or Column chart draws each series as a bar in a cluster. The number of clusters is the number of points in the data. Each cluster displays the nth data point in each series. When the bars are arranged horizontally, the chart is called a bar chart and when the bars are arranged vertically, the chart is called column chart.
The following image represents a Bar chart:
The following image represents a Column chart:
A Bubble chart combines two independent values to supply both the point y value and the point sizes. Bubble charts are used to represent an additional data value at each point by changing its size. The Y array elements determine the Cartesian position (as in a XY-Plot chart), and the Y1 element values determine the size of the bubble at each point. The size of the points can be encoded according to area or diameter.
A Scatter chart uses two values to represent each data point. This type of chart is often used to support statistical techniques that quantify the relationship between the variables (typically Linear Regression Analysis).
A Pie chart draws each series as a slice in a pie. The number of pies is the number of points in the data. Each pie displays the nth data point in each series. You can also customize Pie charts for displaying legends and labels.
A doughnut chart is a pie chart with a non-zero radius and is identical in function to a pie chart, but can be used to increase aesthetic appeal, particularly when shown with 3D effects. As with all pie charts, each doughnut shows each series as a fraction of the whole at each data point. If multiple data points are specified, then multiple doughnuts appear in the chart.
A doughnut chart can be created by setting the InnerRadius property of a pie chart to a non-zero value. The InnerRadius value represents the percentage of the full pie radius. The InnerRadius property can be accessed in the pie object of each Chart group.
A Radar chart draws the y value in each data set along a radar line (the x value is ignored except for labels). If the data has n unique points, then the chart plane is divided into n equal angle segments, and a radar line is drawn (representing each point) at n/360 degree increments. By default, the radar line representing the first point is drawn vertically (at 90 degrees). Radar charts can be further customized.
A Step chart is a form of XY plot chart that draws series as connected points of data. These charts are often used when Y values change by discrete amounts, at specific values of X with a sudden change of value. A simple, everyday example would be a plot of a checkbook balance with time. As each deposit is made, and each check is written, the balance (Y value) of the check register changes suddenly, rather than gradually, as time passes (X value). During the time that no deposits are made, or checks written, the balance (Y value) remains constant as time passes.
A Line chart draws each series as connected points of data. It is the most effective way of denoting changes in values between different groups of data. These charts are commonly used to show trends and performance over time.
Stock charts used in financial applications to show the opening, closing, high and low prices of a given stock. The types of stock charts are as follows:
The Candle chart is made up of the following elements: candle, wick, and tail. The candle or the body (the solid bar between the opening and closing values) represents the change in stock price from opening to closing. The thin lines, wick and tail, above and below the candle depict the high/low range. A hollow candle or transparent candle indicates a rising stock price (close was higher than open). In a hollow candle, the bottom of the body represents the opening price and the top of the body represents the closing price. A filled candle indicates a falling stock price (open was higher than close). In a filled candle the top of the body represents the opening price and the bottom of the body represents the closing price.
C1Chart creates the Candle chart with using the Y value for the High, Y1 for the low, Y2 for the open, and Y3 for the close. C1Chart automatically fills the falling candle with the value of the line color.
A Histogram chart takes a collection of raw data values and plots the frequency distribution. It is frequently used with grouped data, which is generated by measuring a collection of raw data and plotting the number of data values that fall within defined intervals. Note that raw values are not used to generate data for a histogram, but are used to generate a frequency instead. While showing similarities to bar charts, it is important to note that histograms are used with quantitative variables whereas bar charts are commonly used with qualitative variables.
While the histogram and bar charts' appearances relate, their functionality does not. A bar chart is created from data points whereas a Histogram is created from the frequency distribution of the data. The charts following illustrate the difference between a bar chart and a histogram chart. Both of the charts use exactly the same Y data. The bar chart (top) shows each average mean temperature for each year in which it occurred. The histogram chart (bottom) using the same input temperature data automatically tabulates the number of temperatures that fall within each interval and draws the resulting histogram. For convenience, chart labels with the count in each interval have been added at the top of each interval.A histogram is beneficial for pinpointing prominent features of the distribution of data for a quantitative variable. The important features for a quantitative variable include the following:
To select the chart type as Histogram, go to ChartGroups|Group0 and set the ChartType to Histogram.
A Polar chart draws the x and y coordinates in each series as (theta,r), where theta is amount of rotation from the origin and r is the distance from the origin. Theta may be specified in either degrees (default) or radians. Since the X-axis is a circle, the X-axis maximum and minimum values are fixed. The series can be drawn independently, or stacked.
The Chart field in FlexReport provides design-time support through design-time editors and collection editors that simplify working with the charts.
The design-time editors for Chart field are as follows:
These editors can be invoked by right-clicking the chart field and selecting the required editor.
It provides an easy and interactive way to create and modify a new or existing chart. It contains the options to select the type of chart and . However, it also includes additional property settings for the x and y axis along with appearance settings for the header, footer, legend, chart area, and plot area of the chart. The Chart Properties dialog box provides more options to address specific details with the design of the chart you are developing. It consists of following elements:
The Chart Data editor lets you bind the chart by setting data through Chart Data-add or remove data series in your chart, specify the label and color of each data series, and stack your data by checking the Show stacked data check box.
Visual Effects is a tool used for visually enhancing the Chart2D control's elements such as the data series, header, and footer. Any existing project can use the new features provided by this tool. The chart's appearance can dramatically improve in a few simple steps using the Visual Effects designer.
The collection editors for Chart field are as follows:
The steps to plot a simple 2D chart are as follows:
For example, the chart shown is created using C1NWind.mdb database and Products table, with following properties set:
Add series label as follows:
Add legend as follows:
Add Titles to the chart as follows:
You can also add axis titles in the chart, add back color and border to chart area, and more. For more information on using properties for customizing charts, see 2DChart documentation.
Three dimensional data can be represented in the form of 3D Surface, 3D Bar, and many more by using 3D Chart types. To plot 3D charts from 2D charts, you can change the VisualizationType property to Chart3D. For more information on plotting 3D charts, see 3DChart documentation.
FlexReport allows you to add data to the charts without binding the charts to a data source. You can plot series on chart and display it by setting an array of X and Y values directly in unbound mode. Let us add an unbound 2D chart by performing the following steps:
For 3D unbound chart, perform the following steps:
Sometimes you need to create charts that have multiple data sets or multiple series. To create such charts, the values for each series are required to be set.
Consider an example of Products table from C1Nwind.mdb database, where you want to view Unit Price, Units in Stock, and Reorder Level corresponding to the Category IDs. The steps to achieve this scenario are as follows:
Series Label | Values | Style | Fill |
Unit Price | UnitPrice | Blue Voilet |
Units in Stock | UnitsinStock | Pale Turquoise |
Reorder Level | ReorderLevel | Deep Pink |
To create Legend:
FlexReport for allows you to create reports with multiple groups. For example, instead of listing all products in a single flat report, you could group products by category. Each group has a header and a footer section that allow you to display information about the group, including titles and subtotals, for example.
If you add a chart to a group header, the chart will display only the data for the current group. By contrast, adding a chart to the report header or footer would include all the data in the report.
To illustrate this, here is a diagram depicting a report definition as shown in the report designer and showing the effect of adding a Chart field to the report header and to a group header:
Report Header section A chart field here would generate |
Page Header section |
Group Header section (CategoryName) A chart field here would generate |
Detail section |
Group Footer section (CategoryName) |
Page Footer section |
Report Footer section |
Continuing with the example mentioned above, lets visualize the report data for each category through chart.
Add a Legacy Chart field to the Group Header section (Category Name) and create the chart as explained in the Plot Data in Charts section. Specify X and Y values of the chart as ProductName and UnitPrice and specify Value in Series Values as UnitPrice.
The images below show screenshots of the report described above with the group headers, the charts they contain, and a few detail records to illustrate:
The chart above shows unit prices for products in the "Condiments" category. The chart below shows unit prices for products in the "Confections" category.