ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Charts and Charting in Excel (https://www.excelbanter.com/charts-charting-excel/)
-   -   Problems with simple line graphs (https://www.excelbanter.com/charts-charting-excel/450283-problems-simple-line-graphs.html)

Ian Hay

Problems with simple line graphs
 
I am presenting a simple 2d array of values in VBA (which is variable in size) and get different graph formats for the same graph style depending on the number of columns. For example, this data:

Ave Set1 Set2 Set3 ...... Set10
C1 7.5 7.0 6.0 6.5 4.0
C2 7.5 7.5 7.5 7.5 6.0
C3 7.5 8.0 9.0 8.5 5.0

which is a 2d array (C1/Ave/7.5 are one cell, C1/Set10/4.0 are another cell etc) displays a perfect line graph with the decimal values as the 'y' values, C1 to C3 as the 'x' axis and Ave, Set1 to Set10 as the Legend.

If I add a new Set, say Set11, the graph format changes so C1 to C3 become the Legend and Ave, Set1 to Set11 become the 'x' axis. Please Help!

Lisa Wilke-Thissen[_2_]

Problems with simple line graphs
 
Hi,

If I add a new Set, say Set11, the graph format changes
so C1 to C3 become the Legend and Ave, Set1 to Set11
become the 'x' axis.


how do you add the new Set? After that, do you create a new graph, or do you
just expand data range?
I think, after creating a new chart you have to switch columns/rows.

--
Cheers,
Lisa


Ian Hay

Quote:

Originally Posted by Lisa Wilke-Thissen[_2_] (Post 1618421)
Hi,
[color=blue][i]

how do you add the new Set? After that, do you create a new graph, or do you
just expand data range?
I think, after creating a new chart you have to switch columns/rows.

--
Cheers,
Lisa

Thanks Lisa. The new set is created effectively from scratch being a completely different set of data from the previous array. The graph is invoked again as a fresh call to the graph. Why would we need to switch cols/rows? Do you know if the graph requires this or is this a workaround?

Lisa Wilke-Thissen[_2_]

Problems with simple line graphs
 
Hi,

The graph is invoked again as a fresh call to the graph.
Why would we need to switch cols/rows?


Ave Set1 Set2 Set3 ...... Set10
C1 7.5 7.0 6.0 6.5 4.0
C2 7.5 7.5 7.5 7.5 6.0
C3 7.5 8.0 9.0 8.5 5.0


regarding your array, in a default chart C1, C2, C3 will be the legend.
Set1, Set2 ... will be the x-axis.
Therefore, in Word 2013 you have to choose "Chart Tools | Design | Data |
Switch Row/Column" for your chard.

--
Cheers,
Lisa


Ian Hay

Quote:

Originally Posted by Lisa Wilke-Thissen[_2_] (Post 1618450)
Hi,

The graph is invoked again as a fresh call to the graph.
Why would we need to switch cols/rows?


Ave Set1 Set2 Set3 ...... Set10
C1 7.5 7.0 6.0 6.5 4.0
C2 7.5 7.5 7.5 7.5 6.0
C3 7.5 8.0 9.0 8.5 5.0


regarding your array, in a default chart C1, C2, C3 will be the legend.
Set1, Set2 ... will be the x-axis.
Therefore, in Word 2013 you have to choose "Chart Tools | Design | Data |
Switch Row/Column" for your chard.

--
Cheers,
Lisa

Brilliant - thanks very much Lisa.


All times are GMT +1. The time now is 11:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com