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
Hello Fred,
If you want to achieve desired behavior you should set both properties to True:
- Y2.Labels.Visible=true;
- Y2.Visible = true;
Please take a look at the attached video file for more details.
Regards
This is what I get..
see on the right, the number are like all typed one on top of another
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)
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;
area.Axes.Add(axisY);
// 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.
what is the
AREA property, it's a property of what
What if my data in like so
Does your method still applies ?
Could you please take a look at the attached sample and if you think that I didn`t reproduce your scenario, please feel free to modify this sample to reproduce your scenario and issue and revert it back to me. I`ll be glad ot research your issue.
Let me know if you have any questions
the problem remaining is that 2 columns will have huge numbers in the 10000 and the last one small numbers
So i would like first two to be on different scale (y) that last one (y1) so last column is not dwarfed by the scale
Quote
looked at your sample.. thanks.. very close i think
Here is the sample