React Stock Chart component. TypeError-Cannot read properties of undefined (reading 'xValue')

After applying TrendLines in StockChart, TypeError: Cannot read properties of undefined (reading 'xValue') is happening

StockChart Component:  

<StockChartComponent id='stockchartdefault' periods={periodselector} zoomSettings={zoomsettings} primaryXAxis={{
valueType: 'DateTimeCategory',
majorGridLines: { width: 0 }, majorTickLines: { color: 'transparent' },
crosshairTooltip: { enable: true }
}} primaryYAxis={{
labelFormat: 'n0',
lineStyle: { width: 0 }, rangePadding: 'None',
majorTickLines: { width: 0 },
crosshairTooltip: { enable: true }
}} chartArea={{ border: { width: 0 } }} tooltip={{ enable: true, shared: true }} tooltipRender={tooltipRender} crosshair={{ enable: true }}>
<Inject services={[DateTime, Zoom, DateTimeCategory, Tooltip, RangeTooltip, Crosshair, LineSeries, SplineSeries, CandleSeries, HiloOpenCloseSeries, HiloSeries, RangeAreaSeries, Trendlines,
EmaIndicator, RsiIndicator, BollingerBands, TmaIndicator, MomentumIndicator, SmaIndicator, AtrIndicator, Export,
AccumulationDistributionIndicator, MacdIndicator, StochasticIndicator]} />
<StockChartSeriesCollectionDirective>
<StockChartSeriesDirective dataSource={props.history} xName='x' type='Candle' animation={{ enable: true }} bearFillColor='#e56590' bullFillColor='#f8b883'>
</StockChartSeriesDirective>
</StockChartSeriesCollectionDirective>
</StockChartComponent>

1 Reply

NP Nishanthi Panner Selvam Syncfusion Team October 15, 2024 02:38 PM UTC

Hi Vivekanandan Nagarajan,


We have ensured your reported scenario by creating stock chart with trendline. StockChart and trendlines are rendered properly as per behavior. We have attached the tested sample and screenshot for your reference. Please check with sample.


Screenshot:



Sample: https://stackblitz.com/edit/react-qufzpf-buapyz?file=index.js


Since we are unable to replicate an issue from our end, we request you to share the following information which will be helpful for further analysis and provide you the solution sooner.

  • Try to reproduce the reported scenario in above sample.
  • Share the details if you have done any other customization in your sample.
  • Share your dataSource file.
  • Share your package version.


Regards,

Nishanthi


Loader.
Up arrow icon