# STACKED BAR Chart: is it possible to have a target line without use the XY Scatter method?

1. ## STACKED BAR Chart: is it possible to have a target line without use the XY Scatter method?

I have a stacked bar chart and trying to determine if it is possible to get a target line on the chart without using the XY scatter method?

2. ## Re: STACKED BAR Chart: is it possible to have a target line without use the XY Scatter met

Just change the target series to a line

A sample data spreadSheet would help , see yellow banner
I have made a quick example here

3. ## Re: STACKED BAR Chart: is it possible to have a target line without use the XY Scatter met

I should have specified "horizontal" stacked bar chart.

For some reason just changing it to a line in the horizontal stacked bar chart will not work, or least I can't get it to work.

I can get the XY scatter method to work but I have 19 charts and when I copy then go back to change and select data I have to go through the whole drill of adding a series for the xy scatter to work.

4. ## Re: STACKED BAR Chart: is it possible to have a target line without use the XY Scatter met

The problem of using a line series is 2 fold.

line series are normal categorical, so a target of non integer value will be difficult
line series progress across the chart rather than plot specific values like a xy scatter. So under normal circumstances the first point is on the left and the second point on the right of a slope between the two points.

You could use Y error bar to provide a vertical line at a given category but trying to keep the horizontal category axis used by the line and the numeric horizontal axis used by the stacked bars will be very difficult.

If you can use VBA you could use the vertical axis line. The VBA would be to position it when the value changes.
There is a UDF (UserDefinedFunction) in F1.

5. ## Re: STACKED BAR Chart: is it possible to have a target line without use the XY Scatter met

Andy Pope--thank you. I thought it might take a VBA solution. I will see how this works., and thanks again.

6. ## Re: STACKED BAR Chart: is it possible to have a target line without use the XY Scatter met

FYI, the VBA is only required to update the chart automatically rather than actually implement the line.