Topic
Axis problems
Startseite ' Community ' Automation and VBA ' Axis problems
- Dieses Thema hat 5 Antworten sowie 2 Teilnehmer und wurde zuletzt vor vor 17 Jahren, 6 Monaten von Gordon Leonard aktualisiert.
-
AutorBeiträge
-
07.11.2007 um 03:11 Uhr #34871Gordon LeonardTeilnehmer
Here we go, whilst using the 30 day trial, i don’t have long to find out what FlexPro is like etc and I do like forums so will be on here a lot, probably with lots of repeated questions. The only way i have found to search the forum is to go via google which often pops up with results linking back here.
I have created a flexpro object within VB, then created a dataset and populated it with values. I will mainly be plotting column x against y, so have set up a “.DataStructure = fpDataStructureDataMatrix” with 2 columns and pass it a VB array like DataArry(1,100): .Value(fpDataComponentAll) = DataArray. Is this the best way to do it?
I have then plotted the dataset on a ‘diagram2d’ which is where my first issue comes up. If the first element in the array (at (0,0)) is (130,-99) for instance, the axis starts at 0,0 (or atleast the ticks say (0,0)) where i would have expected them to show that the first point is at (130,-99). I hope i have explained myself. I am obviously missing something but have not worked out what?
Thanks in advance
Gordon
07.11.2007 um 03:11 Uhr #34876Gordon LeonardTeilnehmerHere we go, whilst using the 30 day trial, i don’t have long to find out what FlexPro is like etc and I do like forums so will be on here a lot, probably with lots of repeated questions. The only way i have found to search the forum is to go via google which often pops up with results linking back here.
I have created a flexpro object within VB, then created a dataset and populated it with values. I will mainly be plotting column x against y, so have set up a “.DataStructure = fpDataStructureDataMatrix” with 2 columns and pass it a VB array like DataArry(1,100): .Value(fpDataComponentAll) = DataArray. Is this the best way to do it?
I have then plotted the dataset on a ‘diagram2d’ which is where my first issue comes up. If the first element in the array (at (0,0)) is (130,-99) for instance, the axis starts at 0,0 (or atleast the ticks say (0,0)) where i would have expected them to show that the first point is at (130,-99). I hope i have explained myself. I am obviously missing something but have not worked out what?
Thanks in advance
Gordon
07.11.2007 um 18:31 Uhr #34872Bernhard KantzTeilnehmerPlease use the data structure ‘Signal’ instead of ‘data matrix’.
[code]
…
.DataStructure = fpDataStructureSignal
…
[/code]
A signal has a Y-component and a X-component, each with a data set of the same length.If you create a 2D-diagram for a signal, it’s not necessary to enter the dataset for the X-component in the diagram wizard.
But if you want to create a 2D-diagram for a data matrix (first column: Y-component, second column: X-component) you have to enter the X- and the Y-component:
The Y-component is matrix[0] and the X-component is matrix[1].Please see also
FlexPro Help (F1)
Working with Data Sets07.11.2007 um 21:14 Uhr #34873Gordon LeonardTeilnehmerThanks for the reply.
At the moment a signal, with 2 columns will not plot y against x. (it actually plots something that looks right, but clearly isn’t!)
##code:
datasignal.Value(fpDataComponentAll) = datarr
2dgraph.Curves.Add.Data.dataset= “data1”
##the closest i have got is to create any type of data structure, then use the flexpro gui to choose to plot data1[0] against data1[1], although i dont know how to do this in terms of vb objects (i want to tell the plot i want to use “seperate data sets for x and y comps”):
pseudo code:
2dgraph.Curves.Add.Data.XAxis= “data1[0]”
2dgraph.Curves.Add.Data.YAxis= “data1.Y[1]”
end07.11.2007 um 21:54 Uhr #34874Bernhard KantzTeilnehmerUse the [b]Composed[/b]-property. ‘data1’ is a signal.
[code]
Dim oDiagram As Diagram2D
Set oDiagram = ActiveDatabase.RootFolder.Add(“2D-Diagram”, fpObjectType2DDiagram)
With oDiagram.Curves.Add.Data
.Composed = True
.DataSet = “data1.Y”
.XDataSet = “data1.X”
End With
oDiagram.Update
[/code]The macro recorder is the most convenient way of creating a macro. Even if you are working with FlexPro Professional and have the Visual Basic Editor available for programming, it makes sense to start with a macro recording and to modify the code later, if necessary.
See also
Automating Task|Creating and Using Macros07.11.2007 um 22:06 Uhr #34875Gordon LeonardTeilnehmeryou won’t believe me, but i have just worked that out from the help, i wasn’t sure if it was the best way to do things.
i’ll look in to recording macros using this example so i can work out what is going on.
Thanks!!!!!!
-
AutorBeiträge
- Du musst angemeldet sein, um auf dieses Thema antworten zu können.