Hi Sandra,
Thanks for the reply.
Your example using GetPointerStyle works, however I don’t know if it's appropriate for what I'm trying to do. You're changing the appearance of the pointer based on the value - however I wish to change the appearance based on the outcome of a condition that doesn't involve either the x or y value. Basically I make a call to a database and retrieve a set of rows which I iterate and then add to my chart. For example the pseudo code might look like this:
Code: Select all
Get rows from database
For each row in my resultset
Get x value from field1
Get y value from field2
test condition e.g. is value from field3 = value from field4
if condition is true
series.add(x value, y value, default point color)
else
series.add(x value, y value, custom point color)
end
Next
The GetPointerStyle executes after I've added all my points to the chart and executes once for each point in each series(?). I no longer have access to the underlying data at this stage to test my condition, and I can’t just assume to change the style of any point that is not the default color, as its possible that the default series color might also be the custom color (I allow the user to define the series color). So I'd have to keep track (in an array) perhaps of all points whose style I need to change and search this in the GetPointerStyle event? It just seems a lot of work and a bit of an inefficient way to do things. I would have hoped that there would be some way when adding data using the series Add method to specify rather than just a color but a pointer style, e.g.
Code: Select all
series.add(x value, y value, custom point style that includes color and shape and size properties)
Is there an event that executes immediately after point is added to the series in which I could change the style of the most recent point?
Regarding the legend I've noticed that if I set the ColorEachLine property to False and exclude the line setting the ColorEach property then the line and pointer styles appear in the legend, which is what I want. I can still add a point with a different color as I described previously i.e.
Thanks for the tip on re OnDrawSymbol. So if I had ColorEach set to true and ColorEachLine set to false then I'd have to create a custom image of a line with a symbol through it (or whatever the current style is) and add it in the manner described? Just thinking out loud (and perhaps I'm lazy) but it seems that changing the style of a point is kicking a off a lotta work or at least more than I'd hoped.
Thanks again though I appreciate the help,
Norman