Question about ChartSeries

Hi

I download a sample project of candle bar chart. there is a piece of code below:

ChartSeries series = new ChartSeries("series", ChartSeriesType.Candle);

series.Points.Add(1, 10, 6, 7, 8);

series.Points.Add(2, 10, 6, 8, 7);

series.Points.Add(3, 8, 3, 7, 6);

series.Points.Add(4, 16, 9, 11, 14);

series.Points.Add(5, 18, 11, 13, 16);

series.Points.Add(6, 10, 3, 7, 4);

I believe that it construct candla bar data and add to chart. What i wonder is that the first parameter. 

dependence on source code and what the char looks like, I guess first parameter just only means a index of a candle bar. the left four parameters are open price, close price, high price and low price. so if first parameter is a index then why the data type is double, i think it should be integer.

 




1 Reply

DD Devakumar Dhanapoosanam Syncfusion Team February 28, 2022 02:36 PM UTC

Hi UMLer, 
 
We would like to let you know that you can add integer, double, DateTime or string as the first parameter of the series.Points method. The first parameter value will be the X-Value of the chart data point, not an index. Based on the PrimaryXAxis ValueType, it will plotting the graph in the chart. For more details, please refer the below UG link. 
 
 
Regards, 
Devakumar D 


Loader.
Up arrow icon