Jump to content
Software FX Community

CustomGridLine Send it to the back


adolfocg

Recommended Posts

I created a customGridLine dinamically from source:

double[] strokeArr = { 1, 1, 1 };

CustomGridLine c2 = new CustomGridLine();

c2.Value = value;

Brush borderBrush = new SolidColorBrush(Color.FromArgb(225, 155, 55, 75));

c2.Stroke = borderBrush; c2.StrokeThickness = 3;

c2.StrokeDashArray = new DoubleCollection(strokeArr);

chart1.AxisY.CustomGridLines.Add(c2);

But my problem is that the CustomGridLine appear over the Points of the chart. I'd like to mive this GridLine backwards downto the bottom of the chart.

I tried to create this CustomGridLine before adding all the points to the chart and no way...

Thanks

AdolfoCG

Link to comment
Share on other sites

Hi AdolfoCG,I am afraid this is by design. CustomGridLines are meant to highlight limits or specific points of interest in the chart. They can be drawn anywhere in the chart area by being attached to a particular value in the Axis but they are intended to appear over the points by design. RandyJ

Link to comment
Share on other sites

Good news, most of our code was internally ready to handle gridlines on the back or front (note that Axis.Grids.ShowInFront allows to move the default grids to the front) so we have added a ShowInFront property to CustomGridLine (default is true).

You can pickup this change by downloading hotfix build 3693 or later here, note that if UAC is enabled in your machine you have to run IE as administrator.

I hope this works for you

JuanC

Link to comment
Share on other sites

  • 8 months later...

Note that you posted a message in the "Chart FX for WPF" forum which is a different product than "Chart FX 7 for VS 2005".

If you are in fact using ChartFX 7 for VS 2005 as you stated then you need something like this

  customGrid.ExtraStyle |= CustomGridLineStyles.BackOnly;

If you are using Chart FX for WPF (as the screenshot seems to imply) then you need to make sure you download the most recent hotfix for ChartFX for WPF, the third number in the version for ChartFX.WPF.dll is the build number. ShowInFront was added in build 3693.

JuanC

Link to comment
Share on other sites

Thank you, this worked for me.  I am using ChartFX 7 (not WPF), so wrong forum - I agree.  Here is the code I added for benefit of others. 

  Me.Chart1.Series(0).AxisY.CustomGridLines(0).ExtraStyle = _

  Me.Chart1.Series(0).AxisY.CustomGridLines(0).ExtraStyle Or CustomGridLineStyles.BackOnly

Link to comment
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.

Guest
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...