6

I'm making a candlestick chart in C# for a bitcoin trading helper. When the form loads, the chart is just an empty white space because there are no data points initially. Is there any way to display the grid lines and the axes when there are no data points? Thank you!

EDIT: A data point is added ~1 minute after loading, so aesthetically I think it would look better to have the empty grid lines and axes than to simply hide the chart altogether.

This is all I've added to the load method:

chart1.Titles.Add("Candlestick Chart");
//chart grid lines colors
chart1.ChartAreas[0].AxisX.MajorGrid.Enabled = false;
chart1.ChartAreas[0].AxisY.MajorGrid.LineColor = Color.Gray;
doornetd
  • 61
  • 1
  • 3
  • 1
    why do you want to show grid lines when there is no data ? best is to hide the chart – shujaat siddiqui Dec 26 '13 at 05:33
  • Welcome to StackOverflow! Despite how much you may have tried already, this question will likely be closed unless you show code you've written and the problems you are having with it. – crthompson Dec 26 '13 at 05:33
  • 1
    A data point is added ~1 minute after loading, so aesthetically I think it would look better to have the empty grid lines and axes than to simply hide the chart altogether. – doornetd Dec 26 '13 at 05:37

1 Answers1

4

I think you can add empty point for the Chart series data points chart3.Series[0].Points.Add(); chart3.Series[0].Points[0].IsEmpty = true; check this: https://www.syncfusion.com/kb/73/how-do-i-set-emptypoint-for-the-chart-series-data-points