Posted 2 May 2019, 8:10 am EST
Hello,
I am trying to use the C1Chart according to your C# code example:
private void Form1_Load(object sender, EventArgs e)
{
// Clear previous data
c1Chart1.ChartGroups[0].ChartData.SeriesList.Clear();
// Data
string[] items = new string[] { "Item1", "Item2", "Item3"};
int[] sales2005 = new int[] { 800, 1500, 2000};
int[] sales2006 = new int[] { 1000, 1200, 1400};
// Create first series
C1.Win.C1Chart.ChartDataSeries ds2005 =
c1Chart1.ChartGroups[0].ChartData.SeriesList.AddNewSeries();
ds2005.Label = "2005";
ds2005.LineStyle.Color = Color.Yellow;
ds2005.X.CopyDataIn( items);
ds2005.Y.CopyDataIn( sales2005);
// Create second series
C1.Win.C1Chart.ChartDataSeries ds2006 =
c1Chart1.ChartGroups[0].ChartData.SeriesList.AddNewSeries();
ds2006.Label = "2006";
ds2006.LineStyle.Color = Color.Red;
ds2006.AutoEnumerate = true;
ds2006.Y.CopyDataIn( sales2006);
// Set chart type
c1Chart1.ChartGroups[0].ChartType = C1.Win.C1Chart.Chart2DTypeEnum.Bar;
c1Chart1.ChartGroups[0].Stacked = true;
// Set y-axis minimum
c1Chart1.ChartArea.AxisY.Min = 0;
c1Chart1.Legend.Visible = true;
// Remove the Axes caption
c1Chart1.ChartArea.AxisX.Text = "";
c1Chart1.ChartArea.AxisY.Text = "";
}
I did something similar but more dynamic, according to the data of a datatable.
My question is how can I add a tool tip text support that displays for each graph column the series data. The X the Y and the series to which it belongs.
The main problem is to get the value of each series in the graph column.
Thank you in advance for your help.