I want to create horizontal oriented bar chart with labels placed on y-axis.
How to make y axis labels visible for negative bar values? (See example: "bar two" is not visible, because bar draws over the label).
GraphPanemyPane=zgc.GraphPane;//SetthetitlesandaxislabelsmyPane.Title.Text="Axis Cross Demo";myPane.XAxis.Title.Text="My X Axis";myPane.YAxis.Title.Text="My Y Axis";//MakeupsomedataarraysbasedontheSinefunctiondoublex,y;PointPairListlist=newPointPairList();for(inti=0; i < 4; i++){
x=(i-2);y=i;list.Add(x,y);}
//Generatearedcurvewithdiamond//symbols,and"Porsche" in the legend
BarItem myBar = myPane.AddBar("Bar", pptest, Color.Blue);
myBar.IsY2Axis = true;
// Set the Y axis intersect the X axis at an X value of 0.0
myPane.YAxis.Cross = 0.0;
// Turn off the axis frame and all the opposite side tics
Setting IsZeroLine to true moves labels away from x=0 axis. I would like to have labels written in front of negative bar and labels pointing to x=0 (y) axis.
Is that possible?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I want to create horizontal oriented bar chart with labels placed on y-axis.
How to make y axis labels visible for negative bar values? (See example: "bar two" is not visible, because bar draws over the label).
// LineItem myCurve = myPane.AddCurve("Parabola", list, Color.Green, SymbolType.Diamond);
// pptest.Add(i - 2, i+1);
}
pptest.Add(0, 2);
pptest.Add(1, 5);
pptest.Add(2, 3);
pptest.Add(3, 6);
pptest.Add(4, 4);
/ myPane.Y2AxisMin = 0;
myPane.Y2Axis.Max = 4; /
/ myPane.Chart.Border.IsVisible = false;
myPane.XAxis.MajorTic.IsOpposite = false;
myPane.XAxis.MinorTic.IsOpposite = false;
myPane.YAxis.MajorTic.IsOpposite = false;
myPane.YAxis.MinorTic.IsOpposite = false;/
Sorry wrong example :)
Hi,
Try commenting out the "Cross" setting, and adding a zero line like this:
//myPane.YAxis.Cross = 0.0;
myPane.XAxis.MajorGrid.IsZeroLine = true;
John
Hi!
Thank you for your answer.
Setting IsZeroLine to true moves labels away from x=0 axis. I would like to have labels written in front of negative bar and labels pointing to x=0 (y) axis.
Is that possible?