For example:
x is Longitude in chart.
y is Dimension in chart.
value is Population.
I can not achieve the aspirations.
please help me and give me some c# code .thanks.
-------------------------------------------
i have a Mapping Data(Matrix Data) File(new_SWC_2.txt) , Contents is:
0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.332 0.332 0.332 0.332 0.332 0.332 0.332 0.332 0.332 0.332 0.332 0.332 0.332 0.332 0.332 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.332 0.332 0.332 0.332 0.332 0.332 0.332 0.332 0.332 0.332 0.332 0.332 0.332 0.332 0.332 0.332 0.332 0.332 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000
use bubble chart is OK. in Matrix ,0.332 is Longitude and Dimension value.
code:
private void ultraButton1_Click(object sender, EventArgs e) { string strLine; string outstring = ""; int i = 1;int j = 1; string mess = @"d:\new_SWC_2.txt"; StreamReader sr = new StreamReader(mess); do { //string outstring = ""; strLine = sr.ReadLine(); if (strLine != null) { char[ cc = strLine.ToCharArray(); foreach (char c in cc) {
if (c != 32) { if ((c > 47 && c < 58) || c == 46) { outstring = outstring + c.ToString(); } } else { if (outstring.Length > 0) { string uteString = i.ToString() + "," + j.ToString() + ":" + outstring + "!!!\n"; //ultraTextEditor1.AppendText(uteString); if ((i / 100) > 0) { j++; i = 0; } XYZSeries aaa = new XYZSeries(); if (System.Convert.ToDouble(outstring.ToString()) > 0) { aaa.Points.Add(new XYZDataPoint(i, j, System.Convert.ToDouble(outstring.ToString()), "", false)); this.ultraChart1.Series.Add(aaa); } i++; outstring = ""; } } } } } while (!sr.EndOfStream); sr.Close();
}
------------------------------------
i want to achieve,use scattercharts.
Dear Rivlin :
Thank you for your help
Testing......
You can use the same approach for scatter charts, but instead of creating XYZSeries, create XYSeries.When you add points for the series use aaa.Points.Add(new XYZDataPoint(i, j, "", false));