Line graph with two data sets

Giordano Bruno

Well-known Member
Joined
Jan 7, 2007
Messages
1,341
I have a graph which tracks two sets of percentage values by weeks on the x axis. The data is in two adjacent columns and works well if I have multiple rows of data. I use code to set the data source using a dynamic range. If I remove all rows other than the first, the chart shows two points on week 1 and the other weeks. If I then rerun the data source macro, the chart changes to show only week 1 and the two points for the data. If I then rerun the code, the chart shows weeks 1 and 2 and a line between points 1 and 2.
It seems that the graph has assumed that when there is only a single row, there is only a single series and two weeks rather than the reverse. If anyone can point to a way forward I would be eternally grateful.
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

Forum statistics

Threads
1,214,800
Messages
6,121,641
Members
449,044
Latest member
hherna01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top