Jump to content
Software FX Community

ChartFX Pie Dataset Hardcoded?


User (Legacy)

Recommended Posts

I've been using SimpleChart, but now need ChartFX.

Q. How can I hardcode a ChartFX Pie and dataset?

Here is code for SimpleChart and dataset:

if (dataset.Pie.Rows.Count > 0)

{

DataView dv = new DataView(dataset.Pie);

foreach (DataRowView drv in dv)

{

object missing = Missing.Value;

string names = Convert.ToString(drv["names"]);

double counts = Convert.ToDouble(drv["counts"]);

SimpleChart.pieChart.ChartData.Add(names, counts,

FillStyle.scFillModeAutoSolid, ref missing, ref missing, ref missing, ref

missing, ref missing, ref missing);

}

for (int i = 1; i <= SimpleChart.pieChart.ChartData.Count; i++)

{

SimplyChart.pieChart.ChartData[i].Value = i * 100;

tabControl2.TabPages[5].Text = ("Users#: " + "(" + i + ")");

}

Link to comment
Share on other sites

I've been using SimpleChart, but now need ChartFX.

Q. How can I hardcode a ChartFX Pie and dataset?

Here is code for SimpleChart and dataset:

if (dataset.Pie.Rows.Count > 0)

{

DataView dv = new DataView(dataset.Pie);

foreach (DataRowView drv in dv)

{

object missing = Missing.Value;

string names = Convert.ToString(drv["names"]);

double counts = Convert.ToDouble(drv["counts"]);

SimpleChart.pieChart.ChartData.Add(names, counts,

FillStyle.scFillModeAutoSolid, ref missing, ref missing, ref missing, ref

missing, ref missing, ref missing);

}

for (int i = 1; i <= SimpleChart.pieChart.ChartData.Count; i++)

{

SimplyChart.pieChart.ChartData[i].Value = i * 100;

tabControl2.TabPages[5].Text = ("Users#: " + "(" + i + ")");

}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...