Hi,
Am trying to create a line chart with multiple axis. I made the chart type as composite and then created two layers with chart type as linechart.
But it drwas as many lines as the number of datapoints. How can I get it to draw two line charts each using different Y axis?
ultraChart1.ColorModel.ModelStyle = ColorModels.CustomSkin;
ultraChart1.ColorModel.Skin.PEs.Add(new PaintElement(Color.Blue));
this.ultraChart1.Legend.Location = LegendLocation.Top;
NumericSeries scl1 = new NumericSeries();
scl1.Points.Add((new NumericDataPoint(30, "1", false)));
scl1.Points.Add((new NumericDataPoint(50, "6", false)));
scl1.Points.Add((new NumericDataPoint(60, "8", false)));
axisX.OrientationType = AxisNumber.X_Axis;
axisX.TickmarkStyle = AxisTickStyle.Smart;
axisX.Labels.Orientation = TextOrientation.VerticalLeftFacing;
area1.Axes.Add(axisX);
axisY1.OrientationType = AxisNumber.Y_Axis;
axisY1.TickmarkStyle = AxisTickStyle.Smart;
axisY1.Labels.Orientation = TextOrientation.Horizontal;
area1.Axes.Add(axisY1);
axisY2.OrientationType = AxisNumber.Y2_Axis;
axisY2.TickmarkStyle = AxisTickStyle.Smart;
axisY2.Labels.Orientation = TextOrientation.Horizontal;
area1.Axes.Add(axisY2);
LineChartLayer1.Series.Add(scl);
LineChartLayer1.ChartArea = area1;
LineChartLayer1.AxisX = axisX;
LineChartLayer1.AxisY = axisY1;
lineChartLayer2.Series.Add(scl1);
lineChartLayer2.ChartArea = area1;
lineChartLayer2.AxisX = axisX;
lineChartLayer2.AxisY = axisY2;
this.ultraChart1.CompositeChart.ChartLayers.Add(lineChartLayer2);
this should fix it:
axisX.DataType = AxisDataType.String; axisX.SetLabelAxisType = SetLabelAxisType.ContinuousData;
http://help.infragistics.com/Help/NetAdvantage/NET/2008.2/CLR2.0/html/Chart_Axis_Requirements_for_Composite_Charts.html