Home > Software engineering >  Used in the MFC ChartCtrl, how to realize the c # markerStyle attribute control Chart
Used in the MFC ChartCtrl, how to realize the c # markerStyle attribute control Chart

Time:09-28


Want to achieve on the broken line shows the function of data source, see chart control can be easily set markerStyle properties of c # to achieve, but can't find this attribute in c + + MFC ChartCtrll, don't know what can be done with what method?

CodePudding user response:

For reference only, although VB6:
 VERSION 5.00 
Object="{65 e121d4 d2 - A9FC - 0000-0 c60-11 f8754da1} # 2.0 # 0"; "Mschrt20. Ocx"
The Begin VB. Form Form1
Caption="Chart"
ClientHeight=3480
ClientLeft=5190
ClientTop=4005
ClientWidth=11505
ClipControls=0 'False
ForeColor=& amp; H80000017 & amp;
KeyPreview=1 'True
LinkTopic="Form1"
MaxButton=0 'False
MousePointer=2 'Cross
ScaleHeight=3480
ScaleWidth=11505
StartUpPosition=2 'screen center
The Begin VB. PictureBox Picture1
Appearance=0 'Flat
BorderStyle=0 'None
ForeColor=& amp; H80000008 & amp;
Height=375
Left=10200
ScaleHeight=375
ScaleWidth=1215
TabIndex=2
Top=3000
The Visible=0 'False
Width=1215
End
The Begin MSChart20Lib. MSChart pie
Height=3450
Left=0
OleObjectBlob="Chart. Usd: 0000
TabIndex=0
Top=0
Width=11475
End
The Begin VB. Label Label1
Alignment=2 'Center
Caption="0"
BeginProperty Font
Name="tahoma"
Size=42
Charset=134
Weight=400
Underline=0 'False
Italic=0 'False
Strikethrough=0 'False
EndProperty
Height=855
Left=4200
TabIndex=1
Top=1320
Width=3015
End
End
The Attribute VB_Name="Form1"
The Attribute VB_GlobalNameSpace=False
The Attribute VB_Creatable=False
The Attribute VB_PredeclaredId=True
The Attribute VB_Exposed=False
Option Explicit
Dim As Integer I
Dim f As Integer
Dim ln the As String
Dim n As Integer
Dim As Integer c
Dim g As Integer
Dim As Double d
Dim cn As Integer
Dim cc (1 To 7) As Long
Private Sub Form_KeyPress (KeyAscii As Integer)
If KeyAscii=27 Then End 'form
End Sub
Private Sub Form_Load ()
'On Error GoTo FLEND
Cc (1)=RGB (0, 0, 255)
Cc (2)=RGB (10, 128, 10)
Cc (3)=RGB (255, 0, 0)
Cc (4)=RGB (255, 0, 255)
Cc (5)=RGB (255, 255, 0)
Cc (6)=RGB (255, 255, 255)
Cc (7)=RGB (0, 255, 255)
F=FreeFile ()
"C: \ data. TXT" Open For Input As # f
The Line Input # f, ln
Close # f

Open "c: \ data1ln TXT" For the Output As # f
Print # f, ln
Close # f

Open "c: \ data1ln TXT" For Input As # f
Cn=0
Do
If EOF (f) Then Exit the Do
Input # f, d
Cn=cn + 1
Loop
Close # f
If the cn & lt;=0 Or cn & gt; 7 Then End 'form
"C: \ data. TXT" Open For Input As # f
Pie. Enabled=False
'pie. DoSetCursor=False
Pie. MousePointer=VtMousePointerCross
Pie. The Top=0
Pie. Left=0
Pie. Width=Form1. Width - 120
Pie. Height=Form1. Height - 390
Pie. ChartType=VtChChartType2dLine
Pie. ColumnCount=cn
Label1. Caption="0"
Label1. Visible=True
Pie. Visible=False
Form1. Show
N=Val (Command $)
If n & lt;=0 Then
N=0
Do
If EOF (f) Then Exit the Do
The Line Input # f, ln
N=n + 1
Loop
Close # f
"C: \ data. TXT" Open For Input As # f
End the If
On the Error Resume Next
Pie. The RowCount=n
I=1
Do
If EOF (f) Then Exit the Do
Pie. Row=I
If I Mod 10=1 Then pie. RowLabel=CStr (I - 1)
For c=1 To cn
Input # f, d
Pie. The Column=c
Pie. Data=https://bbs.csdn.net/topics/d
Next
I=I + 1
If I Mod 100=0 Then Label1. Caption=CStr (I) : DoEvents
If I & gt; N Then Exit the Do
Loop
Close # f
Label1. Visible=False
If I & lt; Then 500
G=10
ElseIf I & lt; Then 5000
G=100
The Else
G=1000
End the If
With pie. The Plot. The Axis (VtChAxisIdX)
'AxisScale. Type=VtChScaleTypeLinear
'ValueScale. MajorDivision=g
'ValueScale. MinorDivision=g
. CategoryScale. Auto=False 'is set to manual scaling,
. CategoryScale. DivisionsPerLabel=g '/g unit display label,
. CategoryScale. DivisionsPerTick=g '/g units according to scale,
. CategoryScale. LabelTick=True 'at the top of the tick marks show labels,
End With
Pie. Visible=True
The Exit Sub
FLEND:
End 'Form
End Sub
Private Sub Form_Resize ()
Pie. Width=Form1. Width - 120
Pie. Height=Form1. Height - 390
End Sub
Private Sub Form_Unload (Cancel As Integer)
End 'form
End Sub
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related