J Antoni

J Antoni

  • NA
  • 81
  • 36.1k

EPPlus - Custom label for dataPoints in scatter chart

Mar 29 2018 1:10 AM
I am using EPPlus to generate an Excel using C#.
 
My Requirement
 
I need to give a custom label for the dataPoints plotted in my scatter chart. By default - on hover of a datapoint on the chart it shows only the X-Axis and Y-Axis Value.
 
Along with X\Y Axis I would need to include a data for TimeReceived. This data will be available on the Excel columns.
 
Excel columns : X Value, Y Value , TimeReceived
 
Please share your suggestions on this.
 
What I have tried:
 
My Current Code
  1. var scatterChart =  
  2. workSheet.Drawings.AddChart("scatterChart", eChartType.XYScatterLines) as ExcelScatterChart;  
  3. scatterChart.Title.Text = GraphTitle;  
  4. var rangeLabel = workSheet.Cells["D2:D2571"];  
  5. var range1 = workSheet.Cells["C2:C2571"];  
  6. scatterChart.Series.Add(range1, rangeLabel);  
  7. scatterChart.Series[0].Header = workSheet.Cells["A1"].Value.ToString();  
  8. scatterChart.Legend.Position = eLegendPosition.Right;  
  9. scatterChart.SetSize(600, 300);  
  10. scatterChart.SetPosition(5, 0, 1, 0);