Jump to content
Software FX Community

Independent colours for each point, same colour for line

Recommended Posts

[using ChartFx for Windows forms v6.2]

The sample code at


shows assigning independent colours to each marker point by setting the

PointAttibutes on each point.

How can I set the colour per point, but not change the colour of the lines

between each point?

For a single series, I want the lines between the points to be the same

colour, but the marker points to be different colours. How can this be done?



Link to post
Share on other sites

What you need to do is use the Border Color to draw the line instead of the 

Series color, this way you can have your line being a different color from

the Marker.

Here is how you can do this:

chart1.TypeMask &= ~ChartType.ColorLine; // Instruct Chart FX to NOT use the

color of the series for the lines but use the border instead

// Copy the series color as the border color

chart1.Series[0].BorderEffect = BorderEffect.None;

chart1.Series[0].BorderColor = chart1.Series[0].Color;

chart1.Series[1].BorderEffect = BorderEffect.None;

chart1.Series[1].BorderColor = chart1.Series[1].Color;

// .. do it for all series

// Change the color for a specific point. Now this will not affect the line,

only the marker.

chart1.Point[0,3].Color = Color.Red;


Francisco Padron


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...