Is there a way where i can:
Thanks
LineChartAppearance lineApp = this.ultraChart1.CompositeChart.ChartLayers[1].ChartTypeAppearance as LineChartAppearance;lineApp.LineAppearances.Add(new LineAppearance());lineApp.LineAppearances[1].IconAppearance.Icon = SymbolIcon.Circle;lineApp.LineAppearances[1].IconAppearance.IconSize = SymbolIconSize.Large;
that should answer your first question. as for the second one ... you can either use the axis Margins for the x-axis of the line chart, or you can handle the FillSceneGraph event, find your Polyline, loop through its datapoints, and re-map them using the x-axis. that would look something like this...
ChartLayer columnLayer = this.ultraChart1.CompositeChart.ChartLayers[0].ChartLayer; Axis xAxis = columnLayer.Grid["X"] as Axis; foreach (Primitive p in e.SceneGraph) { Polyline pL = p as Polyline; if (pL != null) { for (int current = 0; current < pL.points.Length; current++) { pL.points[current].point.X = (int)xAxis.Map(current + 0.5); } } }
Hey David,
THe [1] is throwing an error - i have attaced the code in a text file - just trying to get that issue ironed out.
Thanks much
BudgetChart.CompositeChart.ChartLayers[1]will throw an index out of range exception because you haven't added columnLayer and lineLayer to the chartlayers collection yet.you can replace the above expression with "lineLayer"LineChartAppearance lineApp = lineLayer.ChartTypeAppearance as LineChartAppearance;
LineChartAppearance lineApp = lineLayer.ChartTypeAppearance as LineChartAppearance;
Sorry, but i am just now getting the sytax to add the IconAppearance after the first line
here is the code i used - is it possible just to add the LineAppearance in the NumericSeries?
NumericSeries seriesLine = new NumericSeries(); seriesLine.Data.DataSource = mybudget.GetBudgetLineData(14, 4);seriesLine.Data.LabelColumn = "Fiscal_Month";seriesLine.Data.ValueColumn = "Budget";seriesLine.PEs.Add(new PaintElement(Color.Red));BudgetChart.CompositeChart.Series.Add(seriesLine);
LineAppearance lineApp1 = new LineAppearance();lineApp1.LineStyle.EndStyle = LineCapStyle.Square;lineApp1.Thickness = 10;lineApp1.IconAppearance.IconSize = SymbolIconSize.Large;this.BudgetChart.LineChart.LineAppearances.Add(lineApp1);
ChartLayerAppearance lineLayer = new ChartLayerAppearance();lineLayer.AxisX = xAxisLine;lineLayer.AxisY = yAxis;lineLayer.ChartArea = area;lineLayer.ChartType = ChartType.LineChart;lineLayer.Series.Add(seriesLine);
That worked!!
Thanks so much David - really appreciate it!!
no, that's not possible.
add this line after setting lineLayer.ChartType and it should work:
((LineChartAppearance)lineLayer.ChartTypeAppearance).LineAppearances.Add(lineApp1);