Drawing multiple dots on a single 1D line shape.

Started by farfromfearless, April 22, 2014, 01:31:18 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

farfromfearless

My apologies if this has been asked before--I couldn't find this particular answer in the forums; however, I'm creating shape that's intended to be used to illustrate a Plot Line in a graph (this is for wire-framing purposes--purely illustration.)

What I've done so far is:

  • I'm able add start and end caps (dots) on my line using Visio's standard line styles;
  • I've added several control points which control the position of each vertex so that I can effect a plot line;

But I want to draw dots at each vertex in-between start and end points.

How might I accomplish this?

Thank you!

Jumpy

Place simple dots in the same color above the desired positions of the line and group everything together?

wapperdude

#2
Assuming the graph is linear, not log based...

The dots are equally spaced, or at variable intervals?  The number of dots always the same? 

Basically there are two approaches that I can think of.  One is Jumpy's suggestion, the 2nd would be to do everything in one shape by adding multiple geometry sections...one for each dot.  For the 1st case, I would take your line shape, convert it to a group, and then add the dots to the group. 

Each approach has several common features that they both need:
  1. Number of visible dots.  Could use shapedata entry to select how many dots to toggle off.
  2. Method to control position of dots.
        a.  Fixed intervals:  could use a formula to control position relative to width of line, e.g., dot1 @ 0.1*width, dot2 @ 0.2*width, etc.
        b.  Random, variable intervals:
                I. could use shapedata to enter the locations relative to the overall width: probably not very friendly approach
                II.  could use control points to grab and drag.
        c.  Since the dots are always on the line, which is a 1-D shape, the Y-placement will always be at height*0 of the group shape.

I prefer the 2nd approach, since everything is self-contained in a single shape and you don't have to worry about the dot's coordinates vs the group's coordinates.  That can get to be frustrating.  Plus, for the grouping approach, you need to take extra step to "freeze" the dot size so it doesn't change as you stretch/shrink the line width.

HTH
Wapperdude
Visio 2019 Pro

farfromfearless

#3
@Jumpy -- thank you for the suggestion. It was one of my first approaches, with a combination of glue points, controls, extra shapes, etc. It's serviceable, but didn't feel elegant.

@Wapperdude I took up your suggestion and used several Ellipsis sections to render the dots. That approach with some basic configurable settings in the User-defined Cells/Actions worked well to handle some basic customizations. Now, I'm going to attempt one shape with up to 10+ vertices. That leaves me with another question: How do I effectively disable controls and vertices I don't want to use?

Case 1: 3 Active Vertices + Start & End Points (Default)

o-----o-----o-----o-----o

Case 2: 2 Active Vertices + Start & End Points

o-----o-----o-----x-----o

Case 3: 1 Active Vertex + Start & End Points

o-----o-----x-----x-----o

A problem arises when you attempt to move any active vertex--doing so leaves inactive vertices fixed in their positions (relative to the last active vertex and the end point). This effectively renders an "elbow" or series of joints when dragging the active vertices.

Is this a matter of setting an alternate cell formula in the Geometry's LineTo X/Y cells for each inactive vertex?

Thank you for the help!

wapperdude

With the multiple geometry approach, my thought would be that Geometry1 would be your line, from beginx to endx, that is, it spans the entire width.  I assumed that you wanted just a single, straight line, no bends, with dots that just slide along the line.

Then, each circle would have its own geometry section, with a move to for location, and then elipse function to draw the circle...note, it could be filled.

To toggle a particular ellipse you could either use actions or shapedata.  Either way, you need an entry for each shape.  You can also use that same entry to show / hide control point via controls.xbehavior:  =0 to show, =5 to hide.  Actions would be accessible thru mouse right click and pop-up context menu.
Visio 2019 Pro

farfromfearless

#5
@wapperdude Yes, you are correct--Geometry1 is the primary line which contains an additional five (5) Geometry sections to draw each ellipse loc'd to each vertex in Geometry1. I've attached a screenshot illustrating where I'm stuck right now. If it helps, I can post up an *.vsd with this shape.

Edit: Looks like I'm not exercising my brain-piece--the mid-point is easy to calculate; I'm just struggling with the semantics of how best to set this shape up so I can toggle dots on and off.

@wapperdude Your suggestion with the shape sheets and actions makes more sense now, and I think what I might attempt is a fly-out child in the context menu to disable/enable vertices.

farfromfearless

I finished the implementation of @wapperdude's suggested approach. The conditions for plotting the mid-points based on the state of the left/right vertices was a PITA, but it worked out in the end. I've attached a sample screen of what these now look like. Thank you all for your help. If anyone would like a copy to improve it, please let me know and I'll post a *.vsd.

wapperdude

Very nice.  Bit different than my original understanding.  It has a bit of Excel look to it, but with varying dot size.  I'm sure there are forum members that might want the Visio file.  You might want to add it as a new entry in the User-submitted Stuff.

Congrats!
Wapperdude
Visio 2019 Pro