Jump to content
Software FX Community

Stacked Bar on Y Axis w/ Line on Y2 - Line paints behind bars


Cecilia Daniels

Recommended Posts

Hello -- 

I have a chart with several series rendered as a Stacked Bar on the Y Axis.

In addition I have 1 or more series rendered as line(s) on the Y2 axis.

I am unable to make the line(s) appear in front of the stacked bar.

Note: When the Yaxis is a Bar, I can use .sendtoback or .bringtofront on the individual series items to make the line appear in the front. But when I change to stackedbar it does not appear to have an effect.

Any ideas.  I took the additionalaxes sample app. and modified to illustrate the problem.  I can post it if it would help.

Thanks,

Cecilia Daniels

 

 

Link to comment
Share on other sites

Hi Cecilia Daniels

 

I found a workaround for your issue.  It will only work if the latest series is the one with Lines gallery type.

 

 

List<SeriesAttributes> allSeries = new List<SeriesAttributes>();<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

 

//Adds all series (in current order) to the auxiliar Collection

foreach (SeriesAttributes series in chart1.Series)

{

  allSeries.Add(series);

}

 

//Iterate from all series and invert the current order

foreach (SeriesAttributes series in allSeries)

{

    series.BringToFront();

}

 

I hope it helps.

 

-- Pipon

 

Link to comment
Share on other sites

  • 2 weeks later...

Pipon -

I do not think your work around is going to work for me.

My application allows for more than one line on the chart.

The stacked bar is associated with the Y Axis and the Lines are associated with the Y2 Axis.

We currently use series.sendtoback to move the stacked bar items to the back so we can group lines and bars together on the legend. The Y2 items are now show at the beginning of the legend. 

The lack of control over the positioning of items on the chart coupled with the lack of control over the order items appear in the legend seems to be a significant weakness in ChartFX. 

Do you know it ChartFX is aware of this weakness and if there is any hope of them fixing it?

Thank you,

Cecilia Daniels

 

 

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