USE OF CHART CONTROL IN PROJECT WORKBENCH . . .
2023-01-05-092316
All --
I have an IMAGE-PRO PLUS V7 APP that I am upgrading to an IMAGE-PRO V10 APP.
The APP for V7 was written with VISUAL BASIC from VISUAL STUDIO.
The APP for V10 is being written with the PROJECT WORKBENCH.
In the APP for V7, there is a CHART that appears as shown here.

This CHART has a PRIMARY Y AXIS and a SECONDARY Y AXIS that have different MIN / MAX / RANGE and X AXIS LABELS that are ROTATED.
Something similar from EXCEL is shown here

I would like to generate the same type of CHART using V10 but I am not able to get the VALUES to appear for the PRIMARY Y AXIS or the SECONDARY Y AXIS and I am not able to ROTATE the VALUES for the X AXIS.
I have poked at the configuration of the CHART CONTROL in the PROJECT WORKBENCH DESIGN VIEW and the CODE in the CODE VIEW and the best that I can get is similar to

When my DATA is set up as
chart1.Series("Series1").Points.AddXY("AAA",4) chart1.Series("Series1").Points.AddXY("BBB",5) chart1.Series("Series1").Points.AddXY("CCC",6) chart1.Series("Series2").Points.AddXY("AAA",40) chart1.Series("Series2").Points.AddXY("BBB",50) chart1.Series("Series2").Points.AddXY("CCC",60)
I have created and attached an IPX FILE named
CHART QUESTION PROJECT.ipx
that I hope will be helpful in directing me to the solution.
I would also appreciate it if you could direct me to what is wrong with the DATA BIND XY statement that is in the IPX FILE and shown here but I know how to work around that.
Dim Prog_HistDataX () As Single
Dim Prog_HistDataY () As Single
'Dimension the ARRAYS to match the HISTOGRAM
ReDim Preserve Prog_HistDataX (3)
Prog_HistDataX(0) = 1
Prog_HistDataX(1) = 2
Prog_HistDataX(2) = 3
ReDim Preserve Prog_HistDataY (3)
Prog_HistDataY(0) = 4
Prog_HistDataY(1) = 5
Prog_HistDataY(2) = 6
'Bind the X and Y DATA ARRAYS to the CHART
' chart1.Series("Series1").Points.DataBindXY(Prog_HistDataX,Prog_HistDataY)
Thanks.
Thanks.
-- Matt
0
Answers
-
Hi Matt,
I see that you use System.Windows.Forms.DataVisualization.Charting.Chart class for the chart.
This is a .NET class from microsoft. You can find info on the web, just search for "System.Windows.Forms.DataVisualization.Charting.Chart". For example:
https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.datavisualization.charting.chart?view=netframework-4.8.1
or
https://snipplr.com/view/25227/datavisualizationchartingchart-simple-example
Regards,
Yuri0 -
2023-01-05-100537Yuri --Thank you for the guidance.I looked at many references on the CHART CONTROL and was unable to get the CHART1 in my PROJECT to display properly.I will weave the EXAMPLE CODE atinto my PROJECT.Hopefully that will provide the SECRET SAUCE that is missing PROJECT CODE to make the CONTROL appear as desired.Thanks again.-- Matt
0 -
Hi Matt,
I never worked with this chart control personally, but I found an example on web that demonstrates using 2 axes:
https://skanky.dev/csharp/c-sharp/charts/examples/creating-a-chart-with-2-y-axis
I converted the example from C# to VB.NET using https://converter.telerik.com/
and attached the IPX with the example, the result looks like this:
Yuri
0 -
2023-01-05-114356Yuri --Thank you for your work on this.When I remove myCHART QUESTION PROJECT.ipxfrom IP10.0.13 and add yourCHART QUESTION PROJECT2.ipxto my IP10.0.13 it LOADS ok but when I attempt to OPEN the APP the following error is generated.Here is a picture of the PROJECT WORKBENCH with the ERROR WINDOW openIt looks like the same issue that I was seeing with the DATA BIND XY in the CODE that I was working with.What are your thoughts on this?Thanks again.-- Matt
0 -
2023-01-05-171932Yuri --Using the INFORMATION and CODE that you provided, I have the CHART tuned up pretty well.In the IPP7 APP, the CHART appeared as shown here.I now have CODE in the IP10 APP that generates the following CHART.The IP10 PROJECT that generates this CHART in the APP DIALOG is attached asCHART QUESTION PROJECT -- 2023-01-05-171916.ipxThis CHART and the CODE behind it will need a little more TLC but this is presenting the DATA in the manner that the customer is used to from their work with the IPP7 APP.There is still an issue with the DataBindXY but I can work around that.Thank you very much for your guidance and assistance on this.
-- Matt
0 -
Hi Matt,
I'm glad that you've found a solution!
The problem with DataBindXY is that IP10's macro language in interpreted mode cannot handle that conversion, so a workaround would be to switch the project to "Compiled" mode (where DataBindXY is handled properly) or use AddXY function instead, as you did.
Yuri0 -
2023-01-06-095817Yuri --Thank you for that information.My attempts to use the COMPILE MODE have not gone well but I will give it another attempt.Thanks again.-- Matt
0
Categories
- All Categories
- 961 Image-Pro v9 and higher
- 9 Image-Pro FAQs
- 18 Image-Pro Download & Install
- 448 Image-Pro General Discussions
- 486 Image-Pro Automation (Macros, Apps, Reports)
- 20 AutoQuant Deconvolution
- 2 AutoQuant Download & Install
- 18 AutoQuant General Discussions
- 195 Image-Pro Plus v7 and lower
- 3 Image-Pro Plus Download & Install
- 106 Image-Pro Plus General Discussions
- 86 Image-Pro Plus Automation with Macros
- 19 Legacy Products
- 16 Image-Pro Premier 3D General Discussions
- 26 Image-Pro Insight General Discussions