Custom scatter plot using Paintable Canvas?

My company makes large rolls of polymer based fleece and we have a vision system that tracks flaws and another system that tracks the yarn that is laid into the fleece. I have been able to bring data from both of these systems as datasets (using SQL queries).

What I would like to create is a scatter plot that can be scrolled vertically along the length of the fleece roll and view the flaw positions and type. The type would be distinguished by shape, or size and color.

I tried using the dot renderer in the chart object however it doesn’t look to be flexible enough to accomplish my goal.

Any suggestions on how to accomplish this?

I have attached a sample of the dataset for 1 roll. I would be using the x and y coordinates along with the flaw classification to build the chart.

Thanks in advance!


Actually, I do this a lot and works very well. I’ve made stacked 3d charts, continuous time line charts and all kinds of other stuff using the canvas.

One caveat: It isn’t trivial, and I highly recommend that if you try this, plan it well and break your canvas code into functions wherever possible. Canvas scripts can grow quickly, but are manageable if you are organized. But once you are good at it, you’ll find that having complete control over things like axis labels and layout is really nice.

Thanks Step7. Would you be willing to share, as an example, a portion of one of yours?

I wasn’t sure if working with the paintable canvas would be the way to go, or to try building my own component using the jfree chart scatter plot. At first glance, the jfree chart scatter plot has all of the pieces I would need, including control of the point shapes and colors.

Going forward I will also create my own components, but they will still be based on the canvas. It gives me the option of full animation, overlays, and I can even switch graph types in a sort of slideshow format. My guess is that jFree charts are also based on the canvas, but at the end of the day I like having full control over what I’m getting and it ultimately saves time.

I am really swamped right now, but I’ll try to post a screen shot of a couple of the things I’ve done. One thing that was really useful was a kind of virtual chart recorder that allowed the maintenance guys to select some tags and have them “print” on a continuous chart just like their real chart recorders. After that I found I could mix data types or anything else I wanted to do on the same chart.

Your virtual chart recorder sounds like it’s pretty close to what I am looking to do except I would be drawing shapes at specific coordinates rather than continuous lines. It would scroll just like a chart recorder though.

I would also like to pull up historical plots of rolls that have already been completed and have the ability for the user to scroll the chart down the length of the roll and view the mapping of flaws.

Seems like you’ve come a long way with the paintable canvas. I’m new with it (and jython in general) but I have programmed in other languages so hopefully it will come fast.

Thanks for the interest in my little project!