Hi,
I am trying to create a bar graph with 2 y axis. but whenever i move a column to the right to create the second axis - the bars become almost nested and I can't separate them.
I would like the bars to be separate as in the first graph but with the 2 different axis.
Seems like something very basic that I am missing -what is it?
Thanks,
Eran
Hi @eranse ,
I am guessing you want a second axis because the magnitude of Column 3 is so much larger that Columns 2 and 4. However, in my opinion, a two axis bar chart is fraught with the risk of misinterpretation: a bar with a value of 90 next to a bar with about the same height and a value 340 is jarring. I think two axis plots can be useful to show data trends with lines, and even then only if the axes are colored to match the curves, etc.
Since the GraphBuilder platform is not producing what you need, I am suggesting an alternative plot
Graph Builder(
Size( 763, 517 ),
Show Control Panel( 0 ),
Graph Spacing( 10 ),
Variables( X( :Column 1 ), Y( :Column 4 ), Y( :Column 2 ), Y( :Column 3 ) ),
Elements(
Position( 1, 1 ),
Bar( X, Y, Legend( 9 ), Label( "Label by Value" ) )
),
Elements(
Position( 1, 2 ),
Bar( X, Y, Legend( 8 ), Label( "Label by Value" ) )
),
Elements(
Position( 1, 3 ),
Bar( X, Y, Legend( 7 ), Label( "Label by Value" ) )
),
SendToReport(
Dispatch( {}, "Graph Builder", OutlineBox, {Select} ),
Dispatch( {}, "Column 4", ScaleBox, {Label Row( Show Major Grid( 1 ) )} ),
Dispatch( {}, "Column 2", ScaleBox, {Label Row( Show Major Grid( 1 ) )} ),
Dispatch( {}, "Column 3", ScaleBox, {Label Row( Show Major Grid( 1 ) )} ),
Dispatch(
{},
"Y title",
TextEditBox,
{Set Font Size( 12 ), Set Font Style( "Bold" ), Font Color( 53 )}
),
Dispatch(
{},
"Y 1 title",
TextEditBox,
{Set Font Size( 12 ), Set Font Style( "Bold" ), Font Color( 19 )}
),
Dispatch(
{},
"Y 2 title",
TextEditBox,
{Set Font Size( 12 ), Set Font Style( "Bold" ), Font Color( 20 )}
),
Dispatch(
{},
"400",
LegendBox,
{Legend Position( {9, [1], 8, [0], 7, [2]} ), Position( {1, 0, 2} )}
)
)
)
However, I can create the graph you want (that I do not like). It requires restructuring your data. See the attached journal that creates the data table and this graph.
"Just because you can, doesn't mean you should."
Thanks,
I understand the potential problem with a graph with different y scales, but it is helpful to show the direction of the data, and I am not certain that placing the information on different graphs is always better.
Thank you for the solution - it does solve it perfectly.
Best,
Eran