Hi,
I have this chart:
I want to put all the points in black colors, and adding for each points its corresponding label as in the table below:
These are the data :
Note: I have just remaned my columns:
Z X Y
It's working Know.
I just want to clarify 2 points: (DataBind, and spaces is the solution below the best way for doing it?)
If I use the dataBind, I will not obtain the Design effect we need, so I droped the two line below,
UltraChart1.Data.DataSource = ds;
UltraChart1.Data.DataBind();
And I replace Them by: (but if I want to view ma labels clearly, I would add some spaces after the text Label zVal + " ", if not the circle Icon will be on it)
for (int i = 0; i < tbl.Rows.Count; i++)
{
DataRow myRow = tbl.Rows[i];
double xVal = Convert.ToInt32(myRow["X"]);
double yVal = Convert.ToInt32(myRow["Y"]);
string zVal = myRow["Z"].ToString();
xySeries.Points.Add(
}
with out adding spaces to labels: xySeries.Points.Add(new XYDataPoint(xVal, yVal, zVal, false));
After adding spaces:
xySeries.Points.Add(new XYDataPoint(xVal, yVal, zVal + " ", false));
Tks for the Help.
Let me know if you need more assistance regarding this.
Hello Zakia ,
The FillSceneGraph event is used to add/remove Primitives to/from your chart before the chart is rendered.
You should add the appearance before this phase.
You can use the Load method of the UltraChart
protected void UltraChart1_Load(object sender, EventArgs e)
XYSeries xySeries = new XYSeries();
// Add data points
xySeries.Points.Add(new XYDataPoint(15, 20, "T1", false));
xySeries.Points.Add(new XYDataPoint(30, 35, "T2", false));
xySeries.Points.Add(new XYDataPoint(50, 30, "T3", false));
xySeries.Points.Add(new XYDataPoint(60, 65, "T4", false));
xySeries.Points.Add(new XYDataPoint(35, 25, "T5", false));
xySeries.Points.Add(new XYDataPoint(80, 39, "T6", false));
xySeries.Points.Add(new XYDataPoint(90, 45, "T7", false));
xySeries.Points.Add(new XYDataPoint(40, 65, "T8", false));
xySeries.Points.Add(new XYDataPoint(35, 80, "T9", false));
xySeries.PEs.Add(new PaintElement(Color.Black));
this.UltraChart1.Series.Add(xySeries);
ScatterChartAppearance appearance = new ScatterChartAppearance();
ChartTextAppearance chartText = new ChartTextAppearance();
chartText.Row = -2;
chartText.Column = -2;
chartText.ItemFormatString = "<ITEM_LABEL>";
chartText.Visible = true;
appearance.ChartText.Add(chartText);
appearance.Icon = SymbolIcon.Circle;
appearance.IconSize = SymbolIconSize.Small;
UltraChart1.ScatterChart.ChartText.Add(chartText);
this.UltraChart1.CompositeChart.ChartLayers[0].Series.Add(xySeries);
this.UltraChart1.CompositeChart.ChartLayers[0].ChartTypeAppearance = appearance;
I inserted the lines in the UltraChart1_FillSceneGraph, but it does not work, so where shall I put the code?
Thanks.