I have a chart which needs 2 Y axis. If I use the Column Chart for example it works.
However if I change it to ColumnChart3D, the left Axis (y) is ok, but the Y2 axis, to the right, all the axis labels are printed one on top of the other.
Am I missing something ?
thanks
Fred
what is the
area.Axes.Add(axisY);
AREA property, it's a property of what
Hello Fred,
In that case you should have similar code. Please take a look how to implement different axis and assign each axis to desired series.
// Axis Y
AxisItem axisY = new AxisItem();
axisY.Extent = 20;
axisY.DataType = AxisDataType.Numeric;
axisY.Labels.ItemFormatString = "<DATA_VALUE:00.00>";
axisY.OrientationType = AxisNumber.Y_Axis;
axisY.LineColor = Color.Blue;
// Axis Y2
AxisItem axisY2 = new AxisItem();
axisY2.Extent = 20;
axisY2.DataType = AxisDataType.Numeric;
axisY2.Labels.ItemFormatString = "<DATA_VALUE:00.00>";
axisY2.OrientationType = AxisNumber.Y2_Axis;
axisY2.LineColor = Color.Blue;
area.Axes.Add(axisY2);
// Series 1
XYSeries series1 = new XYSeries();
series1.Label = "Year 2010";
series1.DataBind(dt, "MonthID", "2010", "Month");
series1.PEs.Add(new PaintElement(Color.Blue));
XYSeries series2 = new XYSeries();
series2.Label = "Year 2011";
series2.DataBind(dt, "MonthID", "2011", "Month");
series2.PEs.Add(new PaintElement(Color.Red));
ChartLayerAppearance myColumnLayer = new ChartLayerAppearance();
myColumnLayer.ChartType = ChartType.ScatterChart;
myColumnLayer.ChartArea = area;
myColumnLayer.Series.Add(series1);
myColumnLayer.AxisX = axisX;
myColumnLayer.AxisY = axisY;
ultraChart1.CompositeChart.Series.Add(series1);
this.ultraChart1.CompositeChart.ChartLayers.Add(myColumnLayer);
ChartLayerAppearance myColumnLayer2 = new ChartLayerAppearance();
myColumnLayer2.ChartType = ChartType.ScatterChart;
myColumnLayer2.ChartArea = area;
myColumnLayer2.AxisX = axisX;
myColumnLayer2.AxisY2 = axisY2;
myColumnLayer2.Series.Add(series2);
ultraChart1.CompositeChart.Series.Add(series2);
this.ultraChart1.CompositeChart.ChartLayers.Add(myColumnLayer2);
Let me know if you have any questions.
Regards
I realize that even if I manage to display the Y2 labels, the scale itself is not applied.
I guess my problem is how to specify which series apply to which axis (y or y2)
I made a test with the same build and everthing works properly. Could you please send us your sample that reproduce this issue and I`ll be glad ot research it for you.
using 12.1.20121.1001. I will get the service pack today...
but
I think I figured out a possibility what is the error
My data is like this
Date AMOUNT PROFIT QTY
2001-01-01 10000 5000 25
2001-02-01 12000 6000 20
2001-03-01 14000 5500 18
what i want is that column 1 be the X Label
Column 2 and 3 be on Y1 label on the left
and Column4 be on Y2 label on the right
I think the scale of Y2 is not updated hence all the numbers show very close to the origin ?
again just on the 3D