VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Generating Charts using ChartFX Control

by Bhuwan Chand Joshi (69 Submissions)
Category: Graphics
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 21st July 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Generating Charts using ChartFX Control

Rate Generating Charts using ChartFX Control



'Generating Charts:

'To generate charts using ChartFX control, First you need to install it because It's not a product of Microsoft Inc. You can use it as a third-party component to generate various type of charts 

'Open a standard exe form

'Place a ChartFX control over the form

'Set the chart type property as Bar chart at design time

'Type the code given below

Private sub Form_Load()

Dim arr(9) As Integer
arr(0) = 200
arr(1) = 300
arr(2) = 150
arr(3) = 100
arr(4) = 200
arr(5) = 100
arr(6) = 250
arr(7) = 110
arr(8) = 350


ChartFX1.OpenDataEx COD_VALUES, 2, 9
For x = 0 To 8
ChartFX1.Value(x) = arr(x)
Next x
ChartFX1.CloseData COD_VALUES


ChartFX1.Series(0).Legend = "Demo1"
ChartFX1.Series(1).Legend = "Demo2"
ChartFX1.SerLegBox = True
ChartFX1.SerLegBoxObj.Docked = TGFP_FIXED
ChartFX1.SerLegBoxObj.Left = 60
ChartFX1.SerLegBoxObj.Top = 40
ChartFX1.SerLegBoxObj.BkColor = CHART_TRANSPARENT


For J = 0 To 8
If J = 0 Then
ChartFX1.Axis(AXIS_X).Label(J) = "A"
ElseIf J = 1 Then
ChartFX1.Axis(AXIS_X).Label(J) = "B"
ElseIf J = 2 Then
ChartFX1.Axis(AXIS_X).Label(J) = "C"
ElseIf J = 3 Then
ChartFX1.Axis(AXIS_X).Label(J) = "D"
ElseIf J = 4 Then
ChartFX1.Axis(AXIS_X).Label(J) = "E"
ElseIf J = 5 Then
ChartFX1.Axis(AXIS_X).Label(J) = "F"
ElseIf J = 6 Then
ChartFX1.Axis(AXIS_X).Label(J) = "G"
ElseIf J = 7 Then
ChartFX1.Axis(AXIS_X).Label(J) = "H"
ElseIf J = 8 Then
ChartFX1.Axis(AXIS_X).Label(J) = "I"
End If
Next J


ChartFX1.Title(CHART_BOTTOMTIT) = "Demo Chart"
ChartFX1.Export CHART_BITMAP, "Path where you want to save the Chart Image in BMP format"

End Sub

'Run the application and see the chart. You can modify it according to need of the client.



Download this snippet    Add to My Saved Code

Generating Charts using ChartFX Control Comments

No comments have been posted about Generating Charts using ChartFX Control. Why not be the first to post a comment about Generating Charts using ChartFX Control.

Post your comment

Subject:
Message:
0/1000 characters