i'm happy to announce that foxcharts has recently been accepted as a vfpx project.
today i've just uploaded to vfpx at codeplex a new version of foxcharts. this is version 0.14 - still alpha - not for production !
prerequisites:
visual foxpro 9 and the gdiplusx library from vfpx
first of all i have to thank you all for your kind comments and feedback you provided in my last post. i had never expected to receive so many comments, in this blog, at the other vfp forums and by email. i really apreciated that. be sure that your feedback resulted in a superpowered motivation to improve it.
it is also important to tell everybody of the importance that both bo durban and craig boyd have in this project. they are the menthors and fathers of gdiplusx. without gdiplusx this project would become almost impossible. if i had to use any other of the gdi+ classes available for vfp, for sure it would have taken much more time - believe-me, i've tried them all.
using gdiplusx i can be indeed much more productive. once you understand how it works, things become really easy and simple.
at first sight, when i saw one of the first versions that bo and craig designed for gdiplusx i was really amazed, and i said to myself - i have to go deeper into this.
bo durban has also provided important help, providing important suggestions, support and testing. thanks also to emersonreed, luis maria guayan and leandro walfrans for your tips and support.
this version also distributes the two main files from gdiplusx - system.app and gdiplusx.vcx.
if you are already a gdiplusx user, you can use your own gdiplusx version.
just make sure to be using the latest version.
this new release contains lots of enhancements:
chart types
- bar charts
- multiple bars
- stacked bars
- pie
- doughnut
- lines
- area
- points and shapes
color variations:
- basic colors
- custom colors
- gradient colors
- random colors
- monochrome
- gradient or solid colors
legends in many places: axys, shapes, side legends
scales - automatic or customized
customize:
- titles
- subtitles
- backgrounds (solid or gradient)
- fonts
- colors
the sample form shows most of the features that are available. run the form "chartssample.scx" and play changing the various properties, generating some cool charts like the ones below.
all the relevant codes are in the init() event of the sample form. with very few lines of code you can create super cool and beautiful charts.
this sample also includes a report sample. check the codes in the command button that generates a report to see one of the various ways we have to print our charts.
important to remember that this is still an alpha version, and is not recommended to be used in production although it works nice.
some important improvements still need to be applied, specially in the class initialization. the codes also need to be optimized. my priority was in obtaining the results, and in many places the performance can be improved.
if you have any tips, or can provide suggestions, or fixes, you are most welcome !
enjoy !
download the latest version directly from the foxcharts page on vfpx:
http://www.codeplex.com/vfpx/wiki/view.aspx?title=foxcharts&referringtitle=home
the page for the latest release 0.14 alpha:
http://www.codeplex.com/vfpx/release/projectreleases.aspx?releaseid=12847
here are the properties that are currently provided in foxcharts, that you can use to improve your charts:
sourcealias | character, the name of the alias that contains the needed fields that will create the chart |
fieldvalue1 | character, the field name of the cursor that contains the numeric values that contain the values that will create the chart. |
fieldcolor | character, the field name of the cursor that contains the rgb values of the custom colors for the chart |
fielddetachslice | character, the field name of the cursor that contains the logical values that tell if the slice of the pie or donut chart will be detached or not |
fieldhideslice | character, the field name of the cursor that contains the logical values that tell if the slice of the pie or donut chart will be hidden or not |
fieldlegend | character, the field name of the cursor that contains the character values that contain the main legends of the pie or donut charts |
fieldlegend2 | character, the field name of the cursor that contains the character values that contain the secondary legends of the chart that will be drawn inside the slice, or point or bar. |
fieldxaxys | character, the name of the field that contains the text to be drawn in the x axys |
color1 | numeric, the rgb value of the color from the first chart |
legend1 | character, the legend text for the first sequence of values |
charttype | numeric, type of chart: 1 = pie ; 2 = donut ; 3 = unspecified ; 4 = point ; 5 = line ; 6 = area ; 7 = simple bar ; 8 = multiple bars ; 9 = stacked bars |
chartscount | numeric, the number of value sources |
fontname | character, the name of the font to be used to display text |
titlefontsize | numeric, the font size for the main title |
titlecaption | character, the title caption |
titleforecolor | numeric, the title and subtitle forecolor rgb value |
subtitlecaption | character, the subtitle caption |
subtitlefontsize | numeric, the subtitle font size |
showlegend | logical, shows the side legends |
legendfontsize | numeric, the fontsize for the side legends |
legendforecolor | numeric, the legend fore color rgb value |
showvaluesonshapes | logical, determines if the values will be drawn inside the shapes of the chart |
legendonshapecolor | numeric, the rgb value for the shape color |
legendonshapefontsize | numeric, the font size for legends on shape |
showaxys | logical, for line, area or point charts - determines if the x and y axys will be drawn |
axysxcaption | character, the main text for the x axys |
axysycaption | character, the main text for the y axys |
axyscolor | numeric, the rgb value for the axys main color |
backcolor | numeric, rgb value of the main backcolor |
backcolor2 | numeric, rgb value of the secondary (destination) backcolor. this is used to create gradients, together with "backcolor" |
backgradientmode | numeric, if gradient background (having backcolor2 specified) - 0 - horizontal; 1 - vertical; 2 - diagonal1 ; 3 - diagonal 2 |
showscale | logical, determines if the scale in the y axys will be shown |
scale | numeric, the scale value for the y axys; 0 = automatic scale |
scalebacktype | numeric, the background scale type; 0 = none; 1 = lines; 2 = rectangle |
colortype | numeric, the type of colors of the chart: 0 = basic colors 1 = custom (default) 2 = random 3 = scale of gradients |
brushtype | numeric, type of brush used to fill the chart: 1 - solid colors; 2 - gradient colors; 3 - monochrome hatch brush |
gradientlevel | numeric, for gradient brush mode (-10 = destination black; 0 = solid color; +10 destination white) |
alphachannel | numeric, 0-255 determines the level of the transparency level; 255 = opaque; 0 = transparent |
_3d | numeric, the quantity of pixels that create the 3d effect (0 = plain) |
margin | numeric, specifies the margin width created in the text portion of the control. |
donutratio | numeric, for donut chart - the width of the donut related to its size ( 0.01 = full slice ; 0.99 = thin) |
linecaps | logical, for the case of plain line chart, shows rounded caps in each point. |
lineshape | |
pointsshape | numeric, the shape to be used in a points chart: 0 = round; 1 = square; 2 = triangle; 3 = cross; 4 = star; 5 = man; 98 = gdi+x path object; 99 = custom image |
pointsshapewidth | numeric, for point chart, determines the width of the pen that will draw the shapes |
piedetachpixels | numeric, for pie and donut charts, the quantity of pixels to detach from center |
barsspacebetween | numeric, for bars chart - the distance in pixels between bars |
area3dtop | logical, when true, a line will be drawn on the top of the 3d area chat |
multichart | logical, determines if more than one kind of chart will run at the same time |